cancel
Showing results for 
Search instead for 
Did you mean: 

Personas 2.0: Tab: How to trigger an action whenever switching between tabs?

Former Member
0 Kudos

Hi Personas experts,

The use case:

My tcode (eg iw38) lands on a UI where several tabs are shown. Depending on the parameter passed in, a group box on the tab "Header Data" should be hidden or shown. Let's assume that it should be hidden in this example. Such action is handled by a script button (say, called "Act_Btn") which is called in the screen loading handler - meaning that when the screen is shown at the first time, the action is made and the UI looks fine (ie the group box is invisible on the tab Header Data).

The issue:

Now if user clicks another tab, then click the "Header Data" tab again, it looks that the Act_Btn was not clicked, thus the action was not applied - yielding that the group box is shown on tab Header Data now which is wrong.

Does anyone have an idea how to solve it? My solution is that if the Act_Btn can somehow be "Push"ed whenever user switches tabs. But how to trigger such a button push event when user clicks a tab?

Thanks a lot!

Dong Zhu

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

hi dong,

there is an oncreatehandler for tab too.

Select a tab, and goto properties window, you should be able to see oncreatehandler.

Sushant

Former Member
0 Kudos

Oh! I never knew that! It is on the tab content rather than the tab header, which I guess makes sense, but wasn't where I was looking

Thanks Sushant.

Former Member
0 Kudos

Hi Sushant,

Thanks for the tip, I will try it soon.

Br,

Dong

Former Member
0 Kudos

just a small correction - need to select the content area of a tab, but not the tab header.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi all,

Thanks for the tips. By attaching the script button to the tab content's onCreateHandler, the issue is solved, namely the group box is shown/hidden correctly while switching tabs.

Set the Correct answer.

Br,

Dong

Former Member
0 Kudos

Hi Dong - this is an interesting idea.

What does the script look like that hides or reveals a group box on a screen depending on another field? I can't picture how you are doing that.

Thanks.

Patrick

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

I suspect something like this is in use

And yes, as Sushant mentioned, you can trigger a script when switching tabs by attaching the script button to the OnCreateHandler of the tab item content.

Former Member
0 Kudos

Thanks Tamas.

Former Member
0 Kudos

Hi Patrick,

To do hide/show, I just used a hack way by someone - use a label control placed by the group box, set the label background color the same as the sceen color. Make a Show button to write one-char, and a Hide button to write a long string to the label to make a cover. The third button does the check of the input value of a field and then call the Push of either the Show or Hide button. Then the groupd box is shown or hidden depending on the field value. Hope this helps you.

Now it seems possible to attach the third button to the tab handler. I will try it soon.

Br,

Dong

Former Member
0 Kudos

Thanks Tamas,

I will try it out.

Br,

Dong

Former Member
0 Kudos

Thanks Tamas/Dong - this works great!!

Rregards.

Patrick

Former Member
0 Kudos

There's no way I'm aware of to trigger a script when a user switches tabs, sorry. At least, not in Personas v2. In v3 there's an event that triggers on tab switch.

Steve.