cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable all rows of table for inputing in web dynpro for java?

Former Member
0 Kudos

Hi All.......

In my table (web dynpro for java ) i am able to enter the data in first row only , and i m not able to input data in other rows...how to enable that rows for inputting . Please provide the code for that and explain it elaborately..

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please check the cardinality and you have to create element for the node to have multiple rows.

Regards

Saravanan K

Former Member
0 Kudos

cardinalit is 1 : n and i have created a context node also and has mapped it but with this i m able to input only in 1st rows and not in other rows

former_member214651
Active Contributor
0 Kudos

Hi,

Since the cardinality is 1..n the first row is enabled. In order to enable all the rows, write this piece of code in the wdDoInit() of the view:

for(int i = 0; i < <number of rows required>; i++)
{
    I<contextnode>Element object = wdContext().createAndAdd<contextnode>Element();
}

Regards,

Poojith MV

Former Member
0 Kudos

Hi actually i m new to this so there is problem of proper spacing in the code ..plz provide the same code with proper spacing.

Thanks

Former Member
0 Kudos

Hi,

Consider the node bound to the table is 'TableNode' and consider you are going to create 5 rows in the table,

for( int i = 0 ; i < = 5 ; i++) {

IPrivate<View name>.ITableNodeElement element = wdContext.nodeTableNode.createTableNodeElement();

wdContext.nodeTableNode().addElement(element);

}

This will create 5 rows in your table.

Regards

Saravanan K

Former Member
0 Kudos

Hi

my node name is ' table' and view name is ' TestView ' the code im writing is :

for( int i = 0 ; i <= 5 ; i++) {

IPrivate TestView.ItableElement element = wdContext.nodetable.createtableElement();

wdContext.nodetable().addElement(element);

}

and i m getting error on the dot ( , ) of second line i.e. after IPrivate TestView ...error is "syntax error on token"

Thanks

Former Member
0 Kudos

Hi

Remove the space between Private and test. It should be IPrivateTestView

Regards

Saravanan K

Former Member
0 Kudos

Hi

Then also error is coming,

Former Member
0 Kudos

Hi,

Please check the following code,

for( int i = 0 ; i <= 5 ; i++) {

IPrivateTestView.ITableElement element = wdContext.nodeTable().createTableElement();

wdContext.nodeTable().addElement(element);

}

Regards

Saravanan K

Former Member
0 Kudos

Hi,

Thank you very much .

Bye.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

have you created any instances of the data node of the table?

I think you have created a node of cardinality 1..n that's why you are getting only row for inputing data.

Add a button on the view and on action of that button create instance of the node like this

IWDNodeElement ele = wdContext.node<Node name>.createElement();

wdContext.node<Node name>.add(ele);

Regards

Ravindra

Former Member
0 Kudos

NO I dont wnat to add button . I wan a table in which i can input in any number of rows.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Moderator Message: Moved from the Web Dynpro ABAP to the Web Dynpro Java forum.