You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by amit charaya <of...@palinfocom.net> on 2007/06/27 13:18:09 UTC

select box error

I want to add product category id into primaryProductCategoryId field.
i have added a select box  in the form that shows the product creation
screen using following code:

<field name="productCategoryId" title="${uiLabelMap.ProductPrimaryCategory}"
widget-style="selectBox">
            <drop-down allow-empty="true">
                <entity-options entity-name="ProductCategory" 
description="${categoryName} [{productCategoryId}]">
                       <entity-order-by field-name="categoryName"/>
                </entity-options>
            </drop-down>
        </field>

and following line in simple method that create the product using map
newEntity.
 <set field="newEntity.primaryProductCategoryId"
from-field="parameters.productCategoryId"  />
it shows the values in select box but doesn't insert the selected value in
the product. it returns null
where am i wrong?
please provide help..

-- 
View this message in context: http://www.nabble.com/select-box-error-tf3987696.html#a11322494
Sent from the OFBiz - Dev mailing list archive at Nabble.com.


Re: select box error

Posted by Jacques Le Roux <ja...@les7arts.com>.
Please *don't* send this type of message to the dev ML.

The dev ML is intended to *developing* OFBiz not to *use* it !

Thanks

Jacques

De : "amit charaya" <of...@palinfocom.net>
> 
> I want to add product category id into primaryProductCategoryId field.
> i have added a select box  in the form that shows the product creation
> screen using following code:
> 
> <field name="productCategoryId" title="${uiLabelMap.ProductPrimaryCategory}"
> widget-style="selectBox">
>             <drop-down allow-empty="true">
>                 <entity-options entity-name="ProductCategory" 
> description="${categoryName} [{productCategoryId}]">
>                        <entity-order-by field-name="categoryName"/>
>                 </entity-options>
>             </drop-down>
>         </field>
> 
> and following line in simple method that create the product using map
> newEntity.
>  <set field="newEntity.primaryProductCategoryId"
> from-field="parameters.productCategoryId"  />
> it shows the values in select box but doesn't insert the selected value in
> the product. it returns null
> where am i wrong?
> please provide help..
> 
> -- 
> View this message in context: http://www.nabble.com/select-box-error-tf3987696.html#a11322494
> Sent from the OFBiz - Dev mailing list archive at Nabble.com.

Re: select box error

Posted by Vikash Anand <pr...@gmail.com>.
Dear Amit;
          Jacopo is right. In ofbiz if you want to add new fields you can
add it in entitymodel.xml and it will be loaded in database. You do not need
to make any changes in services as it returns values using map.

Using code by Jacopo you can show data in your ftl file.

Thanks and Regards;
Vikash Anand.

On 6/27/07, amit charaya <of...@palinfocom.net> wrote:
>
>
> I want to add product category id into primaryProductCategoryId field.
> i have added a select box  in the form that shows the product creation
> screen using following code:
>
> <field name="productCategoryId" title="${uiLabelMap.ProductPrimaryCategory
> }"
> widget-style="selectBox">
>             <drop-down allow-empty="true">
>                 <entity-options entity-name="ProductCategory"
> description="${categoryName} [{productCategoryId}]">
>                        <entity-order-by field-name="categoryName"/>
>                 </entity-options>
>             </drop-down>
>         </field>
>
> and following line in simple method that create the product using map
> newEntity.
> <set field="newEntity.primaryProductCategoryId"
> from-field="parameters.productCategoryId"  />
> it shows the values in select box but doesn't insert the selected value in
> the product. it returns null
> where am i wrong?
> please provide help..
>
> --
> View this message in context:
> http://www.nabble.com/select-box-error-tf3987696.html#a11322494
> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>
>

Re: select box error

Posted by Jacopo Cappellato <ti...@sastau.it>.
Amit,

please post this kind of messages to the user list (they are not about 
developing the official OFBiz).

The correct form field definition should be:

<field name="primaryProductCategoryId" 
title="${uiLabelMap.ProductPrimaryCategory}">
   <drop-down allow-empty="true">
     <entity-options entity-name="ProductCategory"
description="${categoryName} [{productCategoryId}]" 
key-field-name="productCategoryId">
       <entity-order-by field-name="categoryName"/>
     </entity-options>
   </drop-down>
</field>

With this, no changes to the service will be needed.

Jacopo

amit charaya wrote:
> I want to add product category id into primaryProductCategoryId field.
> i have added a select box  in the form that shows the product creation
> screen using following code:
> 
> <field name="productCategoryId" title="${uiLabelMap.ProductPrimaryCategory}"
> widget-style="selectBox">
>             <drop-down allow-empty="true">
>                 <entity-options entity-name="ProductCategory" 
> description="${categoryName} [{productCategoryId}]">
>                        <entity-order-by field-name="categoryName"/>
>                 </entity-options>
>             </drop-down>
>         </field>
> 
> and following line in simple method that create the product using map
> newEntity.
>  <set field="newEntity.primaryProductCategoryId"
> from-field="parameters.productCategoryId"  />
> it shows the values in select box but doesn't insert the selected value in
> the product. it returns null
> where am i wrong?
> please provide help..
>