1 Reply Latest reply on Mar 20, 2014 10:16 AM by michpetrov

    persisting problem with form data with datatable inside

    kishi_kiran

      hello All,

      I am gettin problems with persisting the form data which includes the data table inside the form

      insertin data with feilds and in datatable)

      problem: when i have datatable in form i am unable to persist the records

      because the the datatable value action (getTransportItemUnits())is getting called before the action method (createCustomerBookingReq())in save button.

       

      then after i have added immediate = true attribute in for save button then the createCustomerBookingReq() is called

      but the values which i have entered in the datatable are not going to the bean everything is null.

       

      i have tried with the attributes but i could not able to successed on this.

       

      can any one tell me what is the problem here in this code?

       

      here is my code.

       

      <h:form id = "cbrEdit" styleClass = "ki-form clear-float admin-company-search-content">

              <div class = "general-info-left-column-div">

                  <h:panelGrid id = "panel" columns = "2" border = "1" cellpadding = "0" cellspacing = "2">

                      <h:outputLabel for = "cbreqbookingno" value = "#{messagesCustomerBookingReq['customerbookingreq.label.bookingno']}"/>

                      <h:inputText id = "cbreqbookingno" value = "#{transportRequestBean.transportRequestFormBean.bookingNo}"/>

                      <h:outputLabel for = "cbreqbillingno"

                                     rendered = "#{configurationManager.getConfiguration('viewtransportRequest_excludes').contains('|billingNo|')}"

                                     value = "#{messagesCustomerBookingReq['customerbookingreq.label.billingno']}"/>

                  </h:panelGrid>

              </div>

              <div class = "transport-item-table">

                  <rich:dataTable id = "cargoTable" cellpadding = "0" cellspacing = "0" border = "0"

                                  var = "unit"

                                  value = "#{transportRequestBean.transportRequestFormBean.getTransportItemUnits()}"

                                  rendered = "#{configurationManager.getConfiguration('viewtransportRequest_excludes').contains('|transportItemUnit|')}">

                  <rich:column id = "tiu_eqpmentId_clmn" colspan = "1">

                      <f:facet name = "header">

                          <h:outputText id = "tiu_eqpmentId_label" styleClass = "headerText"

                                        value = "#{messages['executionplan.label.equipment.id']}  "/>

                      </f:facet>

                      <h:inputText id = "cntrNo1" value = "#{transportRequestBean.transportRequestFormBean.referenceNumber}"

                                   required = "#{transportRequestBean.isRequired()}"/>

                  </rich:column>

                  <rich:column id = "tiu_sealOne_clmn" colspan = "1">

                      <f:facet name = "header">

                          <h:outputText id = "tiu_sealOne_label" styleClass = "headerText"

                                        value = "#{messagesCustomerBookingReq['trackingreq.label.sealOne']}"/>

                      </f:facet>

                      <rich:inplaceInput id = "sealNo1Inpt" layout = "block" editClass = "inplaceInputEdit" value = "#{unit.sealNo1}"/>

                  </rich:column>

                  </rich:dataTable>

              </div>

              <fieldset id = "buttons-fieldset" style = "margin-left:-7px;margin-top:600px;">

                  <a4j:commandButton

                          id = "saveAndPlanTR"

                          value = "#{messages['command.save']}"

                          action = "#{transportRequestBean.createCustomerBookingReq()}"/>

              </fieldset>

          </div>

      </div>

      </h:form>

       

      Thanks in Advance!

      Kishi Kiran