vendredi 5 juin 2015

How to use the selected employee in another bean to asses him-this employee?

I have this xhtml page with include SelectOneMenu to choose an employee to asses him in second <h:form>, but my attempts failed to do that, the employee id is always 0 in the tables i insert asses results in... I want to asses the same employee i've choosen in the selectMenu..

this is the code evaluation.xhtml

 <body>
     <h:form id="frmPerson" >          
         <h4>Please,select employee</h4>
         <h:selectOneMenu styleClass="" value="#{employee.selected}">  
            <f:selectItems value="#{employee.emp}" var="e" 
                            itemLabel="#{e.firstName}" itemValue="#{e.id}" /> 
         </h:selectOneMenu>
   </h:form>      

    <h:form>  
        <h:dataTable  value="#{logInBean.checkList}" var="check">
            <h:column headerClass="select">
                <h:commandButton value="add" actionListener="#{evaluationBean.increaseMark()}" > </h:commandButton>
             </h:column>
             <h:column headerClass="name" >
             <h:outputText value="#{check.elementName}"></h:outputText>
             </h:column>
             <h:column headerClass="mark">
             <h:outputText  value="#{check.elementMark}"></h:outputText>
             </h:column>          
        </h:dataTable>
         <center>
             <h:commandButton  value="save" actionListener="#{evaluationBean.inserToResult}" > 
              </h:commandButton> </center> 
    </h:form>
</body>

Aucun commentaire:

Enregistrer un commentaire