2 Replies Latest reply on Jun 25, 2010 8:15 AM by ilya_shaikovsky

    ModalPanel rerendering Problem

    janakiramnarla

      Hi Friends,

      When i click a4j:commandLink acton method will be executed for refreshing modalpanel data ,after ajax response is returned i will show the modalpanel.

      Here is a4j:commandButton
      ----------------

      <a:commandButton value="#{messages.buttoncreatenewparam}"
      ajaxSingle="true"
      limitToList="true"
      styleClass="defaultButton"
      style="#{formLnF.getButtonSettings(skinBean.skin)}"
      reRender=modalSpan"
      action="#{paramHome.create}"
      oncomplete="#{rich:component('smsParam_Model')}.show()">

      </a:commandButton>





      modalPanel Code:
      ---------------------

      <rich:modalPanel id="smsParam_Model" autosized="true" minHeight="200"
      moveable="false" resizeable="false" top="10px" minWidth="500"
      zindex="100">
      <f:facet name="header">#{messages.smsparadet}</f:facet>

      <f:facet name="controls">
      <h:panelGroup>
      <h:graphicImage value="/img/close.png" style="cursor:pointer"
      id="hidelink_smsParam" styleClass="hidelink" />
      <rich:componentControl for="smsParam_Model"
      attachTo="hidelink_smsParam" operation="hide" event="onclick" />
      </h:panelGroup>
      </f:facet>



      <s:span id="modalSpan">

      <a:form id="smsParamform" enctype="multipart/form-data"
      ajaxSubmit="true" ajaxSingle="true"
      reRender="smsParamform">
      <h:messages globalOnly="true" styleClass="message"
      style="border: 1px solid #FFCC00; padding: 5px; margin-top: 5px; margin-bottom: 5px;
      background-color: #F0F8FF; font-size: 12px;" />

      <h:panelGrid columns="1" cellspacing="2" width="100%"
      cellpadding="1" columnClasses="columnFull">
      <s:decorate for="smsName" template="/layout/edit.xhtml">
      <ui:define name="label">
      <h:outputText for="smsName" styleClass="formFont">#{messages.paramname}</h:outputText>
      </ui:define>
      <h:inputText id="smsName" required="true" maxlength="255"
      disabled="#{paramHome.managed}"
      value="#{paramHome.doMobeeParam.paramName}"
      style=" width : 195px;" styleClass="formFont2"
      requiredMessage="#{messages.validateparmname}">
      </h:inputText>
      </s:decorate>
      </h:panelGrid>


      <h:panelGrid columns="1" cellspacing="2" width="100%"
      cellpadding="1" columnClasses="columnFull">
      <s:decorate for="pValue" template="/layout/edit.xhtml">
      <ui:define name="label">
      <h:outputText for="pValue" styleClass="formFont">#{messages.paramvalue}</h:outputText>
      </ui:define>
      <h:inputText id="pValue" required="true" maxlength="255"
      value="#{doMobeeParam.paramValue}" style=" width : 195px;"
      styleClass="formFont2"
      requiredMessage="#{messages.validateparamvalue}">
      </h:inputText>
      </s:decorate>
      </h:panelGrid>

      <a:commandButton
      eventsQueue="paramQueue" action="#{paramHome.persist}"
      value="#{messages.buttonsave}" rendered="#{!paramHome.managed}"
      styleClass="defaultButton"
      style="#{formLnF.getButtonSettings(skinBean.skin)}"
      reRender="smsParamform"
      event="oncomplete" ajaxSingle="false"
      oncomplete="if (#{paramHome.hide eq 'yes'}) #{rich:component('smsParam_Model')}.hide();">
      <f:setPropertyActionListener value="sms"
      target="{paramHome.channelName}"/>
      </a:commandButton>


      </a:form>
      </s:span>


      action method:
      ----------------




      @Override
      @Begin(join = true)
      public void create() {
      log.debug("IN CREATE ()");
      super.create();
      hide = "no";
      paramListData = null;

      try {
      if (paramId == null) {
      BeanUtils.copyProperties(doMobeeParam, new DoMobeeParam());
      super.clearInstance();
      super.clearDirty();
      doMobeeParam.setChannel(channelName);
      tempParamListMap.clear();

      }

      if (isManaged()) {

      log.info("managed true");
      } else {
      BeanUtils.copyProperties(doMobeeParam, new DoMobeeParam());

      doMobeeParam.setChannel(channelName);
      groupList = new ArrayList();

      }
      } catch (Exception e) {
      e.printStackTrace();
      }

      }




      when i fill one input field and keep other field as blank and submit the form using commandbutton then validation message is displaying .It is fine .After validation failed i have closed the modalpanel using top right cross image.

      Again i opened the modal panel using command button ,modalpanel is displaying with previous value.Present i was moved to richFaces3.3.0.GA and seam2.1.2.It is working fine in seam2.0.2.
      One more point I don't want to close conversation when i click cross image(close) in modalpanel.


      Can any one help me on this ,i am struggleing to solve this from 2 days.Thank u in advance.