on 10-17-2007 12:30 AM
Hi
I have a requirement to generate TABLE component with 6 coumns with more than one rows at runtime.
So please send me the code how to generate table at runtime.
Help me ASAP
Thanks
venkat
Hi ,
The last reply solves your problem of creating the table at runtime with some columns.
If want to create some element in this.
(1)1st create the node in the context.
NodeInfo= wdContext.getNodeInfo().addChild(
displayName, null, true, CMICardinality.MANY,
you can create attributes in this manner. CMICardinality.MANY, false, null);
(2)backupNodeInfo.addAttribute("attr","com.sap.dictionary.string");
Now you can bind it with table and use it.
Regards,
Praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Venkata
You have to do the coding in the doModifyView() method
The code wud look smthing like this
IWDTable table = (IWDTable)view.createElement(IWDTable.class,null);
IWDCaption _tableCaption =(IWDCaption)view.createElement(IWDCaption.class,null);
table.bindDataSource(nodeInfo);
table.setDesign(WDTableDesign.STANDARD);
Iterator i =nodeInfo.iterateAttributes();
for(;i.hasNext();){
IWDTableColumn_column=(IWDTableColumn)view.createElement(IWDTableColumn.class,null);
IWDCaption _caption = (IWDCaption)view.createElement(IWDCaption.class,null);
IWDAttributeInfo _attr = (IWDAttributeInfo)i.next();
caption.setText(attr.getName().toUpperCase());
column.setHeader(caption);
IWDTextView _textView =(IWDTextView)view.createElement(IWDTextView.class,null);
textView.bindText(attr);
column.setTableCellEditor((IWDTableCellEditor)textView);
table.addColumn(_column);
}
table.setVisibleRowCount(-1);
In the above code, I have created a table , binded it to a value node, iterated the node for the attributes and binded them to the table columns.
setVisibleRowCount is the property for the no of rows. -1 value means automatically it will have the req no of rows.
I hope this solves your problem.
Regards
Avinash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are several posts regarding this topic. Check this one out.
https://forums.sdn.sap.com/click.jspa?searchID=5983802&messageID=1398336
/Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Dynamic Programming of Web Dynpro Applications
Regards
Ayyapparaj.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.