21
Views
3
Comments
how to insert session Variables in Combo Boxes and update onChange?
Application Type
Traditional Web

I want to have a Combo box remember the last item click. I've got it to show up in the combo box using a session variable. My issues comes in with the on Change action. I need it to do everything in the on change action. This action only works if I physically change the combo box I need this action to happen even when the combo box remembers the last item that was selected for it after the page refreshes.


Any Ideas?

2022-05-02 13-50-49
Paulo Ritto

Hi @Pedro Torres ,


IF I understood correctly, you want to trigger the OnChange of your combobox when you enter the screen, even if you don't change anything in the combo?


I want to ask you why would you want to do that, since it doesn't make any sense to force trigger an OnChange without even touching the widget, and there are probably other ways to achieve what you want.


Can you explain in further detail why you want to trigger the onchange when you arrive at the screen, even though the combo is to remain with the selected element? what's your end goal with that?


If you answer this I can help you further!


Kind regards,
Paulo

UserImage.jpg
Pedro Torres

the reason is after the change i have it set to update other parts of the screen inside of the onchange action. so I would like that action to update the other parts of the screen based on what the current combobox is without a change.

2022-05-02 13-50-49
Paulo Ritto

Hi @Pedro Torres ,


Your logic on other parts of the screen is then dependent on the variable you have currently associated with the Combobox, but you already have it associated with a session variable. So when you navigate to that screen again, in the preparation, before the screen renders, you should check the value of the session variable and act accordingly in those other parts of the screen that depend on it.

You don't and shouldn't try to trigger an onchange if the combobox hasn't changed.

Let me know if this helped,

Paulo

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.