h:commandLink generation
attonnnn May 3, 2007 11:53 AMHi !
I m new in Ajax4JSF and i m trying to set some h:panelgroup rendered one by one during some filtering steps.
Here is my specific problem :
I have the following link launching an ajax request :
<a4j:commandButton action="#{searchPatientManagedBean.searchPatient}" value="Recherche" reRender="searchPatient_panelGroup1"/>
the method called sets panel render to true, so the table get filled after the click :
<h:panelGroup id="searchPatient_panelGroup1"> <h:panelGroup rendered="#{searchPatientManagedBean.renderPanelResult}"> <h:dataTable value="#{searchPatientManagedBean.patients}" var="patient"> .... <h:column> <h:form> <h:commandLink action="#{searchPatientManagedBean.showPatient}"> <h:outputText value="Voir ce patient" /> <f:param name="patient" value="#{patient}"/> </h:commandLink> </h:form> </h:column> </h:dataTable> </h:panelGroup> </h:panelGroup> <a4j:log height="400" width="200" popup="false" level="ALL"/>
The problem occurs when the panelgroud is rendered : the values in the table are correctly populated, but the last form is followed by :
com.sun.faces.saveStateFieldMarker
Moreover, when i click on the links created, i get a javascript error :
curForm has no properties
clearFormHiddenParams__id28_0__id40("_id28:0:_id40")
This may be due to the fact that in a4jlog, some javascript is already evaluated during the rendering of my panel :
debug[17:11:51,402]: Evaluate script replaced area in document: // function clearFormHiddenParams__id28_0__id40(curFormName) { var curForm = document.forms[curFormName]; curForm.elements['patient'].value = null; curForm.elements['_id28:0:_id40:_idcl'].value = null; } // //
debug[17:11:51,402]: Evaluate script replaced area in document: // function clearFormHiddenParams__id28_1__id40(curFormName) { var curForm = document.forms[curFormName]; curForm.elements['patient'].value = null; curForm.elements['_id28:1:_id40:_idcl'].value = null; } // //
No errors nor warns happens, as server side.
If i refresh the page (f5) everything works like i wish, so i may have missed something to avoid this case
I had already implemented exactly the same page without ajax4jsf, and everyting worked successfully.
Any suggestion ?
Thanks