cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in creating a table at runtime

Former Member
0 Kudos

Hi SDN,

I am trying to create a Table UI Element at runtime.

To do So I have written the following code in the "wdDoModifyView" method of the view

if(firstTime)

{

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

table.bindDataSource("TableNode");

IWDTableColumn column1=(IWDTableColumn)view.createElement(IWDTableColumn.class,null);

table.addColumn(column1);

IWDInputField editor=(IWDInputField)view.createElement(IWDInputField.class,null);

editor.bindValue("TableNode.no");

column1.setTableCellEditor(editor);

// create and add second table column

IWDTableColumn column2 = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);

table.addColumn(column2);

IWDTextView editor1 = (IWDTextView) view.createElement(IWDTextView.class, null);

editor1.bindText("TableNode.name");

column2.setTableCellEditor(editor1);

IWDUIElementContainer root = (IWDUIElementContainer) view.getRootElement();

root.addChild(table);

}

After executing the application the table is created successfully. But both the columns are in TextView mode. What i need is one column should be in input mode and other in TextView mode. So please suggest me what more stuff i have to add to make the field to accept the input.

Thanks in advance.

Regards

Basha

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Why do you create this table programmatically?

Concerning the question: Table rows correspond to elements in the data source node. If there is no element, all editors are displayed read-only. You have to create node elements e.g. in wdDoInit(), as much as you want to have rows.

Armin

Former Member
0 Kudos

Hi Sridhar and Armin,

Thanks a lot it works fine. Can u suggest me how can i put F4 help to that input field to get the material list from R/3. Hope a quick reply.

Regards

Basha

Former Member
0 Kudos

Have a look at the https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/webcontent/uuid/ce85dd42-0a01-0010-fca6-88a29ddb20ff">tutorial [original link is broken] [original link is broken], section "Value Help".

Armin

konchada_saikrishna
Active Participant
0 Kudos

Hi Armin,

I need to display a table with 5 rows and 7 columns.

5 of the columns are drop downs from R/3,

My requirement is the table should be in editable mode such that the user is allowed to enter some values(rows). on clicking the save button the table values are to be sent to R/3 table through bapi.

Please help me in resolving this.

Thanks & Regards,

Sai Krishna.

sridhar_k2
Active Contributor
0 Kudos

Hey Basha,

Make that TableNode cordiality as 1..N. InputField is allowing enter value in it.

Regards,

Sridhar