cancel
Showing results for 
Search instead for 
Did you mean: 

making XML out of the modified fields in a table

Former Member
0 Kudos

Hi

Im making an application that generates xml with all the editable fields in the table that have been modified by the user.

The scenario is like this:

1. The table has 2 non-editable columns and 3 editiable columns(input fields), which initially contain values.

2. The user can modify any of these field in any row.

3. I need to check which fields have been modified by the user, generate an XML with the modified values and display the generated XML in another view.

Please let me know:

a. How I can check if the user has modified the fields.

Thanks,

Jack

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

Assuming that your XML file consists of fields as tag name.

you can add two child tags for your field names eg: <New Val> & <Old Val>

Before user modifies the data populate <Old Val> info...and after he finishes the modification on the event where you generate the XML populate the <New Val> tag information with latest values..

You can also use Document Object Model (DOM)for manipulating XML file.

NEx

Former Member
0 Kudos

Hi Jack,

I am not sure if this will help you.Just give a try !!.

There are methods like isChanged,isChangedByClient available for nodeElements.

wdContext.node<yournode>().getElementAt(int i).isChanged

wdContext.node<yournode>().getElementAt(int i).isChangedByClient

You can use them to identify which element has been modified.

Here the drawback is that probably one element has more attributes and you do not know which attribute has been changed.

Former Member
0 Kudos

Jack,

If the values that are getting displayed by default in the table are retrieved from an RFC, then make a copy of the node i.e create a value node & copy the values from the model node to the value node. Finnaly, bind your table to this newly created value node.

Every time when you hit a button or trigger an action, compare the values of the corresponding attributes, i.e, the one on the value node and the one on the model node. This will help you to figure out if the value has been changed or not.

Hope this helps,

Bala

Please reward appropriate points.

Message was edited by: Bala Krishnan