PDA

View Full Version : Avoid tab activation



spawn150
27 Jul 2007, 10:48 AM
Hi all,

how can I cancel the event 'activate' on a tab? In my situation I need to avoid that a user can be able to exit from the tab panel. I don't need simply a check on tabchange, but in case the user exits form the tab container, I have to inhibit the possibility to exit the tab in that moment active.

Thanks for your help,

Francesco

jsakalos
27 Jul 2007, 12:42 PM
There is event beforetabchange on TabPanel. You can cancel it from there.

spawn150
28 Jul 2007, 12:39 AM
When I change the tab in the same TabPanel this event works, but my problem is when I click in a tab that is inside another TabPanel :(

jsakalos
28 Jul 2007, 1:25 AM
When I change the tab in the same TabPanel this event works, but my problem is when I click in a tab that is inside another TabPanel :(

Hmmm, it needs some more coding then....;) You can try fire this event for another tab panel from first tab panel handler. You'd need to have some flag in this case to know if this is "own" or "other" event.

spawn150
29 Jul 2007, 3:48 AM
My idea was add a new event, something like 'beforeactivate', and when I click in a tab of another tabPanel, I check if a 'flag' has correct value, and if it hasn't, cancel the event. I have wrote code for this...but It seems that two events are fired on click in a tab! :(
This my idea, is it a correct way to work?

Thanks,

Francesco