Details

    • Type: Bug Bug
    • Status: Resolved Resolved (View Workflow)
    • Priority: Critical Critical
    • Resolution: Done
    • Affects Version/s: 4.0.0.Final
    • Fix Version/s: 4.1.0.Milestone1
    • Component/s: component-a4j-core
    • Security Level: Public (Everyone can see)
    • Labels:
      None
    • Environment:
      Tomcat 6.0.32, Tomcat 7.0.11, myfaces -2.0.4, richfaces 4.0.0.Final
    • Workaround Description:
      Hide

      Use <a4j:repeat keepSaved="true" />

      Show
      Use <a4j:repeat keepSaved="true" />
    • Similar Issues:
      Show 10 results 

      Description

      <h:body>
      
      	<h:form id="test_form">
      		<h:messages/>
      
      		<a4j:repeat value="#{dataBean.listDataItems}" var="item">
      			<a4j:repeat value="#{item.list}" var="inner">
      				<h:inputText id="test_input" value="#{inner.status}">
      				</h:inputText>
      				<br/>
      			</a4j:repeat>
      		</a4j:repeat>
      
      		<h:commandLink value="submit" />
      		<br/>
      		<a4j:commandLink value="ajax request" render="test_form" />
      
      	</h:form>
      
      </h:body>
      

      listDataItems -> 2 element List
      #

      {item.list}

      -> 2 element List
      #

      {inner}

      -> simple class with setter and getter status.

      fill inputs and click "ajax request" or "submit".

      2 first inputs after submit are not updated on server side

      Replace a4j:repeat with ui:repeat and it works

        Issue Links

          Activity

          Hide
          Jay Balunas
          added a comment -

          Lukas - please investigate, and try to reproduce asap.

          Show
          Jay Balunas
          added a comment - Lukas - please investigate, and try to reproduce asap.
          Hide
          wojtek k
          added a comment -

          i was on holiday last week. Sory for delay. Here is a test

          Show
          wojtek k
          added a comment - i was on holiday last week. Sory for delay. Here is a test
          Hide
          Lukáš Fryč
          added a comment -

          Thank you Wojtek, as I said, I have reproduced it and going to investigate it closer.

          Show
          Lukáš Fryč
          added a comment - Thank you Wojtek, as I said, I have reproduced it and going to investigate it closer.
          Hide
          Lukáš Fryč
          added a comment -

          It works with JSF RI 2.1.1-b03,

          but it doesn't work with JSF RI 2.0.4-b09
          or MyFaces 2.0.4 / 2.1.0-SNAPSHOT.

          Show
          Lukáš Fryč
          added a comment - It works with JSF RI 2.1.1-b03, but it doesn't work with JSF RI 2.0.4-b09 or MyFaces 2.0.4 / 2.1.0-SNAPSHOT.
          Hide
          Lukáš Fryč
          added a comment -

          Hi Wojtek, you could use <a4j:repeat keepSaved="true" /> to keep the state during iteration.

          Show
          Lukáš Fryč
          added a comment - Hi Wojtek, you could use <a4j:repeat keepSaved="true" /> to keep the state during iteration.
          Hide
          wojtek k
          added a comment - - edited

          thank you Lukas for keepSaved. It works but not in all situations.

          Try to add for example <h:commandButton action="#

          {inner.myAction}

          "/> after <h:inputText id="test_input".... />

          in action try access
          (MyInnerData) FacesContext.getCurrentInstance().getExternalContext().getRequest().getAttribute("inner");

          MyInnerData object is wrong. It works if I use ui:repeat instead of a4j:repeat.

          Show
          wojtek k
          added a comment - - edited thank you Lukas for keepSaved. It works but not in all situations. Try to add for example <h:commandButton action="# {inner.myAction} "/> after <h:inputText id="test_input".... /> in action try access (MyInnerData) FacesContext.getCurrentInstance().getExternalContext().getRequest().getAttribute("inner"); MyInnerData object is wrong. It works if I use ui:repeat instead of a4j:repeat.
          Hide
          Nick Belaevski
          added a comment -

          Lukas,

          Problem is caused by preDecode() method removing childState from StateHelper - we should add some other check there - UIData uses "nested in another UIData" criteria.

          Wojtek,

          Just to confirm, you have specified keepSaved="true" for both outer and inner repeats, right?

          Show
          Nick Belaevski
          added a comment - Lukas, Problem is caused by preDecode() method removing childState from StateHelper - we should add some other check there - UIData uses "nested in another UIData" criteria. Wojtek, Just to confirm, you have specified keepSaved="true" for both outer and inner repeats, right?
          Hide
          Lukáš Fryč
          added a comment - - edited

          Nick,

          I have fixed problem with resetting childState before ApplyRequestValues phase and before RenderView Phase by observing PostRestoreStateEvent and PreRenderViewEvent instead of in processDecodes. This way state is reset exactly once.

          Show
          Lukáš Fryč
          added a comment - - edited Nick, I have fixed problem with resetting childState before ApplyRequestValues phase and before RenderView Phase by observing PostRestoreStateEvent and PreRenderViewEvent instead of in processDecodes. This way state is reset exactly once.

            People

            • Assignee:
              Lukáš Fryč
              Reporter:
              wojtek k
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: