5 Replies Latest reply on Jul 18, 2011 11:09 AM by Wei Wang

    It's a qustion about a4j:commandbutton rerender the master page in rich:modalpanle

    Wei Wang Newbie

      Hi,everyone ,

      I just use richface before a few weeks,but I got a problem and that need you help,thanks.

       

      I need refresh insuredtPerson1 panle when  select a client information from modalpanle,but ,the master page have not rerendered ,and  inputTexts in the panle insuredtPerson1 haven't display the selected client's information  when a4j:commandbutton invoke the backingbean setClient method completed.

       

      tips:at first ,I used ver.3.1.6,and find this problem,but It's happed  same case  when I use ver.3.3.3 instead the 3.16.

      because my formwork base JSF 1.2.

       

       

      <ui:composition template="/layout/layout3.xhtml">
      <ui:define name="header">
        <nl:header backingBean="#{backingbean}" />
      </ui:define>
      <ui:define name="content">
        <a4j:region  selfRendered="true">
        <table width="100%">
          <tr>
          <td colspan="2">
            <table width="100%">
            ...

          <tr>
          <td width="10"><t:outputLabel styleClass="Label"
            value="#{messageBundle.INSURED}" />
          </td>
          <td><table border="1" width="100%">
            <rich:panel id="insuredId" columns="8" bodyClass="TableLabelOdd"
              rendered="true">
              <table width="100%">
              <tr>
                <td><a4j:commandLink id="linktopanle"
                  oncomplete="#{rich:component('selectClient')}.show()">
                  <t:outputLabel styleClass="Label"
                  value="#{messageBundle.QUERY_NAME}" />
                  <a4j:actionparam name="clientType" value="1"
                  assignTo="#{backingbean.dto.clientType}" />
                </a4j:commandLink></td>
                <td><t:inputText id="name" styleClass="OutputGeneral"
                  vlaue="#{backingbean.dto.insured.name}" />
                </td>
                <td><t:outputLabel styleClass="Label"
                  value="#{messageBundle.QUERY_ID_TYPE}" />
                </td>
                <td><t:selectOneMenu id="idType"
                  rendered="#{not empty backingbean.dto.idTypeCodeList}"
                  value="#{backingbean.dto.insured.idType}"
                  styleClass="Dropdown" displayValueOnly="false"
                  converterId="newlife.UpperCaseConverter">
                  <f:selectItems value="#{backingbean.dto.idTypeCodeList}" />

                </t:selectOneMenu></td>
                <td><t:outputLabel styleClass="Label"
                  value="#{messageBundle.QUERY_ID_NO}" />
                </td>
                <td><t:inputText styleClass="OutputGeneral"
                  vlaue="#{backingbean.dto.insured.idNo}" /></td>
                <td><t:outputLabel styleClass="Label"
                  value="#{messageBundle.CLIENTIDEFFECTIVEDATE}" />
                </td>
                <td><t:inputCalendar id="iDExpDate" size="10"
                  maxlength="10" value="#{backingbean.dto.insured.iDExpDate}"
                  popupTodayString="#{pageBundle.CALENDAR_POPUP_TODAY}"
                  popupWeekString="#{pageBundle.CALENDAR_POPUP_WEEK}"
                  renderAsPopup="true" renderPopupButtonAsImage="true"
                  popupDateFormat="#{user.dateFormatPattern}"
                  alt="#{pageBundle.CALENDAR_ALT}"
                  title="#{pageBundle.CALENDAR_TITLE}"
                  displayValueOnly="false"
                  displayValueOnlyStyleClass="OutputGeneral" rendered="true"
                  format="yyyy-MM-dd">

                </t:inputCalendar></td>
              </tr>
              </table>
            </rich:panel>
            <rich:panel id="insuredtPerson1" columns="6"
              bodyClass="TableLabelEven" rendered="true">
              <table width="100%">
              <tr>
                <td><t:outputLabel styleClass="Label"
                  value="#{messageBundle.QUERY_GENDER}" /></td>
                <td><t:selectOneRadio styleClass="OutputGeneral"
                  rendered="#{not empty backingbean.dto.genderList}"
                  value="#{backingbean.dto.insured.gender}">
                  <f:selectItems value="#{backingbean.dto.genderList}" />

                </t:selectOneRadio></td>
                <td><t:outputLabel styleClass="Label"
                  value="#{messageBundle.QUERY_BRITHDAY}" />
                </td>
                <td><t:inputCalendar id="birthday" size="10"
                  maxlength="10" value="#{backingbean.dto.insured.brithDay}"
                  popupTodayString="#{pageBundle.CALENDAR_POPUP_TODAY}"
                  popupWeekString="#{pageBundle.CALENDAR_POPUP_WEEK}"
                  renderAsPopup="true" renderPopupButtonAsImage="true"
                  popupDateFormat="#{user.dateFormatPattern}"
                  alt="#{pageBundle.CALENDAR_ALT}"
                  title="#{pageBundle.CALENDAR_TITLE}"
                  displayValueOnly="false"
                  displayValueOnlyStyleClass="OutputGeneral" rendered="true"
                  format="yyyy-MM-dd">

                </t:inputCalendar></td>
                <td><t:outputLabel styleClass="Label"
                  value="#{messageBundle.AGE}" /></td>
                <td><t:inputText id="age" styleClass="OutputGeneral"
                  vlaue="#{backingbean.dto.insured.age}" /></td>
              </tr>
              </table>
            </rich:panel>
        </a4j:region>
      </ui:define>

       

       

      <ui:define name="richFace">
        <rich:modalPanel id="selectClient"  autosized="true" width="900" zindex="2">
        <f:facet name="header">
          <t:outputText value="Select Client" />
        </f:facet>
        <f:facet name="controls">
          <h:graphicImage value="/images/close.png" style="cursor:pointer"
          onclick="#{rich:component('selectClient')}.hide();" />
        </f:facet>
        <h:form>
          <table border="1" width="100%">
            <tr class="ListRowEven">
            <td colspan="6"><rich:spacer height="20" /> <rich:dataTable
              width="100%" id="resultTable" rows="5" columnClasses="col"
              onRowMouseOver="this.style.backgroundColor='#F8F8F8'"
              onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
              value="#{backingbean.dto.dataTable}" var="row">
              <f:facet name="header">
                <rich:columnGroup>
                <h:column>
                  <t:outputText styleClass="headerText"
                  value="#{messageBundle.QUERY_NAME}" />
                </h:column>
                <h:column>
                  <t:outputText styleClass="headerText"
                  value="#{messageBundle.QUERY_ID_TYPE}" />
                </h:column>
                <h:column>
                  <t:outputText styleClass="headerText"
                  value="#{messageBundle.QUERY_ID_NO}" />
                </h:column>
                <h:column>
                  <t:outputText styleClass="headerText"
                  value="#{messageBundle.QUERY_GENDER}" />
                </h:column>
                <h:column>
                  <t:outputText styleClass="headerText"
                  value="#{messageBundle.QUERY_BRITHDAY}" />
                </h:column>
                </rich:columnGroup>
              </f:facet>

              <h:column>
                <t:outputText value="#{row.name}" />
              </h:column>
              <h:column>
                <t:outputText value="#{row.idType}" />
              </h:column>
              <h:column>
                <t:outputText value="#{row.idNo}" />
              </h:column>
              <h:column>
                <t:outputText value="#{row.gender}" />
              </h:column>
              <h:column>
                <t:outputText value="#{row.brithDay}" />
              </h:column>


              <a4j:support event="onRowDblClick"
                reRender="selectedClientId,selectedClientPerson1,selectedClientPerson2,selectedClientPersonAddr,addressTable,selectedClientComm,"
                action="#{backingbean.takeSelection}">
                <a4j:actionparam name="clientNum" value="#{row.clientNumb}"
                assignTo="#{backingbean.dto.selectedClientNum}" />
              </a4j:support>

              <f:facet name="footer">
                <rich:datascroller align="right" for="resultTable"
                maxPages="20" />
              </f:facet>
              </rich:dataTable>
            </td>

            </tr>

            <tr class="ListRowOdd">

            <td colspan="6"><rich:panel id="selectedClientId"
              columns="8" style="height:30px;" bodyClass="TableLabelOdd"
              rendered="true">
              <table width="100%">
                <tr>
                <td width="8%"><t:outputLabel styleClass="TableLabel"
                  value="#{messageBundle.QUERY_NAME}" /></td>
                <td width="17%"><t:outputLabel id="individualNameas"
                  styleClass="TableLabel"
                  value="#{backingbean.dto.client.name}" />
                </td>
                <td width="12.5%"><t:outputLabel styleClass="TableLabel"
                  value="#{messageBundle.QUERY_ID_TYPE}" /></td>
                <td width="12.5%"><t:outputLabel id="taxIdenUsag"
                  styleClass="TableLabel"
                  value="#{backingbean.dto.client.idType}" /></td>
                <td width="12.5%"><t:outputLabel styleClass="TableLabel"
                  value="#{messageBundle.QUERY_ID_NO}" /></td>
                <td width="12.5%"><t:outputLabel
                  id="identificationNumber" styleClass="TableLabel"
                  value="#{backingbean.dto.client.idNo}" /></td>
                <td width="12.5%"><t:outputLabel styleClass="TableLabel"
                  value="#{messageBundle.CLIENTIDEFFECTIVEDATE}" /></td>
                <td width="12.5%"><t:outputLabel id="iDClientExpDate"
                  styleClass="TableLabel"
                  value="#{backingbean.dto.client.iDExpDate}" /></td>
                </tr>
              </table>
              </rich:panel>
              ...
              </rich:dataTable></td>
            </tr>

            <tr class="ListRowOdd">
            <td colspan="6" align="right"><a4j:commandButton id="submit"
              value="#{messageBundle.SUBMIT}" reRender="name"
              action="#{backingbean.setClient}"  ajaxSingle="true"
              oncomplete="#{rich:component('selectClient')}.hide();">
              </a4j:commandButton> <t:commandButton value="#{messageBundle.ADD}"
              onclick="#{rich:component('selectClient')}.hide();">
              <a4j:support event="onhide" reRender="insuredId"  ajaxSingle="true"
                action="#{backingbean.setClient}" />
              </t:commandButton> <t:commandButton value="#{messageBundle.CANCLE}"
              onclick="#{rich:component('selectClient')}.hide();" /></td>
            </tr>
          </table>
        </h:form>
        </rich:modalPanel>
        <a4j:status onstart="#{rich:component('wait')}.show()"
        onstop="#{rich:component('wait')}.hide()" />
        <rich:modalPanel id="wait" autosized="true" width="32" height="32"
        moveable="false" resizeable="false">
        <h:graphicImage value="/images/ajax/processing.gif" />
        </rich:modalPanel>
      </ui:define>
      </ui:composition>

      </html>