cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Web Dynpro Java isChanged and isChangedByClient

Former Member
0 Kudos

Hello,

I have read thorugh a lot of documentation, threads, ... --> but the picture is not geting clearer fro me.

We have Web Dynpro Java Application (on Netweaver 7.0 SP12) running in Enterprise Portal. We need to tell the portal work protect mode, that we have unsaved changes (how to do this is clear).

I am struggling with figuring out, that my Web Dynpro Context has unsaved changes. I found the two change-indicators isChanged() and isChangedByClient(), which already confuses me a little bit.

Anyway, this is what I have figured out so far:

I am calling wdContext.currentContextElement().isChangedByClient() to figure out changes and when a Save operation has been completed sucessfully, I call wdContext.currentContextElement().node().getContext().resetChangedByClient(). This works for some of the changes made by the user.

I then tried calling wdContext.nodeABC().getElementAt(i).isChanged() for all nodes of my Web Dynpro Context, but this results in detecting changes before the user ha done any interaction.

Implementing an own change tracking (i.e. by adding a changed-Attribute to each context node) does not seem a viable option for me.

So these are my questions:

- Does anyone now a working pattern relying on those chnage indicators ?

- Does anyone now how to reset the isChanged indicator (or when it is resetted by the framework) ?

Any help appreciated.

Thank you,

Stefan

Accepted Solutions (1)

Accepted Solutions (1)

former_member192434
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi Anup,

thank you for the fast reply. I reviewed the linked thread and API doc.

Unfortunately these undeline the unclear behavior, I have already encountered.

Thank you,

Stefan

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Also you can have a workaround of this from the model object itself, rather than the node.

ARFC model objects generated from BAPIs an be typecasted to ICMIModificationCount.

So you will need to check the modCount() for every model object as soon as the view is loaded. Save this count somewhere. This should be much better than iterating through all your node elements and checking if they have been modified.

Now when you want to find out if the view has been changes or not, check the saved value with the current modcount. If they are not equal, then there has been a modification.

Regards

Raghu