How do i store the return value from javascript in XML from declaration

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

How do i store the return value from javascript in XML from declaration

vivek
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Kind Regards,
Vivek J
Reply | Threaded
Open this post in threaded view
|

Re: How do i store the return value from javascript in XML from declaration

Bilgin Ibryam-2
Hi Vivek,

you can't pass a value from javascript which is executed at run time (when
the user clicks on the dropdown) to the entity-constrain which is executed
at render time (when the page is initially generated by widget engine). You
can achieve what you want, by removing entity-constrain and change your
javascript code to set defaultConfigOptionId option using configItemId value

HTH
Bilgin

On Sat, Oct 9, 2010 at 2:28 PM, vivek <[hidden email]> wrote:

>
> Hi All,
>
> Here i am trying to add drop down attribute to the defaultConfigOptionId
> tab
> inside product administration page. When we are adding not updating the
> config item to the product i wish that the configItemId should be passed as
> an entity constraint to the drop down of defaultConfigOptionId. Here below
> is the code i am trying: form name: AddProductConfig File: ProductForms.xml
>
> <field name="configItemId" title="${uiLabelMap.ProductConfigItem}"
> event="onchange" action="return configItemIdPassed()">
>  <drop-down>
>      <entity-options entity-name="ProductConfigItem"
> description="${configItemName}
>          <entity-order-by field-name="configItemName"/>
>      </entity-options>
>  </drop-down>
> </field>
>
> <field name="defaultConfigOptionId"
> title="${uiLabelMap.DefaultConfigOptionId}">
>    <drop-down>
>    <entity-options entity-name="ProductConfigOption"
> key-field-name="configOptionId" description="${configOptionId}">
>      <entity-constraint name="configItemId" operator="equals"
> value="wantJavaScriptValueHere"/>
>      <entity-order-by field-name="configItemId"/>
>    </entity-options>
>    </drop-down>
> </field>
>
> js included in other ftl
> function configItemIdPassed(){
> var idPassed = document.AddProductConfig.configItemId.value;
> return idPassed;
> }
>
> However i added the dropdown to updateProductConfig form successfully as
> confgiItemId is already available.
>
> I am stuck at this place & is desperately looking out for option to do it.
> Your help would be highly appreciated.
>
> thanks
>
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/How-do-i-store-the-return-value-from-javascript-in-XML-from-declaration-tp2969572p2969572.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: How do i store the return value from javascript in XML from declaration

vivek
Thanks Bilgin,

But i found out that with help of submitting the form partially, the parameters can be populated & the javascript can be used.

The concern is resolved & working without heck now

Thanks again
Kind Regards,
Vivek J