0 Replies Latest reply on Apr 17, 2008 5:18 PM by Alexander Eitner

    DataModel and data binding

    Alexander Eitner Newbie


      i try to find out how to do a databinding for a dataModel.

           public Collection<WorkflowPropertiesVO> tableContentProperties;

      The stateless sessionBean provides a @factory method, which is invoked successfully, besides all imaginable getter and setter methods.

      In the web-page, several properties are shown correctly. I like to be able to change them in a <h:form> and then submit the changes. But after pressing the submit-button, the collection stays as it is before at backend-side.

      Simplified JSF code:

           <h:dataTable id="flujoList" var="workflow"
                                    rendered="#{not empty tableContentProperties}"
                   <f:facet name="header"> Nombre del flujo </f:facet>
                   <f:facet name="header"> Form initial </f:facet>
                <h:selectOneMenu id="formInitial" value="Choose one"> 
                       <f:selectItems value="#{ProcessPropertiesManagement.allForms}" />
                   <f:facet name="header"> Tasks </f:facet>
                   <h:dataTable cellpadding="5" id="taskList" value="#{workflow.tasks}" var="singleTask" border="1" rendered="true">
                         <f:facet name="header"> Nombre </f:facet>
                         <f:facet name="header"> Critical   </f:facet>
                      <h:selectBooleanCheckbox id="newCritical"  value="#{singleTask.critical}" />       
            <h:commandButton action="#{ProcessPropertiesManagement.update}" value="Guardar" />
            <h:commandButton action="#{ProcessPropertiesManagement.end}" value="Cancelar" />

      So, lets say you change the value of the first combobox and then press the update-button. But in the backend update-method, all values are still the same.

      Maybe i do something wrong with the scopes? Or maybe i dont understand how the databinding works at all...

      Any hints plz?

      Thx in advance