0 Replies Latest reply on Apr 8, 2009 6:38 AM by vasavi

    Editing the fields using the combo box in modalpanel

    vasavi
      Hi all,
      I have tried to edit the records of the datatable in the list page using Modalpanel. I am able to edit all the fields except the combo box. When i click on edit link, the values are passed to the combo box but the exact value of that record is not displaying in the combo box. can anybody help me in doing this.

      Here is the code:
      <rich:modalPanel id="editPanel" autosized="true" width="450">
              <f:facet name="header">
                  <h:outputText value="Edit Current Record" />
              </f:facet>
              <f:facet name="controls">
                  <h:panelGroup>
                      <h:graphicImage value="/img/ico_close.gif"
                          id="hidelink" styleClass="hidelink"/>
                      <rich:componentControl for="editPanel" attachTo="hidelink"
                          operation="hide" event="onclick" />
                  </h:panelGroup>
              </f:facet>
              <h:form>
                  <rich:messages style="color:red;"></rich:messages>
                  <h:panelGrid columns="1">
                  <a4j:outputPanel ajaxRendered="true">
                      <h:panelGrid columns="1">
                          <s:decorate id="countryCode" template="layout/edit.xhtml">
                                 <ui:define name="label">Country code</ui:define>
                                 <h:inputText value="#{country.countryCode}"/>
                             </s:decorate>

                             <s:decorate id="name" template="layout/edit.xhtml">
                                 <ui:define name="label">Name</ui:define>
                                 <h:inputText value="#{country.name}"/>
                             </s:decorate>

                             <s:decorate id="FActive" template="layout/edit.xhtml">
                                 <ui:define name="label">F active</ui:define>
                                 <h:inputText value="#{country.FActive}"/>
                                 </s:decorate>
                                 
                                 <s:decorate id="regionField" template="layout/edit.xhtml">
                                <ui:define name="label">Region</ui:define>
                                   <h:selectOneMenu value="#{country.region}" required="true" id="region">
                                    <s:selectItems value="#{regiones}" var="region" label="#{region.name}" noSelectionLabel="Please Select..."/>
                                    <s:convertEntity />
                                      </h:selectOneMenu>
                                 </s:decorate>
                      </h:panelGrid>
                      <rich:message showSummary="true" showDetail="false" for="price"/>
                  </a4j:outputPanel>
                  <a4j:commandButton value="Store"
                      action="#{countryS.update}"
                      reRender="countryCode, name, FActive, region"
                      oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('editPanel')}.hide();" />
                  </h:panelGrid> 
              </h:form>
          </rich:modalPanel>

      Thank u....