New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support view actions that execute before tree is built w/ navigation support #758
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented 1. View actions would be processed during invoke application phase. 2. View actions would be integrated with the navigation system (allow navigation 3. View actions would be part of the view metadata (like view parameters) and |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented
|
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented Checkpoint. Specified but not implemented. |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented SECTION: Modified FilesM applicationIntegration.fm
If a matching element was located, and the
call getRedirectURL() on the ViewHandler, passing the current
Call responseComplete() on the FacesContext instance for the current M jsf-api/src/main/java/javax/faces/component/UIViewAction.java
M jsf-ri/conf/share/facelets_jsf_core.tld
M jsf-ri/src/main/java/com/sun/faces/application/NavigationHandlerImpl.java
M jsf-test/#758/build.xml A jsf-test/#758/i_spec_758_simple_war |
@glassfishrobot Commented |
@glassfishrobot Commented Sending applicationIntegration.fm Committed to trunk. |
@glassfishrobot Commented |
@glassfishrobot Commented SECTION: Modified FilesM applicationIntegration.fm
If a matching element was located, proceed as follows.
M jsf-api/src/main/java/javax/faces/component/UIViewAction.java
M jsf-ri/src/main/java/com/sun/faces/application/NavigationHandlerImpl.java
M jsf-test/build.xml
M jsf-test/#758/i_spec_758_simple_war/src/main/java/com/sun/faces/regression/i_spec_758_simple_war/ViewActionTestBean.java
|
@glassfishrobot Commented Sending applicationIntegration.fm |
@glassfishrobot Commented Regarding the instruction below
I'm wondering if we could have this short variation
Thanks |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
JSF should provide a view metadata component that defines a method expression to
be invoked before the component tree is built (or restored), with support for
navigating to an alternative view afterward using navigation rules. Navigation
may be the result of a constraint violation, a security restriction, or because
the request was for a pseudo-view.
As an example, the developer might use a view action to load a blog entry before
the view is displayed. If the entry cannot be found, the user would be
redirected to another page using a navigation rule.
<f:view>
<f:metadata>
<f:viewParam name="id" value="#
{blogController.id}
"/>
<f:viewAction execute="#
{blogController.loadEntry}" onPostback="false"/>
#{blogController.loadEntry} false /entries.xhtml</f:metadata>
</f:view>
This feature relates to view parameters, as the example suggests. View
parameters were introduced in JSF 2.0 to provide a declarative value binding
between query string parameters and model properties. They go a long way towards
accommodating the action-oriented scenario in JSF. But view actions are a
necessary part of the equation.
<f:event type="preRenderView"> is similar to <f:viewAction>, but is insuffient
as a front controller. <f:event> gets you by if the purpose is to perform
processing at the start of the request. <f:viewAction> is intended for when you
have to perform logic to verify that the view can even be rendered. View-level
security is one example. Another is verifying that preconditions are met. And
the key is to make navigation away from the view an integrated part when it's
determined that the view cannot and should not be rendered.
Environment
Operating System: All
Platform: All
URL: http://seamframework.org/Documentation/JSFEnhancementViewActions
Affected Versions
[2.0]
The text was updated successfully, but these errors were encountered: