Page 1 of 1

Hidden Field with Dynamic Dropdown using Ajax

Posted: Wed Oct 18, 2017 4:55 pm
by hoangtrungcs
Dear All,
I have problems when using Dynamic drop down as below:
I follow by the example of the url:
http://docs.lansa.com/14/en/lansa087/in ... n%7C_____1

Everything is good, but i want to skip the value that selected from 2 dropdown after page reload.
If i put the value field of dynamic selected control to Hidden content, then value and contents of that dropdown will be null.
So have any solutions for this probem please help me!
Thank you so much

Re: Hidden Field with Dynamic Dropdown using Ajax

Posted: Thu Oct 19, 2017 4:16 pm
by AbelS
Hi Trung

Could you please post an example of what you want to do? That will help me understand what you want to achieve.

Abel

Re: Hidden Field with Dynamic Dropdown using Ajax

Posted: Fri Oct 20, 2017 2:33 pm
by hoangtrungcs
Thank you for your reply.
Please see file attached about my problem.

Hope to receive support

Re: Hidden Field with Dynamic Dropdown using Ajax

Posted: Tue Oct 24, 2017 4:12 pm
by AbelS
I created a similar sample (but with a dynamic select weblet to choose a language for simplicity (you can use a radio button group, but you have to add your own script for updating a hidden field and triggering a change event for this hidden field (you mentioned using a hidden field, so you might be using this technique).

In my case the second dropdown (DISTRICT) from your sample is not refreshed because the current REGION code value is not changed (only the caption, from English to Chinese or vice versa). Only when the value (the code field) changes does the REGION weblet trigger a change event that makes DISTRICT refresh its list.

Abel

Re: Hidden Field with Dynamic Dropdown using Ajax

Posted: Wed Oct 25, 2017 12:19 pm
by hoangtrungcs
Dear Abels
Thank you for your quick reply

<<I created a similar sample (but with a dynamic select weblet to choose a language for simplicity (you can use a radio button group, but you have to add your own script for updating a hidden field and triggering a change event for this hidden field (you mentioned using a hidden field, so you might be using this technique).>>
==>I understand.

<<In my case the second dropdown (DISTRICT) from your sample is not refreshed because the current REGION code value is not changed (only the caption, from English to Chinese or vice versa). Only when the value (the code field) changes does the REGION weblet trigger a change event that makes DISTRICT refresh its list.>>
==> my problems as same that. But i want to refresh the District and Street to binding again with English or Chinese when i selected from language radio button. Do you have any solutions for these ?

Re: Hidden Field with Dynamic Dropdown using Ajax

Posted: Wed Oct 25, 2017 2:50 pm
by AbelS
Hi Trung

Let's say your regions are REG1, REG2 and REG3. For the region dropdown set the values to REG1EN, REG2EN and REG3EN for English and REG1CN, REG2CN and REG3CN for Chinese. When the region value is posted, use substring to extract the region code.

Do the same for district codes.

HTH
Abel

Re: Hidden Field with Dynamic Dropdown using Ajax

Posted: Wed Oct 25, 2017 4:40 pm
by hoangtrungcs
Hi Abel

Thank you so much for your support!!
That's great solution !