on 12-18-2007 3:57 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.