cancel
Showing results for 
Search instead for 
Did you mean: 

ViewSwitch at runtime

Former Member
0 Kudos

Hi,

I have created a layout like GP Runtime Page in a custom application, using ContextualPanel and ViewSwitch. I mapped the ViewSwitch with a node. But at runtime i am not able to switch between views.

The context is always pointing to first element of Node. Is there any option to change the lead selection of context to corresponding ViewSwitch Tab.

Regards

Baby

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I resolved this with help of some forum threads. I created action handler and pass index as a paramter to it. For this i wrote following code in wdModify.


if (firstTime)
		{
		  IWDViewSwitch myViewSwitch = (IWDViewSwitch) view.getElement("ViewSwitch");
		  myViewSwitch.mappingOfOnSelect().addSourceMapping(IWDViewSwitch.IWDOnSelect.INDEX, "index"); 
	}

Thanks..

Baby

Former Member
0 Kudos

Parameter mapping should not be needed here. The selected entry is given by the lead-selection of the "itemSource" context node.

Armin

Former Member
0 Kudos

Hi,

In my application the leadselection is always pointing to first element of context node. Even if i click on the other tabs, the lead is not changing.

If i change leadselection by coding it is reflecting in view.

I don't know whether it's a bug.

Regards

Baby

Former Member
0 Kudos

Ok, I understand. For newer UI elements the lead-selection isn't changed anymore automatically (for performance reasons). Probably that's the case here too. Then parameter mapping is the way to go. Maybe you could use the Parameter Mapping Editor instead of code.

Armin

Former Member
0 Kudos

Thanks Armin for your support..

I am also including the action event.


  public void onActionswitchview(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, int index )
  {
    //@@begin onActionswitchview(ServerEvent)
    
	wdContext.nodeControl_Navigation_Tab().setLeadSelection(index);
    
    
    //@@end
  }

Regards

Baby