cancel
Showing results for 
Search instead for 
Did you mean: 

node addElement or ChangeElement....

Former Member
0 Kudos

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,

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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,

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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,

Former Member
0 Kudos

Hello Bhargava,

I will try this out .... thanks for your suggestion, this seems to be as it should work like this...

Thanks, I'll let you know....

Regards,