How to remove a variable from the parameters context?

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

How to remove a variable from the parameters context?

Patrick-4
How can I remove the variable "productCategoryId" from the parameters
context?  The reason I want to do this is because I'm doing a
drop-down on productCategoryId but displaying categoryName.  I expect
to see {Apples, Oranges} in my drop-down, but I see {10011 (a
productCategoryId available in $parameters), Apples, Oranges}
Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: How to remove a variable from the parameters context?

Parimal Gain
Hi Patrick,

In case you have categoryName in parameter you need to use
parameters.categoryName in description attribute(for form-widget), no
need to remove id form it.

If there is need of removing then, parameters is nothing but a map, you
can use methods regarding map.

for ftl you can use this pattern

<select>
    <option
value="${parameters.productCategoryId!}">${parameters.categoryName!}</option>
</select>


HTH

Regards
--
Parimal Gain

Patrick wrote:
> How can I remove the variable "productCategoryId" from the parameters
> context?  The reason I want to do this is because I'm doing a
> drop-down on productCategoryId but displaying categoryName.  I expect
> to see {Apples, Oranges} in my drop-down, but I see {10011 (a
> productCategoryId available in $parameters), Apples, Oranges}
> Thanks.
>  
Reply | Threaded
Open this post in threaded view
|

Re: How to remove a variable from the parameters context?

Brajesh Patel-2
In reply to this post by Patrick-4
Hi Patrick,
If you have productCategoryId in the parameter and need to show
categoryName then use in side of the form widget:
        <field name="primaryProductCategoryId"
title="${uiLabelMap.ProductPrimaryCategory}">
            <drop-down allow-empty="true">
                <entity-options entity-name="ProductCategory"
key-field-name="productCategoryId" description="${categoryName}">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
 
and for ftl you have already got answer.
--
Brajesh Patel

Patrick wrote:
> How can I remove the variable "productCategoryId" from the parameters
> context?  The reason I want to do this is because I'm doing a
> drop-down on productCategoryId but displaying categoryName.  I expect
> to see {Apples, Oranges} in my drop-down, but I see {10011 (a
> productCategoryId available in $parameters), Apples, Oranges}
> Thanks.
>