Hi,
I have a question regarding the usage of IWDNodeElement.isChangedByClient and IWDNodeElement.isChanged methods. How exactly they are used. The API document of IWDNodeElement.isChangedByClient says
[
This flag will be set by the framework when an update from the client arrives. It remains true until you reset all flags in the complete context via IWDContext.resetChangedByClient().
]
I alway get IWDNodeElement.isChangedByClient as false and IWDNodeElement.isChanged as true (irrespective I change it or not) when I check the flag in the view controller. Due I explicity need to set the change flag of the attributes using IWDNodeElement.changed(java.lang.String attributeName) or will the framework set it for me.
My actual requirement is I want to detect whether the contents of node element is modified or not.
The node is displayed through a editable table interface.
Regards,
Ameya
This may solve your problem .
Bind your context node with UI element , for example : Table . Just key-in some value in any field .
You will find that any field value is changed on the screen , the isChangedByClient flag is marked as true automatically . You can run an for loop to see the difference .
wdContex.nodeXX.moveFirst() ;
for( int i = 0 ; i < wdContext.nodeXX.size() ; i++ ){
if( wContext.currentXXElement.isChangedByClient() ){
..... ;
wdContex.nodeXX.moveNext() ;
}
}
( Sorry for my poor english _ )
Hello Ameya,
Let say you have node which is mapped as data source for table. One of node attribute is mapped to tableCellEditor InputField. Just try to iterate through all elements in node and print out value of isChangedByClient in onLeadSelection action handler for table. If you are changing value in inputField inside the table and changing lead selection than you will see that for changed elements value of isChangedByClient is true. Until resetChangedByClient call. So it is convinient method to collect only changed elements (for backend calls for example).
Best regards, Maksim Rashchynski.