You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Ingo Wolfmayr <in...@wolfix.at> on 2021/03/03 16:14:33 UTC

Drop-Down unique values

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


AW: Drop-Down unique values

Posted by Ingo Wolfmayr <in...@wolfix.at>.
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 <ri...@gmail.com> 
Gesendet: Montag, 15. März 2021 23:31
An: ofbizuser <us...@ofbiz.apache.org>
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 <in...@wolfix.at>
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
>
>

Re: Drop-Down unique values

Posted by Rishi Solanki <ri...@gmail.com>.
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 <in...@wolfix.at>
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
>
>