2 Replies Latest reply on Jun 12, 2008 7:54 PM by Mark French

    Immediate true on a4j:commandButton not refreshing form fiel

    Mark French Newbie

      Hi,

      I have a requirement to have a an entry form to come up in readonly mode then push a button to enable editing of the fields. The problem I'm having is if they need to be able to undo and be placed back in readonly mode, any value they may have entered is not refreshed when immediate true is placed on the undo a4j:commandbutton. Is there a work around to ensure the field value are rerendered?

      Cheers

      Mark

        • 2. Re: Immediate true on a4j:commandButton not refreshing form
          Mark French Newbie

          Here part of the page and its contained in a simple toggle panel:

          <rich:simpleTogglePanel id="workOrderPlanningDetailsPnl" headerClass="secondary-header"
           label="#{labels.workOrderDetails}" switchType="ajax"
           opened="false"
           binding="#{maintainWorkOrdersDetails.detailsPanel}">
          



           <h:panelGrid columns="4">
           <h:selectBooleanCheckbox styleClass="checkbox" label="#{labels.modification}" required="true" id="modification"
           disabled="#{!maintainWorkOrdersDetails.editMode}"
           value="#{maintainWorkOrdersDetails.currentWorkOrder.modification}"/>
           <rich:message for="modification" id="modificationError" tooltip="true" showDetail="false" showSummary="false">
           <f:facet name="errorMarker">
           <h:graphicImage url="/images/error.gif"/>
           </f:facet>
           </rich:message>
           <t:buffer into="#{errorMessage}"><h:message for="modification"/></t:buffer>
           <rich:toolTip for="modificationError" followMouse="true" rendered="#{! empty errorMessage}"><h:message
           for="modification"/></rich:toolTip>
           </h:panelGrid>
          


          And the buttons:
          <h:panelGroup>
           <a4j:commandButton rendered="#{maintainWorkOrdersDetails.scopeDeveloper && !maintainWorkOrdersDetails.editMode}"
           action="#{maintainWorkOrdersDetails.enableEditing}"
           reRender="workOrderPlanningDetailsPnl" value="#{labels.editButton}"/>
           <a4j:commandButton rendered="#{maintainWorkOrdersDetails.scopeDeveloper && maintainWorkOrdersDetails.editMode}"
           reRender="workOrderPlanningDetailsPnl" action="#{maintainWorkOrdersDetails.save}"
           value="#{labels.saveButton}"/>
           <rich:spacer rendered="#{maintainWorkOrdersDetails.scopeDeveloper && maintainWorkOrdersDetails.editMode}"/>
           <a4j:commandButton immediate="true"
           rendered="#{maintainWorkOrdersDetails.scopeDeveloper && maintainWorkOrdersDetails.editMode}"
           reRender="workOrderPlanningDetailsPnl,archiveBox" action="#{maintainWorkOrdersDetails.cancel}"
           value="#{labels.undoButton}" bypassUpdates="true"/>
          
           </h:panelGroup>
          


          Let me know if you need moredetails the backing bean just toggles the mode flag on undo.

          Cheers

          Mark