Hi folks, I'm trying to do a conditional tab switching method. How can I prevent to switch to the second tab if, let's say, on the first tab any of conditions are not met? I tried to use the tabbedPanel 'ignoreChanges="Y"' action attribute, and I've created the success and unsucces method, but the tab changed anyway.
Thanks in advance! |
Hi Szilard, It is true the the tab changes first. The event we are calling is postTabChanged after all. But I was able to not see the grid in my local test. Did you try setting the current tab to the first one before showing the alert?
With this code I don't see the grid in the second tab. Finally, if this doesn't work for you either ( I think it should) I am not sure if the tabbedPanel is the right way to implement what you have in mind. Maybe a button or a hyperlink can achieve what you want in a better way? Hope this helps. Kind Regards, Hi Yalim, It works fine! (And the solution is very obvious...) And you are right, it's not the best way to solve the described problem. I'm just trying to imitate the behavior of an existing application. Thank you anyway!
(24 Nov '15, 03:59)
S7ilA
Hi Szilard, Cool. Happy to hear that the issue is resolved. Thank you very much for your interest in Formspider! :-) Kind Regards,
(24 Nov '15, 04:01)
Yalim ♦♦
|
Hi, You can use the api_tabbedPanel.setCurrentTab API in the tabChanged event to take the user back to the tab she was on. For example consider the tabbedPanel named tabbedPanel1 with the following content:
Calling
in the doTabChanged action causes the application to always stay on Tab 1. Hope this helps. Kind Regards, |
Hi Yalim, I tried the postTabChanged event. Unfortunately, the tab change happens anyway. It is true, after evaluating the conditions, the first page will be active again. My original goal was to set the filtering conditions on the first tab, and the grid on the second tab (and the datasource) would use these conditions to determine the list of records. With your solution the second tab and the empty grid appears behind the alert window. So, there is no way to deny the tab change, before it happens, if the conditions don't met? Best Regards, Szilard |