Skip to Content

What is the best technique for resetting a view?

I was wondering what is the best technique for resetting the initial state of a view?

I am creating a form and want to provide a reset button for the user. I could write an initialize() method that my action handler calls, but I am wondering if the framework already provides this functionality in a more elegant way.

If I write an initialize method, then I have to manually populate my fields with my context mappings in my initialize() code to mimic what happens automatically by the framework the first time the view is called. This seems prone to error since this is duplicating the mapping logic.


Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 08, 2004 at 12:30 AM


    Even though it boils down to the same logic, for consistency sake it is good to have the initialization logic coded in the inbound plug method and then to call the outbound plug on reset.This make more sense when you have multiple navigation possible to the same view through multiple inbound plugs.

    Else, have an initialization method.

    PS: check whether the reset() method of IWDContext make sense. This is helpful when you have remove dynamically added nodes and attributes.

    Thanks and Regards,

    Sam Mathew

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.