jsf 2 - Why does the ajax event not fire? -



jsf 2 - Why does the ajax event not fire? -

i've got primeface tree in application. tried load info att 1 time it jsut much 2500 object, used. tried implement som sort of lazy loading. first level loaded on start , load neccessary info when expanding node. googled examples , modified purpose. in case ajax not fire. missing here?

the xhtml part

<h:form> <p:panel id="add_elev2list" header="lägg till elev" collapsed="true" toggleable="true"> <p:tree value="#{bookb.root}" var="node" dynamic="true" > <p:ajax event="select" update="@this" listener="#{bookb.onnodeselect}"/> <p:treenode > <h:outputtext value="#{node}" /> </p:treenode> </p:tree> </p:panel> </h:form>

before loading first level of tree build

public void triggertreebuild() { root = new defaulttreenode("root", null); objectcontainer localdb = dbconnector.conndb(); objectset<sbasuserlist> res; query query = localdb.query(); query.constrain(sbasuserlist.class); //query.descend("klass").constrain(true); res = query.execute(); for(sbasuserlist sbu : res ){ if(sbu.isklass()) { treenode node0 = new defaulttreenode(sbu.getgroupname(), root); node0.getchildren().add(new defaulttreenode("head")); } } localdb.close(); }

which works fine. ajax event should trigger don't happen.

public void onnodeselect(nodeselectevent nee){ log("expand"); //wrapper system.out.println ... sort of debugging. sbasuserlist sbu = (sbasuserlist) nee.gettreenode().getdata(); string[] allstd = sbu.getallusers().split(","); objectcontainer localdb = dbconnector.conndb(); for(string persnum : allstd){ nee.gettreenode().getchildren().add( new defaulttreenode( getuserbypersnum(localdb,persnum).getrealname())); } localdb.close(); }

any thought why?

best regards ralf

using tomcat 7.0.52 jsf 2.2 , primefaces 4.0

due did not set attribute selectionmode="single".

<p:tree value="#{treebasicview.root}" var="node" dynamic="true" selectionmode="single"> <p:ajax event="select" listener="#{treebasicview.onnodeselect}" /> <p:treenode> <h:outputtext value="#{node}" /> </p:treenode> </p:tree>

ajax jsf-2 primefaces

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -