primefaces - jsf ajax rendered does not work -
i ask why partial rendering primefaces not work. post requests keeping sent, not rerender.
<?xml version='1.0' encoding='utf-8' ?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui"> <h:head> <title>facelet title</title> </h:head> <h:body> <p:messages /> <h:form> <table style="width: 100%"> <tr> <td><p:outputlabel for="inp1" value="s1" /></td> <td> <p:inputtext id="inp1" value="#{form.e.s1}"> <p:ajax process="inp1" update="msg1" event="keyup" /> </p:inputtext> <p:watermark for="inp1" value="wpisz s1" /> <p:message for="inp1" id="msg1" /> </td> </tr> <tr> <td>toolbox</td> <td> <p:selectbooleancheckbox id="inptoolbox" value="#{form.toolbox}"> <p:ajax process="inptoolbox" update="toolboxoptions" /> </p:selectbooleancheckbox><br /> <p:panel id="toolboxoptions" rendered="#{form.toolbox}"> name: <p:inputtext value="#{form.toolboxdescription}" /><br /> number: <p:inputtext value="#{form.toolboxnr}" /><br /> </p:panel> </td> </tr> </table> <p:commandbutton action="#{form.save}" ajax="false" value="save" /> </h:form> </h:body> </html>
i have no idea, why should not work. want every time changes toolbox value show additional information form toolbox
when update part of view have specify id of element present in dom. panel trying update not present in dom, in case form.toolbox evaluates true. when false cant updated , not added view. can solve problem is, wrap panel inside element , update element. work because wrapper-element present.
so try following part of panel:
<h:panelgroup id="toolboxoptions"> <p:panel id="toolboxoptionspanel" rendered="#{form.toolbox}"> .... </p:panel> </h:panelgroup>
have @ answer of following question further explanation: jsf + primefaces: `update` attribute not update component
Comments
Post a Comment