MyFaces Core
  1. MyFaces Core
  2. MYFACES-2980

f:ajax wrapped around component(s) does not work as expected

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.3-SNAPSHOT
    • Fix Version/s: 2.0.3
    • Component/s: JSR-314
    • Labels:
      None
    • Environment:
      myfaces current trunk

      Description

      <h:form id="form1">
      <f:ajax render="@form">
      <h:commandButton id="button" value="Click me 1!"/>
      </f:ajax>
      </h:form>

      <h:form id="form2">
      <h:commandButton id="button" value="Click me 2!" >
      <f:ajax render="@form"/>
      </h:commandButton>
      </h:form>

      If you click "Click me 1" than button disappers because it is no rendered in ajax XML output.

      The second button with inner f:ajax work as expected.

        Activity

        Hide
        Martin Kočí added a comment -

        Problem in build view/component tree re-construction, because if h:form id="form1" is re-rendered, it contains no children - getChildrenCount is 0.

        Show
        Martin Kočí added a comment - Problem in build view/component tree re-construction, because if h:form id="form1" is re-rendered, it contains no children - getChildrenCount is 0.
        Hide
        Leonardo Uribe added a comment -

        Yes, it happens when pss is set to false, because the components inside f:ajax are not refreshed, but it works well with pss enabled. It is a bug, but the solution is simple, just let the algorithm pass when wrap mode is used and only add AjaxBehavior when the component is created (in other words when it is not present on the tree).

        Other small fixes were done like comment componentFoundInserted variable and only add default validators for created components. It is possible to do some more cleanup, removing the code that checks for duplicate default validators.

        Show
        Leonardo Uribe added a comment - Yes, it happens when pss is set to false, because the components inside f:ajax are not refreshed, but it works well with pss enabled. It is a bug, but the solution is simple, just let the algorithm pass when wrap mode is used and only add AjaxBehavior when the component is created (in other words when it is not present on the tree). Other small fixes were done like comment componentFoundInserted variable and only add default validators for created components. It is possible to do some more cleanup, removing the code that checks for duplicate default validators.

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Martin Kočí
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development