I have a UI include that have a dynamic content , this content will be loaded when I press in a certain command link. the problem is when I press the command link the UI include is loaded without the Javascript created the PrimeFace:
could this problem be related to @Resource Dependency.
This my 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 and setter
}
and this the xhtml page:
<h:form>
text
<ui:include src="#{test.url}" />
<p:commandLink action="#{test.changeUrl()}" value="submit" process="@this" update="@form"/>
</h:form>
And this the included Page:
<ui:composition>
<h:form>
<p:selectOneMenu value="#{test.value}">
<f:selectItems value="#{test.options}"/>
</p:selectOneMenu>
</h:form>
</ui:composition>