cancel
Showing results for 
Search instead for 
Did you mean: 

Creating TabStrip & Populating the tabstrip Dynamically

Former Member
0 Kudos

Hi,

In the wdDoModifyView method I need do the following:

1) Get the Tabstrip object using the view.

2) Create a IWDTab object (In a loop) and setting Caption using the IWDCaption for each tab created.

3) Create a IWDTransportContainer.

4) Create a IWDLinkToAction (In a loop) within the created IWDTransportContainer.

Can anyone pls provide me some details regarding this.

Thanks in advance.

Krishna

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member286976
Active Participant
0 Kudos

Hello Krishna,

Here is the sample code:

IWDTabStrip ts = (IWDTabStrip)view.getElement("TabStrip");
ts.setWidth("100%");
		  
IWDNode n1 = wdContext.nodeRoot();
Iterator itr = n1.iterateElements();
for(int i = 0 ; i < size ; i++){
  IWDNodeElement ne = (IWdNodeElement)itr.next();
  IWDTab tab = (IWDTab)view.createElement(IWDTab.class,null);
  IWDCaption caption = (IWDCaption)view.createElement(IWDCaption.class,null);
  caption.setText("ur caption or ne.getAttributeValue() as u wish");
  tab.setHeader(caption);

  IWDTransparentContainer tc = (IWDTransparentContainer)view.createElement(IWDTransparentContainer.class,null);
  tab.addChild(tc);

  IWDLinkToAction lta = (IWDLinkToAction)view.createElement(IWDLinkToAction.class,null);
  lta.setText("ur text");
  tc.add(lta);

  ts.addTab(tab);
}

Hope this information helps.

Regards,

Sudeep.