ICEfaces
  1. ICEfaces
  2. ICE-7432

Stale FacesMessages with <f:ajax disabled="true"/>

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-2.0.0.GA
    • Fix Version/s: 3.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Mojarra 2.1.2
    • Assignee Priority:
      P2
    • Affects:
      Compatibility/Configuration

      Description

      If I use <f:ajax disabled="true"/> on a command button then stale FacesMessages are displayed by <h:messages />.

        Activity

        Adrian Gygax created issue -
        Hide
        Adrian Gygax added a comment -

        Attached a sample project to demonstrate the issue.

        Steps to reproduce the problem:
        1. Enter "asdf" in both text fields
        2. Press the button. Notice the two correctly shown error messages.
        3. Clear the second text field.
        4. Press the button again. Notice that still BOTH error messages are shown, even if the second field is now valid!

        Options which don't show the problem:

        • remove <f:ajax disabled="true"/> tag OR
        • remove icefaces-ee.jar OR
        • set redisplay=false on h:message: <h:messages redisplay="false"/>

        All of these options are not feasible workarounds in our case.
        <f:ajax disabled="true"/> is needed to trigger a full page refresh in a Portal environment

        Show
        Adrian Gygax added a comment - Attached a sample project to demonstrate the issue. Steps to reproduce the problem: 1. Enter "asdf" in both text fields 2. Press the button. Notice the two correctly shown error messages. 3. Clear the second text field. 4. Press the button again. Notice that still BOTH error messages are shown, even if the second field is now valid! Options which don't show the problem: remove <f:ajax disabled="true"/> tag OR remove icefaces-ee.jar OR set redisplay=false on h:message: <h:messages redisplay="false"/> All of these options are not feasible workarounds in our case. <f:ajax disabled="true"/> is needed to trigger a full page refresh in a Portal environment
        Adrian Gygax made changes -
        Field Original Value New Value
        Attachment ice7432.war [ 13730 ]
        Hide
        Adrian Gygax added a comment -

        Fixed testcase

        Show
        Adrian Gygax added a comment - Fixed testcase
        Adrian Gygax made changes -
        Attachment ice7432.war [ 13731 ]
        Adrian Gygax made changes -
        Attachment ice7432.war [ 13730 ]
        Ted Goddard made changes -
        Assignee Ken Fyten [ ken.fyten ]
        Hide
        Ted Goddard added a comment -

        <icecore:config messagePersistence="true"/> may be useful here.

        Show
        Ted Goddard added a comment - <icecore:config messagePersistence="true"/> may be useful here.
        Tyler Johnson made changes -
        Salesforce Case [5007000000JN2YJ]
        Hide
        Ted Goddard added a comment -

        Adrian has verified that ajax disabled=true is disabling ajax interaction, but there is still a problem with message persistence.

        Show
        Ted Goddard added a comment - Adrian has verified that ajax disabled=true is disabling ajax interaction, but there is still a problem with message persistence.
        Hide
        Adrian Gygax added a comment -

        It also happens with <f:attribute name="DISABLE_CAPTURE_SUBMIT" value="true" /> but without <f:ajax disabled="true"/>.

        So now it seems to be pretty clear that the problem is message persistence in the case of normal POST requests.

        Show
        Adrian Gygax added a comment - It also happens with <f:attribute name="DISABLE_CAPTURE_SUBMIT" value="true" /> but without <f:ajax disabled="true"/>. So now it seems to be pretty clear that the problem is message persistence in the case of normal POST requests.
        Ken Fyten made changes -
        Fix Version/s 2.1 [ 10241 ]
        Assignee Priority P2
        Assignee Ken Fyten [ ken.fyten ] Mark Collette [ mark.collette ]
        Hide
        Ken Fyten added a comment -

        Perhaps the new configurability added in 3.0 for Message Caching can be used as a suitable workaround for this.

        Show
        Ken Fyten added a comment - Perhaps the new configurability added in 3.0 for Message Caching can be used as a suitable workaround for this.
        Ken Fyten made changes -
        Affects [Compatibility/Configuration]
        Hide
        Mark Collette added a comment -

        Found the logic flaw. When doing an Ajax postback, or a fileEntry post that mimics one, the PartialViewContext.executeAll property is set appropriately depending if the submitted javax.faces.partial.execute is @all or not. But when a full page submit is made, that does not use Ajax, then the whole component tree is being executed, but PartialViewContext.executeAll is not set to true, and instead remains false. This tells our FacesMessagePhaseListener that it should propagate FacesMessage objects forward. So we need to first check PartialViewContext.partialRequest to see if executeAll is applicable, and when not in a partialRequest then know we're fully executing.

        Show
        Mark Collette added a comment - Found the logic flaw. When doing an Ajax postback, or a fileEntry post that mimics one, the PartialViewContext.executeAll property is set appropriately depending if the submitted javax.faces.partial.execute is @all or not. But when a full page submit is made, that does not use Ajax, then the whole component tree is being executed, but PartialViewContext.executeAll is not set to true, and instead remains false. This tells our FacesMessagePhaseListener that it should propagate FacesMessage objects forward. So we need to first check PartialViewContext.partialRequest to see if executeAll is applicable, and when not in a partialRequest then know we're fully executing.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #27299 Fri Jan 20 18:53:06 MST 2012 mark.collette ICE-7432 : Stale FacesMessages with <f:ajax disabled="true"/>
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/src/main/java/org/icefaces/impl/event/FacesMessagesPhaseListener.java
        Hide
        Mark Collette added a comment -

        icefaces3 trunk
        Subversion 27299

        Show
        Mark Collette added a comment - icefaces3 trunk Subversion 27299
        Mark Collette made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Mark Collette
            Reporter:
            Adrian Gygax
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: