Page 1 of 1

Always return to the First Tab

Posted: Mon Jun 19, 2017 12:29 pm
by smohsen
Hello,
In order to return to last selected tab I am doing the following and it is working great.
But my users like to always return to the First tab. I am not sure how to accomplish that. I would appreciate any help you can offer.

Ontabclick event I am doing this:
sessionStorage.setItem("MYSCREEN_LASTTAB", tab);

And in the screen's "onload" event, I am doing this:
var lastTab = sessionStorage.getItem("MYSCREEN_LASTTAB");
if (lastTab) {
setTab("TabPanel1", lastTab);
}

Thank you,
Sayed Mohsen

Re: Always return to the First Tab

Posted: Tue Jun 20, 2017 2:24 pm
by Scott Klement
I guess I'm not sure what you're asking. You've got special code that sets the tab back to the last one used -- what do you want it to do instead? Are you saying you don't want it to use that code anymore, and you're not sure how to remove the code?

Re: Always return to the First Tab

Posted: Tue Jun 20, 2017 3:17 pm
by smohsen
I like to always start from first tab regardless which tab I was on last time.

Re: Always return to the First Tab

Posted: Tue Jun 20, 2017 3:23 pm
by Scott Klement
Just remove the code that's setting the tab to a different tab. It will default to always starting on the first tab.

Re: Always return to the First Tab

Posted: Tue Jun 20, 2017 3:38 pm
by smohsen
I have removed the codes. Now I am always starting from 1st tab but can not switch from the 1st tab to 2nd or 3rd tab.
If I click on the 2nd or 3rd tab it immediately returns to 1st tab.
I must not be doing something right!

Re: Always return to the First Tab

Posted: Tue Jun 20, 2017 4:01 pm
by Scott Klement
It sounds like you set the "ontabclick" property to a blank value instead of removing it.

Right-click the "ontabclick" property and choose "remove property value".

Re: Always return to the First Tab

Posted: Tue Jun 20, 2017 4:31 pm
by smohsen
I removed the "ontabclick" property by right clicking and removing it.
Compiled the Display and RPG. Still no luck.

Re: Always return to the First Tab

Posted: Wed Jun 21, 2017 1:15 am
by Scott Klement
So the problem is that you cannot switch to other tabs? What properties do you have set on the tab panel?

Re: Always return to the First Tab

Posted: Thu Jun 22, 2017 12:26 pm
by smohsen
This is the tab property:
Snipping.docx
(30.11 KiB) Downloaded 654 times

Re: Always return to the First Tab

Posted: Thu Jun 22, 2017 12:50 pm
by Scott Klement
For the convenience of people reading this thread, so you don't have to download and open smohsen's Word document... it only contains an image. Here's that image:
tabPanel.png
tabPanel.png (43.48 KiB) Viewed 1875 times
I created a tab panel with these settings, and it works fine for me. Are you sure these are the only settings?