Hidden Field with Dynamic Dropdown using Ajax

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
hoangtrungcs
Posts: 4
Joined: Wed Sep 21, 2016 12:54 pm

Hidden Field with Dynamic Dropdown using Ajax

Post by hoangtrungcs » Wed Oct 18, 2017 4:55 pm

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

AbelS
Posts: 5
Joined: Wed Nov 16, 2016 1:43 pm

Re: Hidden Field with Dynamic Dropdown using Ajax

Post by AbelS » Thu Oct 19, 2017 4:16 pm

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

hoangtrungcs
Posts: 4
Joined: Wed Sep 21, 2016 12:54 pm

Re: Hidden Field with Dynamic Dropdown using Ajax

Post by hoangtrungcs » Fri Oct 20, 2017 2:33 pm

Thank you for your reply.
Please see file attached about my problem.

Hope to receive support
Attachments
LANSA AJAX COMBOBOX.xlsx
(11.65 KiB) Downloaded 15 times

AbelS
Posts: 5
Joined: Wed Nov 16, 2016 1:43 pm

Re: Hidden Field with Dynamic Dropdown using Ajax

Post by AbelS » Tue Oct 24, 2017 4:12 pm

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

hoangtrungcs
Posts: 4
Joined: Wed Sep 21, 2016 12:54 pm

Re: Hidden Field with Dynamic Dropdown using Ajax

Post by hoangtrungcs » Wed Oct 25, 2017 12:19 pm

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 ?

AbelS
Posts: 5
Joined: Wed Nov 16, 2016 1:43 pm

Re: Hidden Field with Dynamic Dropdown using Ajax

Post by AbelS » Wed Oct 25, 2017 2:50 pm

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

hoangtrungcs
Posts: 4
Joined: Wed Sep 21, 2016 12:54 pm

Re: Hidden Field with Dynamic Dropdown using Ajax

Post by hoangtrungcs » Wed Oct 25, 2017 4:40 pm

Hi Abel

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

Post Reply