You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Medhat AbdelBadie <me...@gmail.com> on 2013/04/14 03:28:15 UTC

"Look up Product and Price" Displays many empty options in the Combo Box "Primary Product Category Id"

Hi,

When open "Look up Product and Price" Look up which is reached by the
following Steps:

Order >> Quotes >>  find Quote or create new Quote >> Quote Items >> Create
New Quote Item >>  open look up beside "Product Id"

The Combo Box "Primary Product Category Id" Contains many empty options
when scroll down inside the Combo Box.

This is because Combo box displays data in the "DESCRIPTION" field in the
entity "ProductCategory" Which maybe contains empty values in many records.

To solve this issue, I am suggesting the following:

In the File : /applications/product/widget/catalog/FieldLookupForms.xml

at lines 144 - 150,

144    <field name="primaryProductCategoryId">
145        <drop-down allow-empty="true">
146            <entity-options description="${description}"
entity-name="ProductCategory" key-field-name="productCategoryId">
147                <entity-order-by field-name="description"/>
148            </entity-options>
149        </drop-down>
150    </field>

Add the following line after line 146

*<entity-constraint name="description" operator="not-in" value="'',''"/>*

Then the above code snippet becomes:

144    <field name="primaryProductCategoryId">
145        <drop-down allow-empty="true">
146            <entity-options description="${description}"
entity-name="ProductCategory" key-field-name="productCategoryId">
147                *<entity-constraint name="description" operator="not-in"
value="'',''"/>*
148                <entity-order-by field-name="description"/>
149            </entity-options>
150        </drop-down>
151    </field>

This will remove any empty "DESCRIPTION" field's value from being listed in
the Combo Box.

This behavior is existing on "demo-trunk" and  ofbiz version 12.04.01.

What you think about that ?

Regards,
Medhat

Re: "Look up Product and Price" Displays many empty options in the Combo Box "Primary Product Category Id"

Posted by Vikas Mayur <vi...@gmail.com>.
I think it would be nice to use both something like description="${id} - ${description}"

-
Vikas

On Apr 14, 2013, at 6:58 AM, Medhat AbdelBadie wrote:

> Hi,
> 
> When open "Look up Product and Price" Look up which is reached by the
> following Steps:
> 
> Order >> Quotes >>  find Quote or create new Quote >> Quote Items >> Create
> New Quote Item >>  open look up beside "Product Id"
> 
> The Combo Box "Primary Product Category Id" Contains many empty options
> when scroll down inside the Combo Box.
> 
> This is because Combo box displays data in the "DESCRIPTION" field in the
> entity "ProductCategory" Which maybe contains empty values in many records.
> 
> To solve this issue, I am suggesting the following:
> 
> In the File : /applications/product/widget/catalog/FieldLookupForms.xml
> 
> at lines 144 - 150,
> 
> 144    <field name="primaryProductCategoryId">
> 145        <drop-down allow-empty="true">
> 146            <entity-options description="${description}"
> entity-name="ProductCategory" key-field-name="productCategoryId">
> 147                <entity-order-by field-name="description"/>
> 148            </entity-options>
> 149        </drop-down>
> 150    </field>
> 
> Add the following line after line 146
> 
> *<entity-constraint name="description" operator="not-in" value="'',''"/>*
> 
> Then the above code snippet becomes:
> 
> 144    <field name="primaryProductCategoryId">
> 145        <drop-down allow-empty="true">
> 146            <entity-options description="${description}"
> entity-name="ProductCategory" key-field-name="productCategoryId">
> 147                *<entity-constraint name="description" operator="not-in"
> value="'',''"/>*
> 148                <entity-order-by field-name="description"/>
> 149            </entity-options>
> 150        </drop-down>
> 151    </field>
> 
> This will remove any empty "DESCRIPTION" field's value from being listed in
> the Combo Box.
> 
> This behavior is existing on "demo-trunk" and  ofbiz version 12.04.01.
> 
> What you think about that ?
> 
> Regards,
> Medhat