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

        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
        Hide
        Adrian Gygax added a comment -

        Fixed testcase

        Show
        Adrian Gygax added a comment - Fixed testcase
        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.
        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.
        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.
        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.
        Hide
        Mark Collette added a comment -

        icefaces3 trunk
        Subversion 27299

        Show
        Mark Collette added a comment - icefaces3 trunk Subversion 27299

          People

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

            Dates

            • Created:
              Updated:
              Resolved: