cancel
Showing results for 
Search instead for 
Did you mean: 

How to add table in to tabstrip content area dynamically?

Former Member
0 Kudos

Hi,

I created tabstrip and table in same view dynamically. I want to add this table into this tabstrip content area dynamically.

Plz give me reply asap.

Thanks

Shirisha

Accepted Solutions (1)

Accepted Solutions (1)

former_member485701
Active Participant
0 Kudos

Hi,

As much as i understand you want to add table dynamically in a tab, which is already created.do Following steps

(1) add TabStrip in the root container and the inset a tab in tabstrip with ID "Tab"

(2) Now in wdDomodify write following code for "firstTime".

//Get the Tab

IWDTab tab=(IWDTab) view.getElement("Tab");

IWDTransparentContainer container=(IWDTransparentContainer) tab.getContent();

//Create the Table

IWDTable table=(IWDTable) view.createElement(IWDTable.class,"Table");

container.addChild(table);

I'm not writing the whole code for table, you can add the columns in the same manner and bind datasource to the already created context node.

Regards,

Praveen

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello

I hope this solves your problem

IWDTabStrip tabStrip = (IWDTabStrip)view.getElement("TabStrip1");

//Create a tab Area

IWDTab tab = (IWDTab)view.createElement(IWDTab.class,"tab"+i);

//you can take a container inside the tab

IWDTransparentContainer container = (IWDTransparentContainer)view.createElement(IWDTransparentContainer.class,"container"+i);

//and thn add the container

tab.setContent(container);

//Add the table to the container

tabIntContainerC.addChild(table);

//add tab to the tabstrip

tabStrip.addTab(tab);

Thanks and Regards

Former Member
0 Kudos

Hi,

Try this in the wdDoModifyView() method:

-


IWDTabStrip tabstrip = view.getElement("<ID of the tabstrip>");

IWDTab tab = tabstrip.getTab(<index of the tab where the table should be put>);

//You can create any container you want. I'm using a ScrollContainer.

IWDScrollContainer content = (IWDScrollContainer) view.createElement(IWDScrollContainer.class, "tabContent");

//Create Table dynamically. I guess you have already done it

IWDTable table = (IWDTable) view.createElement(IWDTable.class, "table");

//Add columns to the table dynamically here.

//...

//Add the table to the ScrollContainer

content.addChild(table);

//Set the ScrollContainer to the Tab

tab.setContent(content);

-


Regards,

Satyajit.