Drop-Down unique values

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Drop-Down unique values

iwolf
Hi everybody,

is it possible to get list of unique values using the widget-form drop-down. I want a dropdown with the brandname of the PRODUCT entity.

<field name="brandName" title="${uiLabelMap.BrandName}">
            <drop-down allow-empty="true">
                <entity-options entity-name="Product" key-field-name="productId" description="${brandName}">
                    <entity-order-by field-name="brandName"/>
                                                                                <entity-constraint name="brandName" operator="not-equals"  value=""/>
                </entity-options>
            </drop-down>
        </field>

Thanks for any hint.

Best regards,
Ingo

Reply | Threaded
Open this post in threaded view
|

Re: Drop-Down unique values

Rishi Solanki
This is not available out of the box. Two options we have to achieve this,
and one option need to explore;
1. Add brands in different table and render it from there.
2. Use FTL instead and fetch data in groovy file or using any other script.
3. I'm not sure, but there is an service-name attribute under the field,
but I'm not sure if it is useful.

Best Regards,
--
Rishi Solanki
*CTO, Mindpath Technology*
Intelligent Solutions
cell: +91-98932-87847
LinkedIn <https://www.linkedin.com/in/rishi-solanki-62271b7/>


On Wed, Mar 3, 2021 at 9:44 PM Ingo Wolfmayr <[hidden email]>
wrote:

> Hi everybody,
>
> is it possible to get list of unique values using the widget-form
> drop-down. I want a dropdown with the brandname of the PRODUCT entity.
>
> <field name="brandName" title="${uiLabelMap.BrandName}">
>             <drop-down allow-empty="true">
>                 <entity-options entity-name="Product"
> key-field-name="productId" description="${brandName}">
>                     <entity-order-by field-name="brandName"/>
>
>       <entity-constraint name="brandName" operator="not-equals"  value=""/>
>                 </entity-options>
>             </drop-down>
>         </field>
>
> Thanks for any hint.
>
> Best regards,
> Ingo
>
>
Reply | Threaded
Open this post in threaded view
|

AW: Drop-Down unique values

iwolf
Hi Rishi,

Thanks, I tried both:

groovy script works  & using a service in the form works as well:

<actions>
            <service service-name="getBrands" result-map-list="brands"></service>
</actions>

<field name="brandName" title="${uiLabelMap.BrandName}">
            <drop-down allow-empty="true">
              <list-options key-name="brandName" list-name="brands" description="${brandName}"/>
            </drop-down>
</field>

Thanks for your hint.

Best regards,
Ingo

-----Ursprüngliche Nachricht-----
Von: Rishi Solanki <[hidden email]>
Gesendet: Montag, 15. März 2021 23:31
An: ofbizuser <[hidden email]>
Betreff: Re: Drop-Down unique values

This is not available out of the box. Two options we have to achieve this, and one option need to explore; 1. Add brands in different table and render it from there.
2. Use FTL instead and fetch data in groovy file or using any other script.
3. I'm not sure, but there is an service-name attribute under the field, but I'm not sure if it is useful.

Best Regards,
--
Rishi Solanki
*CTO, Mindpath Technology*
Intelligent Solutions
cell: +91-98932-87847
LinkedIn <https://www.linkedin.com/in/rishi-solanki-62271b7/>


On Wed, Mar 3, 2021 at 9:44 PM Ingo Wolfmayr <[hidden email]>
wrote:

> Hi everybody,
>
> is it possible to get list of unique values using the widget-form
> drop-down. I want a dropdown with the brandname of the PRODUCT entity.
>
> <field name="brandName" title="${uiLabelMap.BrandName}">
>             <drop-down allow-empty="true">
>                 <entity-options entity-name="Product"
> key-field-name="productId" description="${brandName}">
>                     <entity-order-by field-name="brandName"/>
>
>       <entity-constraint name="brandName" operator="not-equals"  value=""/>
>                 </entity-options>
>             </drop-down>
>         </field>
>
> Thanks for any hint.
>
> Best regards,
> Ingo
>
>