i am trying to use a both h:commandButton and p:commandButton (and h:/p:commandLink) inside a treenode in p:tree,
but it doesnt work.
test case:
Code: Select all
<p:tree value="#{testeNodeBean.storeMainNode}" var="pi" selectionMode="single"
selection="#{testeNodeBean.storeSelectedNode}" >
<p:treeNode>
<h:outputText value="#{..some info here..}" />
<!-- HERE DOESNT WORK!! -->
<p:commandButton ajax="false" action="#{testeNodeBean.test1()}" value="test" />
<p:commandButton ajax="false" actionListener="#{testeNodeBean.test2()}" value="test2" />
<h:commandLink action="#{testeNodeBean.test1()}">
<h:graphicImage library="images" name="ok.png" />
</h:commandLink>
</p:treeNode>
</p:tree>
<!-- HERE IT WORKS!! -->
<p:commandButton ajax="false" action="#{testeNodeBean.test1()}" value="test" />
<p:commandButton ajax="false" actionListener="#{testeNodeBean.test2()}" value="test2" />
<h:commandLink action="#{testeNodeBean.test1()}">
<h:graphicImage library="images" name="ok.png" />
</h:commandLink>
Code: Select all
@SessionScoped
@ManagedBean
public class TesteNodeBean {
private TreeNode storeMainNode;
private TreeNode storeSelectedNode;
public TesteNodeBean(){
storeMainNode = new DefaultTreeNode("ROOT",null);
//populate storeMainNode here...
}
public String test1(){
System.out.println("here!");
}
public void test2(){
System.out.println("here 2!");
return "";
}
// GETs and SETs here...
}
but to make the UI dynamic for the user, i would like a workaround for that =/
thanks in advance =]
EDIT:
my PrimeFaces version is: 3.0.RC2