Skip to Content
avatar image
Former Member

How to detect if a view is 'dirty'?

Hi,

I'm just developing a Web Dynpro application with which the user can edit product information. The view has a lot of input fields and drop-downs. The view also has a Save button that should only be active if the user has modified at least one piece of data. Is there a generic way to detect user modifications or do I have to add an action to each widget? Is there something like an isModified method or a kind of property change mechanism?

Regards.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 25, 2012 at 09:33 AM

    When running inside a portal, you have the option to use the WorkProtect feature (WDPortalWorkProtectMode, see http://help.sap.com/javadocs/nwce/ce71/wdr/com/sap/tc/webdynpro/clientserver/portal/WDPortalWorkProtectMode.html), but this only works when navigating away from your application...

    In your specific case, unfortunately there is no dirty indicator... The only feasible thing I can think of is capture the context upon entering the form, and upon saving compare the current context with the captured context

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Maksim Rashchynski

      Well, why is it not elegant 😉 ?

      Well, let's say it is only kind of elegant 😉 The problem is, that I need some of the onSelect handlers for dependent fields/widgets. So I have to write handler methods that delegate to handlers that were already set. And that also means handling the parameter mapping correctly. That looks like I have to use all my grey matter for this.

      But okay, Web Dynpro has its limitations and one has to get around them :-O