ICEfaces
  1. ICEfaces
  2. ICE-1672

JSF navigation rules are not informing the portal of a change in portlet modes

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6DR#5
    • Fix Version/s: 2.0.1
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Win XP / JDK 1.4 / Tomcat 5.5.17 / Liferay 4.3.0-RC1
    • Workaround Exists:
      Yes
    • Workaround Description:
      Use the portlet window widgets for navigation between nodes.

      Description

      I think this is a by-product of abandoning the JSF-Portlet Bridge -- specifically the Sun JSF-Portlet Bridge, as the Apache bridge has the same bug that I am documenting here.

      JSF Portlets often have "EDIT" mode, which enables the user to edit javax.portlet.PortletPreferences, enabling users to customize portlets in various ways. The portal has decorations/icons that let you invoke EDIT mode and HELP mode, and then typically provides a "BACK" type of decoration/icon that re-invokes the "VIEW" mode.

      However, a typical scenario for EDIT mode is that JSF portlet developers simply want to present the user with an <ice:form> and a bunch of fields for editing preferences. Then, the user clicks a "Submit" button.

      Using JSF Navigation rules, it's easy to force the JSF portlet to switch back from EDIT to VIEW mode when the Submit button is clicked. However, when this is done with ICEfaces, the portal is not notified of the mode change, and the decorations remain stuck in EDIT mode.

      I just attached an enhanced version of the sample portlet released with Liferay 4.3.0-RC1, which has been modified to reproduce this problem.

      To reproduce:

      To reproduce:

      - Download Liferay 4.3.0-RC1 from here and install:
      http://www.liferay.com/web/guest/downloads/liferay_enterprise_portal/4_3_0rc1

      - Copy the attached portlet .WAR into $HOME/liferay/deploy (hot deploy folder):

      - Start the portal

      - Start Browser and visit http://localhost:8080 and login as test@liferay.com with password test

      - Add a new portal page named "ICEfaces"

      - Add the Sample ICEfaces (Sun RI) Portlet from the "Add Content" option

      - After the portlet appears, click on the pencil+paper icon to invoke EDIT mode

      - Type in any value for the email address field

      - Click Submit

      Now... clicking the submit button triggers the following navigation-rule in faces-config.xml:

      <navigation-rule>
      <from-view-id>/Edit.iface</from-view-id>
      <navigation-case>
      <to-view-id>/JobApplication.iface</to-view-id>
      </navigation-case>
      </navigation-rule>

      And indeed, the portlet shows the JobApplication.iface view after the click, but the portlet is not informed that we are back in VIEW mode, and the portlet decorations/icons continue to display "<< Back" instead of the full set of decorations for Config, Edit, Help, etc..


      --Neil

        Issue Links

          Activity

          Hide
          Neil Griffin added a comment -

          This is an enhanced version of the sample portlet released with Liferay 4.3.0-RC1, which has been modified to reproduce this problem.

          Show
          Neil Griffin added a comment - This is an enhanced version of the sample portlet released with Liferay 4.3.0-RC1, which has been modified to reproduce this problem.
          Hide
          Deryk Sinotte added a comment -

          To change the mode of the portlet programmatically, you need to access an ActionRequest/ActionResponse. Currently, with ICEfaces, we don't support this code path as we handle all of the "actionable" requests via Ajax and bypass the usually portal mechanisms unless a new view is required. For the time being, we suggest that all mode changes are done by using the window widgets and not via JSF navigation. The navigation can be used to change views within a given mode (multiple pages within VIEW mode or multiple pages within EDIT mode) but to actually switch modes (from VIEW to EDIT or back) then we recommend you rely solely on the window widgets for the time being. We're continuing to look at ways to support proper mode changes from within JSF navigation.

          Show
          Deryk Sinotte added a comment - To change the mode of the portlet programmatically, you need to access an ActionRequest/ActionResponse. Currently, with ICEfaces, we don't support this code path as we handle all of the "actionable" requests via Ajax and bypass the usually portal mechanisms unless a new view is required. For the time being, we suggest that all mode changes are done by using the window widgets and not via JSF navigation. The navigation can be used to change views within a given mode (multiple pages within VIEW mode or multiple pages within EDIT mode) but to actually switch modes (from VIEW to EDIT or back) then we recommend you rely solely on the window widgets for the time being. We're continuing to look at ways to support proper mode changes from within JSF navigation.
          Hide
          Deryk Sinotte added a comment -

          Need to support doing our Ajax communication through the portal container.

          Show
          Deryk Sinotte added a comment - Need to support doing our Ajax communication through the portal container.
          Hide
          Deryk Sinotte added a comment -

          We'll looking at doing this for ICEfaces 2.0 when we can adapt to support the Portlet 2.0 spec (JSR 286).

          Show
          Deryk Sinotte added a comment - We'll looking at doing this for ICEfaces 2.0 when we can adapt to support the Portlet 2.0 spec (JSR 286).
          Hide
          Deryk Sinotte added a comment -

          General and proper portlet support for ICEfaces 2.0 falls under the parent issue of the JSF Portlet Bridge.

          Show
          Deryk Sinotte added a comment - General and proper portlet support for ICEfaces 2.0 falls under the parent issue of the JSF Portlet Bridge.
          Hide
          Ken Fyten added a comment -

          Neil, can you update the JIRA based on the outlook for this when using IF 2.0 and PortletFacesBridge?

          Show
          Ken Fyten added a comment - Neil, can you update the JIRA based on the outlook for this when using IF 2.0 and PortletFacesBridge?
          Hide
          Deryk Sinotte added a comment -

          Re-targetting for ICEfaces 2.0 final release as the feature is in development and not yet ready for the Beta 2 release.

          Show
          Deryk Sinotte added a comment - Re-targetting for ICEfaces 2.0 final release as the feature is in development and not yet ready for the Beta 2 release.
          Hide
          Neil Griffin added a comment -

          This feature has been implemented in the PortletFaces Bridge, and will appear in the v2.0.0 production release of the bridge.
          http://jira.portletfaces.org/browse/BRIDGE-114

          Show
          Neil Griffin added a comment - This feature has been implemented in the PortletFaces Bridge, and will appear in the v2.0.0 production release of the bridge. http://jira.portletfaces.org/browse/BRIDGE-114

            People

            • Assignee:
              Neil Griffin
              Reporter:
              Neil Griffin
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: