cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic table creation

Former Member
0 Kudos

Hi to all..

Can anybody explain tht how to create the table dynamically and also How to insert the values in it... Explain in detail with coding...

Urs GS

Accepted Solutions (1)

Accepted Solutions (1)

former_member189631
Active Contributor
0 Kudos

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Satish,

While creating any table you have to take care of the datasource Node.

Here the data source node lets assume is say A.

If we take an example into consideration :

Node Biodata -

Attributes :Name , City, Address.

Now in the wdDoModifyView you'll require to do the following under firstTime(default visibility)


 if(firstTime){
    	IWDTable table = (IWDTable)view.createElement(IWDTable.class,"table");
    	Iterator i = wdContext.nodeA().getNodeInfo().iterateAttributes();
    	while(i.hasNext()){
    		IWDAttributeInfo attInfo = (IWDAttributeInfo)i.next();
    		IWDTableColumn tableColumn = (IWDTableColumn)view.createElement(IWDTableColumn.class,attInfo.getName()+"column");
    		IWDTextView textView = (IWDTextView)view.createElement(IWDTextView.class,attInfo.getName()+"textView");
			textView.bindText(attInfo);
			IWDTableStandardCell tableCellEditor = (IWDTableStandardCell)view.createElement(IWDTableCellEditor.class,attInfo.getName()+"editor");
    		tableCellEditor.setEditor(textView);
			textView.setVisible(WDVisibility.VISIBLE);
    		tableCellEditor.setVariantKey(attInfo.getName()+"i");
    		tableColumn.addCellVariant(tableCellEditor);
			tableColumn.setVisible(WDVisibility.VISIBLE);
    	}
    	table.bindDataSource(wdContext.nodeA().getNodeInfo());

IWDTransparentContainer transparentCont = (IWDTransparentContainer)view.getElement("RootUIElementContainer");

transparentCont.addChild(table);
table.setVisible(WDVisibility.VISIBLE);
}

The above code takes care of creating a table dynamically.

Also create some elements for the dataSource node to see the result.

Regards

Amit

Message was edited by:

Amit Kesari

Message was edited by:

Amit Kesari

Former Member
0 Kudos

Hi,

Go through the thread,it has coding

Go through the blog

/people/sap.user72/blog/2005/05/09/have-you-played-blindfold-chess

and look at the valery steps

Former Member
0 Kudos

Hi Sathish ,

Paste your mail address here.. I have one sample application.. I can sedn you .. you will get how to code.. Instead of following sdn links...

Thanks Avijit

Former Member
0 Kudos

gs.sathishkumar@gmail.com

Former Member
0 Kudos

hi Avijith,

In my opinion forums are meant for discussing the problem not for sending sample

applications through mail.Let others too share your knowledge ;).

Regards

Amit