You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shale.apache.org by "Craig McClanahan (JIRA)" <ji...@apache.org> on 2006/11/22 23:18:57 UTC

[jira] Commented: (SHALE-338) Provide preupdate() method for viewcontroller

    [ http://issues.apache.org/struts/browse/SHALE-338?page=comments#action_38838 ] 
            
Craig McClanahan commented on SHALE-338:
----------------------------------------

I think the use case described here is definitely a valid one ... typically, a Cancel button will be coded with immediate=true (precisely because it *does* bypass the Process Model Updates phase, among others), so there is no point in doing setup during the preprocess() callback that is not going to be used.

That being said, I'm always cautious about backwards incompatible API changes, even though we haven't done a GA release yet.  In this scenario, it will only affect people who implement ViewController directly, instead of extending AbstractViewController where we can provide a default empty implementation like we do all the rest.  Given that, I'm cautiously OK with it.

In terms of implementation, here are my thoughts:

* I like preupdate() as the method name -- it is stylistically consistent
  with the other view controller callbacks, and correctly denotes that
  it is called *before* the update model values phase occurs.

* Implementation in shale-view should mimic the other "prexxx" callbacks
  in terms of exception handling, and extensibility via shale-tiger.  That
  probably means modifying ViewControllerCallbacks as well, but that's
  an internal API not intended for app developers, and therefore of
  less concern for breakage.

* We should also add a @Preupdate annotation in shale-tiger that lets
  you do this sort of thing via annotations, 

* Did I mention we should also add corresponding unit and system
  integration test cases?  :-)


> Provide preupdate() method for viewcontroller
> ---------------------------------------------
>
>                 Key: SHALE-338
>                 URL: http://issues.apache.org/struts/browse/SHALE-338
>             Project: Shale
>          Issue Type: New Feature
>          Components: View
>            Reporter: Matthias Wessendorf
>         Assigned To: Matthias Wessendorf
>
> Stefan Meyer requested preupdate
> The preprocess method is called even if the immediate flag is set to
> true because it is called after the restore view phase and not before
> the model update. I want setup code to only be executed if necessary -
> the model is updated or the view is rendered. Therefore I need a
> prerender and a preModelUpdate method.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira