cancel
Showing results for 
Search instead for 
Did you mean: 

how to pick data from table UI element which i enter.??

Former Member
0 Kudos

Hi all,

I added a table UI element in my form view. in all the columns i added inputfield and binded the table with context node,no in th inputfield i will be able to enter something. Now my problem is how to pick the enteries which i made in the table UI inputfields .Please help in doing this i even need to insert them into the sql server database. plzzzzzzzzzzzzzzzzzzz

Thanks & regrads,

Sharan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Saisharan,

You can retrieve the data entered in the input fields as follows:

Suppose context node bound to table is tableData.

Attribute in node tableData bound to input field is attr

Component controller : DemoComp

for(int i = 0; i<wdContext.nodeTableData().size();i++)

{

IPublicDemoComp.ITableDataElement tab = wdContext.nodeTableData().getTableDataElementAt(i);

String attr = tab.getAttr();

// Use attr in the sql query when needed

}

It is as simple as that.

Try this and tell me if it worked.

Regards.

Edited by: Armin Reichert on Dec 18, 2007 7:41 PM

Answers (2)

Answers (2)

Former Member
0 Kudos

hi amrin/mayuresh,

Thanks for th reply, but one thing

amrin u said in one server round tri the data will be stored,u mean to say tat i have a save buton say. if in the action i enter code given by mayuresh will that do?? or do see there anyother way?

Mayuresh: i realy thank full i am not able to try this coz my server is down, i could get the logic but it will be help full plzz tell me like..

I have to enter the data into database in the same way as it looks in the table UI. see there any way with which i can enter by each cell value of the table UI??

Former Member
0 Kudos

Hi,

if in the action i enter code given by mayuresh will that do?? or do see there anyother way?

Yes, when you click on the save button their is a round trip.

I have to enter the data into database in the same way as it looks in the table UI. see there any way with which i can enter by each cell value of the table UI??

To do this iterate through the node which is bound to the table get the attribute value and form your SQL.

Regards

Ayyapparaj

Former Member
0 Kudos

After any server-roundtrip, the entered values are stored in the context node elements the table is bound to. So to get the values, just loop over the elements in the table data source and get the attribute values.

Armin