jsf - Is there incompatibllity between dynamic UI inlcude and P:SelectOneMenu -
i have ui include have dynamic content , content loaded when press in command link. problem when press command link ui include loaded without javascript created primeface :
could problem related @resource dependency.
this controller:
@named @viewscoped public class test { private string value; private list<string> options=new arraylist<>(); private string url=""; public string changeurl(){ url="/snippets/test2.xhtml"; return "#"; } @postconstruct public void init(){ options.add("test 1"); options.add("test 2"); options.add("test 3"); options.add("test 4"); } //getter , setter
}
and xhtml page:
<h:form> text <ui:include src="#{test.url}" /> <p:commandlink action="#{test.changeurl()}" value="submit" process="@this" update="@form"/> </h:form>
and included page:
<ui:composition> <h:form> <p:selectonemenu value="#{test.value}"> <f:selectitems value="#{test.options}"/> </p:selectonemenu> </h:form> </ui:composition>
two problems here: ui:composition declaration in included page missing of required namespace declarations, , embedding form within form.
your included page should this:
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> <p:selectonemenu value="#{test.value}"> <f:selectitems value="#{test.options}"/> </p:selectonemenu> </ui:composition>
Comments
Post a Comment