cancel
Showing results for 
Search instead for 
Did you mean: 

TabStrip onSelect or Context for Enable another View

Former Member
0 Kudos

Hello@all,

I have 4 Tabs and on the right side on extra view.

Now I only want to show (enable) the view if I selected the firstTab.

when I selected the other three Tabs, the View should be disabled.

How should I do this??

With a context attribute?

or

With an action for the onSelected row in the TabStrip properties?

What should I do exactly. Please write the code for this feature.

It's a big problem.

Thanks

Best regards

Marcus

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

This can be done like this:

- Add a ViewContainerUIElement "viewArea" to the right of the tabstrip

- Embed the additional view inside "viewArea" using the window editor

- Bind property "visible" of "viewArea" to a calculated context attribute "viewAreaVisibility" of dictionary type "Visibility"

- Bind property "selectedTab" of tabstrip to a context attribute "selectedTabId" of type "string"

- Assign any action to the "onSelect" event of the tabstrip

Implement the calculated attribute as


WDVisibility getViewAreaVisibility(...element)
{
  return "id_of_first_tab".equals( element.getSelectedTabId() );
}

Armin

Former Member
0 Kudos

Hi,

I have 4 Tabs and on the right side on extra view.

Now I only want to show (enable) the view if I selected the firstTab.

when I selected the other three Tabs, the View should be disabled.

How should I do this??

Create a context attribute of type WDVisibility, bound this attribute to the visibility of your viewContainer and initially set this to WDVISIBLE if first Tab is selected by default.

And on change of the tabs check for the selected tab if its not the first tab then make the visibility to NONE.

Regards

Ayyapparaj

Former Member
0 Kudos

Hello,

thank so far, but can you explane me this step by step?

where should I create the context - attribute?

where should I bind this attribute?

where should I write which code?

Thanks for your help.

Best regards

Marcus

former_member201361
Active Contributor
0 Kudos

hi,

In the tab strip , there will be an event OnSelect . here u create an action and bind the Action to the OnSelect property of the Tab Strip.

In the Window design the Required ViewSet.

For eg :

Consider this is the window and in the u have design the viewset according to ur requirements.

###################################################

  1. # Another View #

  2. #

#

  1. TabStrip View # # Empty View

#

#

  1. # #

#

#

#

  1. # #

#

#

##################################################

Now Consider in the above viewSet , create a Outbound Plug from the TabStrip View to the Another View .

and In the same way create another outBound Plug from the TabStrip View to the Empty View . create the Data Link between the TabStrip view and the Another View .

in the similar way data link between the TabStrip View to the Empty View .

In the Tab Strip View:

Create a Attribute such as "Test" and type is String .

Bind The test Attribute to the selectedTab property of the Tab Strip.

Now go the OnAction Method :

Use this code :

OnActionMethod :

If("FirstTabName ".equals(wdContext.currentContextElement.getTest())) {

wdThis.wdFirePlugToAnotherView();

}

else{

wdThis.wdFirePlugToEmptyView();

}

Thanks and regards

Fistae