Reaching backingbean method in datatable column JSF/PrimeFaces -
i unable reach backing beans method when calling in <p:commandlink>
inside datatable column.
my commandlink works fine when put outside datatable, cannot directly pass selected row variable.
here code:
<h:form id="reviewlists" prependid="false"> <p:messages /> <p:panel header="beoordelingen" style="margin-bottom:10px;"> <p:datatable value="#{reviewfinderbean.employees}" var="employee" > <p:column headertext="medewerker" > <h:commandlink value="#{employee.name}" action="#{reviewfinderbean.showreviewsforemployee(employee)}" /> </p:column> </p:datatable> </p:panel> </h:form>
when checking http requests browser makes see post (ajax) expected, have tried use prependid="false" thaught generated component names might have been unresovable didnt help.
the ajax post fired somehow never resolved correct backingbean method on server
<f:setpropertyactionlistener>
doesnt resolve property when set correctly , used in the datatable column.
first of all, rid of prependid="false"
. makes things worse in ajax processing , updates.
in order fix problem, need rewrite bean in such way returns same data model (the value behind #{reviewfinderbean.employees}"
) during processing form submit during displaying form. jsf namely re-iterate on in order find associated row command been invoked.
if want keep bean in request scope, need recreate same datamodel in (post)constructor. if bean in view scope, need make sure getter method totally free of business logic data model don't potentially change.
Comments
Post a Comment