2 Replies Latest reply on Nov 17, 2008 10:50 AM by chris.simons

    a4j:support clearing input values

      All,

      Having upgraded to RichFaces 3.2.2.GA, it seems that dropdowns (particularly) that use a4j:support to "reRender" an entire form are also clearing the data that was entered in input fields.

      Also, having trouble getting a conditional ui:fragment to reRender from the a4j:support individually - hence the reason I'm reRendering the entire form.

      I am using s:decorate and Seam 2.0GA but this wasn't a problem before. Any ideas? Thanks.

      Sample code below...

      <tr>
      <s:decorate id="countryDecorate" template="/layout/forms/edit.xhtml">
      <ui:define name="label">Country:</ui:define>
      <ui:param name="colspan" value="1"/>
      <h:selectOneListbox id="country" size="1" required="false"
       value="#{cvEvent.address.country}">
       <a4j:support event="onchange" ajaxSingle="true" reRender="createEventForm"bypassUpdates="true"/>
      <s:selectItems var="value" label="#{value.description}"
       value="#{valueManager.values['Country']}" />
       <s:convertEntity />
      </h:selectOneListbox>
      </s:decorate>
      <s:decorate template="/layout/forms/emptyEdit.xhtml" />
      </tr>
      <ui:fragment id="uiDisplayState" rendered="#{cvAddress.country.name == 'US'}">
      
      <tr>
      <s:decorate id="stateDecorate" template="/layout/forms/edit.xhtml">
      <ui:define name="label">State:</ui:define>
      <ui:param name="colspan" value="1"/>
      <h:selectOneListbox id="state" size="1" required="false"
       value="#{cvEvent.address.state}">
      <s:selectItems var="value" label="#{value.description}"
       noSelectionLabel="#{messages['form.controls.noSelectionLabel']}"
       value="#{valueManager.values['State']}" />
       <s:convertEntity />
      </h:selectOneListbox>
      </s:decorate>
      <s:decorate template="/layout/forms/emptyEdit.xhtml" />
      </tr>
       </ui:fragment>




        • 1. Re: a4j:support clearing input values
          ilya_shaikovsky

          if you using ajaxSingle=true - this means that only select new Value will be applied during request. So when you reRender whole form - all other controls which wasn't processed during request - reseted to prevoius value. And this is the issue of your use case design.

          • 2. Re: a4j:support clearing input values

            Perhaps our problem, then, is that ui:fragment isn't working as expected. We used to be able to conditionally display ui:fragments and have the children of the fragment display on an a4j reRender...but this is no longer happening after RichFaces 3.2.2.GA.