cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best technique for resetting a view?

michael_hill
Advisor
Advisor
0 Kudos

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.

Michael

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

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