7 Replies Latest reply on Dec 13, 2007 3:21 PM by Paulo Manabe

    ModalPanel + model didnt updating

    Paulo Manabe Newbie

      Hi all, i'm using modal panel + a4j:commandbutton, but when I click on button the model didnt update, the beans are correctly created, but I couldnt undestand why the value is always null

      <a4j:form id="frmSearchRICForDailyPrice">
       <richfaces:modalPanel id="searchRIC" height="600" width="694" zindex="2000" moveable="true" resizeable="false">
       <f:facet name="header">
       <t:outputText value="Search RIC" />
       </f:facet>
       <f:facet name="controls">
       <h:graphicImage value="/images/close.png" style="cursor:pointer" onclick="Richfaces.hideModalPanel('searchRIC')" />
       </f:facet>
      
       <t:div>
       <t:graphicImage border="0" width="674" height="87" value="/images/header_popup.gif" />
       </t:div>
      
       <t:div styleClass="popup_div_header_title">
       <t:div styleClass="content_headline_1">
       <t:outputText value="Search RIC" />
       </t:div>
       </t:div>
      
       <db:fieldSet legend="Filter" legendSytleClass="blue_12_bold" styleClass="contentFilterTable_popup">
       <t:panelGrid columns="1" cellpadding="1" cellspacing="0" columnClasses="tdAlignRight">
       <t:panelGroup>
       <t:panelGrid columns="7" cellpadding="3" cellspacing="0" columnClasses="tdAlignRight">
      
       <t:outputLabel value="Code : " for="codeInput" styleClass="grey_11"/>
       <t:inputText id="codeInput" value="#{dailyPriceAdjustment.searchResource.searchResourcesBean.ricCodeFilter}" styleClass="grey_11" style="width:150px;"/>
      
       <t:outputLabel value="Industry Group : " for="industryGroupSelect" styleClass="grey_11"/>
       <t:selectOneMenu id="industryGroupSelect" value="#{dailyPriceAdjustment.searchResource.searchResourcesBean.ricIndustryGroupFilter}" styleClass="grey_11" style="width:150px;">
       <f:selectItems value="#{dailyPriceAdjustment.searchResource.searchResourcesBean.industryGroupItens}"/>
       </t:selectOneMenu>
      
       <t:outputLabel value="Industry Sector : " for="industrySectorSelect" styleClass="grey_11"/>
       <t:selectOneMenu id="industrySectorSelect" value="#{dailyPriceAdjustment.searchResource.searchResourcesBean.ricIndustrySectorFilter}" styleClass="grey_11" style="width:150px;">
       <f:selectItems value="#{dailyPriceAdjustment.searchResource.searchResourcesBean.industrySectorItens}"/>
       </t:selectOneMenu>
      
       <a4j:commandButton ajaxSingle="true" action="#{dailyPriceAdjustment.applyRICFilter}" value="Apply" reRender="divErrorMessage" styleClass="grey_12"/>
       </t:panelGrid>
       </t:panelGroup>
       </t:panelGrid>
       </db:fieldSet>
      
       <t:div id="divErrorMessage" style="margin-top: 10px;vertical-align: middle;text-align: center;">
       <h:messages id="errorMessage" layout="table" styleClass="ValidateError" globalOnly="true"/>
       </t:div>
      
       <t:div styleClass="popup_div_footer">
       <t:div styleClass="footline_divider" />
       <t:panelGrid columns="1" cellspacing="0" cellpadding="0" border="0" style="margin-left:5px;padding-bottom:5px" columnClasses="footline" >
       <t:outputText value="Copyright © Deutsche Bank SI" />
       </t:panelGrid>
       </t:div>
       </richfaces:modalPanel>
       </a4j:form>


        • 2. Re: ModalPanel + model didnt updating
          Valentyn Polischuk Newbie

          Example:

          <a4j:form>

          <rich:panel id="editServicePanel" style="display:none; width: 99%; height:100%;">
          <f:facet name="header">Edit Service Panel</f:facet>
          <a4j:outputPanel ajaxRendered="true">
          <h:panelGrid columns="2" width="100%">

          <h:outputText styleClass="label" value="OID:"/>
          <h:inputText styleClass="labelIn" disabled="#{!service.isAccess}" value="#{service.entity.oid}"
          title="oid"/>
          <h:outputText styleClass="label" value="Name:"/>
          <h:inputText styleClass="labelIn" disabled="#{!service.isAccess}" value="#{service.entity.name}"
          title="name"/>
          <h:outputText styleClass="label" value="Type:"/>
          <h:inputText styleClass="labelIn" disabled="#{!service.isAccess}" value="#{service.entity.type}"
          title="type"/>
          <h:outputText styleClass="label" value="Delay:"/>
          <h:inputText styleClass="labelIn" disabled="#{!service.isAccess}" value="#{service.entity.delay}"
          title="delay"/>

          </h:panelGrid>
          </a4j:outputPanel>


          <h:panelGrid columns="3">
          <a4j:commandButton id="save" action="#{service.save}" styleClass="rsButton"
          oncomplete="dropOut_editServicePanel(),appear_viewServicePanel()"
          value="Save" disabled="#{!Service.isAccess}"/>
          <a4j:commandButton id="cancel" action="#{Service.cancel}" styleClass="rsButton"
          oncomplete="dropOut_editServicePanel(),appear_viewServicePanel()"
          value="Cancel" disabled="#{!Service.isAccess}"/>
          </h:panelGrid>

          </rich:panel>

          </a4j:form>

          • 3. Re: ModalPanel + model didnt updating
            Paulo Manabe Newbie

            when the button Apply is clicked, the message is showed in java console

            There should always be a submitted value for an input if it is rendered, its form is submitted, and it is not disabled or read-only.


            I believe this is the problem, but I couldn't understand what it is.

            • 4. Re: ModalPanel + model didnt updating
              Paulo Manabe Newbie

               

              "VGAngel" wrote:
              Example:

              <a4j:form>

              <rich:panel id="editServicePanel" style="display:none; width: 99%; height:100%;">
              <f:facet name="header">Edit Service Panel</f:facet>
              <a4j:outputPanel ajaxRendered="true">
              <h:panelGrid columns="2" width="100%">

              <h:outputText styleClass="label" value="OID:"/>
              <h:inputText styleClass="labelIn" disabled="#{!service.isAccess}" value="#{service.entity.oid}"
              title="oid"/>
              <h:outputText styleClass="label" value="Name:"/>
              <h:inputText styleClass="labelIn" disabled="#{!service.isAccess}" value="#{service.entity.name}"
              title="name"/>
              <h:outputText styleClass="label" value="Type:"/>
              <h:inputText styleClass="labelIn" disabled="#{!service.isAccess}" value="#{service.entity.type}"
              title="type"/>
              <h:outputText styleClass="label" value="Delay:"/>
              <h:inputText styleClass="labelIn" disabled="#{!service.isAccess}" value="#{service.entity.delay}"
              title="delay"/>

              </h:panelGrid>
              </a4j:outputPanel>

              <b/>
              <h:panelGrid columns="3">
              <a4j:commandButton id="save" action="#{service.save}" styleClass="rsButton"
              oncomplete="dropOut_editServicePanel(),appear_viewServicePanel()"
              value="Save" disabled="#{!Service.isAccess}"/>
              <a4j:commandButton id="cancel" action="#{Service.cancel}" styleClass="rsButton"
              oncomplete="dropOut_editServicePanel(),appear_viewServicePanel()"
              value="Cancel" disabled="#{!Service.isAccess}"/>
              </h:panelGrid>

              </rich:panel>

              </a4j:form>


              I tried with a4j:region and a4j:outputPanel and doesn't work.

              • 5. Re: ModalPanel + model didnt updating
                Paulo Manabe Newbie

                help please =(

                the setters methods weren't called....why commandbutton is skiping the update data model process?

                • 6. Re: ModalPanel + model didnt updating
                  Sergey Smirnov Master

                  first of all, you have a form around the modalPanel. This is incorrect.
                  1. the form must be inside the modal panel
                  2. should not be form around modal panel

                  correct this, first.

                  • 7. Re: ModalPanel + model didnt updating
                    Paulo Manabe Newbie

                    sergey thank you very much!!!!

                    simplest solution!!!!