on 08-04-2008 3:48 PM
Hello ,
I have a senario that user enters some values and later if he wishes he can change the values he entred last time....
So right now I have doing something like:
wdContext.nodeAddress_Tmp().addElement(wdContext.currentContextElement().getRowNr(), newAddress_tmp);
in newAddress_tmp is the data which he entered first time or then change.... I am storing the user data in node at the row level..... so e.g at row 1 I entered the data, and 2nd time again at row1 I want to update the data.... , my question is instead of addElement, how I can update or modify at the same index ?
Pls suggest...if that is possible....
Regards,
The solution which I can imagine right now is :
first fetch the data stored at that row....rewrite with new data....delete the data from that row and insert again via addElement (row, data ).......
hopefully I can delete one element in node now :-).... have to check......
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I try to explain the issue again,
I have a table with some columns and among them a dropdown and button.
where for a particular row user can enter some address in one popup ( when user selects somthing from dropdown a popup will appers to take his values ). Once entered the address, he can later show/edit the data for that particular row ( while clicking on the button ) . Showing this address data working fine, my problem is EDIT:
when user after first entering the addrress details wished to change he click on button in table
I read the row nr and display him the data which he enters first time...... as I have stored the data against the row like this: node.addElement(rownr, data )
now he change the data on popup and click again submit, ( here starts my problem , that how I store this data in my node )
before I used node.addElemtn(rownr, data ) now if I use again node.addElement(rownr, data ) then I have for same row two entries, .....where as I want to rewrite the data for the same row.....
Edited by: Shah H on Aug 4, 2008 5:52 PM
Edited by: Shah H on Aug 4, 2008 8:12 PM
Hi,
It seems pretty simple. Say for each row you have add, edit, show button (Please correct me if i am wrong) using which you give a popup to add, change and display the address in the popup.
So on add you can add the element for the node, on edit diplay the data from the same element and let the user edit it. On click of submit it will automatically over write the data in the same element. No need to add on this action again.
Hope i am clear.
thanks & regards,
Manoj
Hi, in ur case user selects one row in the Table and theen he clicks edit butoon. In Edit button action u can use the following code.
for getting the data from selected row in a table--->
wdContext.node<NodeName>.getElementAt(wdContext.node<NodeName>.getLedselection()).
set<AttributeName>(wdContext.current<NodeName>Element().get<AttributeName>());
The above code will over write the existing data.
Hello Manoj,
Thanks for your reply, actually I have two nodes, one node is which is taking directly values from the user i.e. bind to the inputfields, and afterwards, when user clicks on submit I put this binded node to the 2nd node which contains address of all rows....
so the suggestion you have given, will unfortunately will not work in my case ... ..
Thanks and regards,
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.