Page 1 of 1

p:tree, unselect, bug or that's the way it should work?

Posted: 23 Dec 2011, 10:45
by 3man

Code: Select all

<h:form id="form">  
    <p:tree value="#{treeBean.root}" var="node" dynamic="true" cache="false"  
            selectionMode="checkbox"  selection="#{treeBean.selectedNode}"  
  
        <p:ajax event="select" listener="#{treeBean.onNodeSelect}" />  
        <p:ajax event="unselect" listener="#{treeBean.onNodeUnselect}" />  
  
        <p:treeNode>  
            <h:outputText value="#{node}" />  
        </p:treeNode>  
    </p:tree>  
  
</h:form> 
Problem:
onNodeSelect - work
onNodeUnselect - doesn't work !!!

Question:
Is it 'unselect' event supported for tree with selectionMode="checkbox"?

Re: Is this is bug or that's the way it should work?

Posted: 23 Dec 2011, 10:53
by cagatay.civici

Re: Is this is bug or that's the way it should work?

Posted: 23 Dec 2011, 10:54
by kukeltje
Optimus is right and can you please use more descriptive subject next time

Re: Is this is bug or that's the way it should work?

Posted: 23 Dec 2011, 11:00
by 3man
optimus.prime wrote:Maybe a search before posting?

viewtopic.php?f=3&t=16773&p=50997&hilit=unselect#p50997
this topic is about selectionMode="single", am I right?

I also try with metakey pressed .. with selectionMode="single" it is work, with selectionMode="checkbox" it doesn't.

Sorry about Subject, I change it ..

Re: p:tree, unselect, bug or that's the way it should work?

Posted: 23 Dec 2011, 12:57
by 3man
So, is it a bug, should I create issue?

Re: p:tree, unselect, bug or that's the way it should work?

Posted: 23 Dec 2011, 13:32
by 3man
I look response with firebug and I see that there is en error with with my code in bean actionevent metod

I use 'NodeSelectEvent'

Code: Select all

    public void onNodeUnselect(NodeSelectEvent event) {  ...   }
instead 'NodeUnselectEvent'

Code: Select all

    public void onNodeUnselect(NodeUnselectEvent event) {  ...   }
thanks anyway for quick response!

Re: p:tree, unselect, bug or that's the way it should work?

Posted: 23 Dec 2011, 16:54
by KingdomHeart
the p:tree with selectionMode="checkbox" work for me. Sorry, but I dont think this is a bug. However I am using RC1, not sure about RC2. I do not see the RC2 jar file on the website

Re: p:tree, unselect, bug or that's the way it should work?

Posted: 23 Dec 2011, 18:04
by 3man
@KingdomHeart
I already answered to this post ..

thanks anyway
3man wrote:I look response with firebug and I see that there is en error with with my code in bean actionevent metod

I use 'NodeSelectEvent'

Code: Select all

    public void onNodeUnselect(NodeSelectEvent event) {  ...   }
instead 'NodeUnselectEvent'

Code: Select all

    public void onNodeUnselect(NodeUnselectEvent event) {  ...   }
thanks anyway for quick response!