cancel
Showing results for 
Search instead for 
Did you mean: 

Creating TOOLBAR & TOOLBAR BUTTON dynamically

Former Member
0 Kudos

Hi,

I want to create toolbar and toolbarbutton i tried this lots of ways but couldn't get through it. so plz help me.

I've taken group and i wanted to add in the group. I've written the following code but it's not working at all.

IWDToolBar Tbar = (IWDToolBar)

view.createElement(IWDToolBar.class,"tbhead");

IWDToolBarButton theToolButton = (IWDToolBarButton)

view.createElement(IWDToolBarButton.class,"toolbutton");

Tbar.addToolBarItem(theToolButton);

tablegroup.addChild(Tbar);//IN THIS SENTENCE IT'S NOT ALLOWING ME TO ADD CHILD OF GROP.

Accepted Solutions (1)

Accepted Solutions (1)

former_member197348
Active Contributor
0 Kudos

Hi Amit,

Toolbar is to be set to Table.

table.setToolBar(Tbar);

//table is instance of the table which is created like the following

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

regards,

siva

Answers (1)

Answers (1)

Former Member
0 Kudos

IWDGroup group = ...;
IWDToolBar toolbar = (IWDToolbar) view.createElement(IWDToolBar.class, null);
/* add items etc. */
group.setToolBar(tolobar);

Armin