javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-758

Support view actions that execute before tree is built w/ navigation support

    Details

    • Issuezilla Id:
      758
    • Status Whiteboard:
      Hide

      size_medium importance_large 20110201-tag

      Show
      size_medium importance_large 20110201-tag

      Description

      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"/>
      </f:metadata>
      </f:view>

      <navigation-case>
      <from-action>#{blogController.loadEntry}

      </from-action>
      <from-outcome>false</from-outcome>
      <to-view-id>/entries.xhtml</to-view-id>
      <redirect/>
      </navigation-case>

      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.

        Issue Links

          Activity

          Hide
          Ed Burns added a comment -

          Committed frame changes.

          Sending applicationIntegration.fm
          Transmitting file data .
          Committed revision 1028.
          Rhombus:frame edburns$

          Show
          Ed Burns added a comment - Committed frame changes. Sending applicationIntegration.fm Transmitting file data . Committed revision 1028. Rhombus:frame edburns$
          Hide
          lamine_ba added a comment -

          Hi,

          Regarding the instruction below

          
          <f:view>
          <f:metadata>
          
          <f:viewParam name="id" value="#{blogController.id}"/>
          <f:viewAction execute="#{blogController.loadEntry}" onPostback="false"/>
          
          </f:metadata>
          </f:view>
          
          

          I'm wondering if we could have this short variation

          
          <f:view>
          <f:metadata>
          
          <f:viewAction param-name="id" param-value="#{blogController.id}" 
          execute="#{blogController.loadEntry}" onPostback="false"/>
          
          </f:metadata>
          </f:view>
          
          

          Thanks

          Show
          lamine_ba added a comment - Hi, Regarding the instruction below <f:view> <f:metadata> <f:viewParam name= "id" value= "#{blogController.id}" /> <f:viewAction execute= "#{blogController.loadEntry}" onPostback= " false " /> </f:metadata> </f:view> I'm wondering if we could have this short variation <f:view> <f:metadata> <f:viewAction param-name= "id" param-value= "#{blogController.id}" execute= "#{blogController.loadEntry}" onPostback= " false " /> </f:metadata> </f:view> Thanks
          Hide
          Ed Burns added a comment -

          Closed pending verification of implementation.

          Show
          Ed Burns added a comment - Closed pending verification of implementation.
          Hide
          Ed Burns added a comment -

          Leo found some additional work for this issue.

          Show
          Ed Burns added a comment - Leo found some additional work for this issue.
          Hide
          arjan tijms added a comment -

          Now that the JSF 2.2 spec has been finalized, shouldn't this issue be closed as well?

          Show
          arjan tijms added a comment - Now that the JSF 2.2 spec has been finalized, shouldn't this issue be closed as well?

            People

            • Assignee:
              Ed Burns
              Reporter:
              mojavelinux
            • Votes:
              10 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Time Spent - 11 hours, 4 minutes Remaining Estimate - 1 week, 2 days, 23 hours, 10 minutes
                1w 2d 23h 10m
                Logged:
                Time Spent - 11 hours, 4 minutes Remaining Estimate - 1 week, 2 days, 23 hours, 10 minutes
                11h 4m