You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Mihir Solanki <mi...@patni.com> on 2005/04/13 10:11:56 UTC

Multiple time method is executing for tree2

Hi all,

 

I am having a tree2 component (only one component) in my JSF page.

 

<h:panelGrid id="grid2" columns="1" border="0" cellpadding="1"
cellspacing="1" align="left">

<x:tree2 value="#{TreeBean.treeData}" id="cabinet-tree" var="node"
varNodeToggler="t" clientSideToggle="false">

<f:facet name="folder">

<h:commandLink immediate="true" action="#{t.toggleExpanded}"
actionListener="#{CabinetTree.processAction}">

<h:graphicImage value="/images/blue-folder-open.png"
rendered="#{t.nodeExpanded}" border="0"/>

<h:graphicImage value="/images/blue-folder-closed.png"
rendered="#{!t.nodeExpanded}" border="0"/>

<h:outputText value="#{node.description}" styleClass="nodeTree"/>

<h:outputText value=" (#{node.childCount})" styleClass="childCount"
rendered="#{!empty node.children}"/>

</h:commandLink>

</f:facet>

</x:tree2>

</h:panelGrid>

 

Now when I load this page, I have noticed that the "getTreeData" method of
"TreeBean" is called two times. Further whenever I click on the tree node
(or navigation icons), the same methods gets called three times.

 

Can anybody tell me what is happening behind the scenes? Why this method is
called multiple times?

 

Mihir

 

  _____  

Patni Computer Systems Ltd.

Tel : 91 79 23240905 Ext : 413

 


http://www.patni.com
World-Wide Partnerships. World-Class Solutions.
_____________________________________________________________________

This e-mail message may contain proprietary, confidential or legally
privileged information for the sole use of the person or entity to
whom this message was originally addressed. Any review, e-transmission
dissemination or other use of or taking of any action in reliance upon
this information by persons or entities other than the intended
recipient is prohibited. If you have received this e-mail in error
kindly delete  this e-mail from your records. If it appears that this
mail has been forwarded to you without proper authority, please notify
us immediately at netadmin@patni.com and delete this mail. 
_____________________________________________________________________

Re: Multiple time method is executing for tree2

Posted by Enrique Medina <e....@gmail.com>.
Hi again,

I cannot assure if I don't have your code with me, but you can try
putting a breakpoint into the getTreeData method of your bean, and
then see on the Debug window who is calling it (see whether it is the
render, the update model, etc.).

Obviously you need the source code, but that's a minor issue ;-)

On 4/13/05, Mihir Solanki <mi...@patni.com> wrote:
> Enrique,
> 
> As per your suggestion I have gone through the JSF request processing life
> cycle.
> 
> But still I am not 100% clear on the things. Could you please give me some
> idea that during which phases the backing beans method will be called and
> why?
> 
> Mihir
> 
> -----Original Message-----
> From: Enrique Medina [mailto:e.medina.m@gmail.com]
> Sent: Wednesday, April 13, 2005 1:46 PM
> To: MyFaces Discussion; mihir.solanki@patni.com
> Subject: Re: Multiple time method is executing for tree2
> 
> Take a look at the JSF LifeCycle and you'll understand ;-)
> 
> On 4/13/05, Mihir Solanki <mi...@patni.com> wrote:
> >
> >
> >
> > Hi all,
> >
> >
> >
> > I am having a tree2 component (only one component) in my JSF page.
> >
> >
> >
> > <h:panelGrid id="grid2" columns="1" border="0" cellpadding="1"
> > cellspacing="1" align="left">
> >
> > <x:tree2 value="#{TreeBean.treeData}" id="cabinet-tree" var="node"
> > varNodeToggler="t" clientSideToggle="false">
> >
> > <f:facet name="folder">
> >
> > <h:commandLink immediate="true" action="#{t.toggleExpanded}"
> > actionListener="#{CabinetTree.processAction}">
> >
> > <h:graphicImage value="/images/blue-folder-open.png"
> > rendered="#{t.nodeExpanded}" border="0"/>
> >
> > <h:graphicImage value="/images/blue-folder-closed.png"
> > rendered="#{!t.nodeExpanded}" border="0"/>
> >
> > <h:outputText value="#{node.description}" styleClass="nodeTree"/>
> >
> > <h:outputText value=" (#{node.childCount})" styleClass="childCount"
> > rendered="#{!empty node.children}"/>
> >
> > </h:commandLink>
> >
> > </f:facet>
> >
> > </x:tree2>
> >
> > </h:panelGrid>
> >
> >
> >
> > Now when I load this page, I have noticed that the "getTreeData" method of
> > "TreeBean" is called two times. Further whenever I click on the tree node
> > (or navigation icons), the same methods gets called three times.
> >
> >
> >
> > Can anybody tell me what is happening behind the scenes? Why this method
> is
> > called multiple times?
> >
> >
> >
> > Mihir
> >
> >
> >  ________________________________
> >
> >
> >
> > Patni Computer Systems Ltd.
> >
> >
> > Tel : 91 79 23240905 Ext : 413
> >
> >
> > http://www.patni.com
> >  World-Wide Partnerships. World-Class Solutions.
> > _____________________________________________________________________
> >
> >  This e-mail message may contain proprietary, confidential or legally
> > privileged information for the sole use of the person or entity to whom
> this
> > message was originally addressed. Any review, e-transmission dissemination
> > or other use of or taking of any action in reliance upon this information
> by
> > persons or entities other than the intended recipient is prohibited. If
> you
> > have received this e-mail in error kindly delete this e-mail from your
> > records. If it appears that this mail has been forwarded to you without
> > proper authority, please notify us immediately at netadmin@patni.com and
> > delete this mail.
> > _____________________________________________________________________
> 
> http://www.patni.com
> World-Wide Partnerships. World-Class Solutions.
> _____________________________________________________________________
> 
> This e-mail message may contain proprietary, confidential or legally
> privileged information for the sole use of the person or entity to
> whom this message was originally addressed. Any review, e-transmission
> dissemination or other use of or taking of any action in reliance upon
> this information by persons or entities other than the intended
> recipient is prohibited. If you have received this e-mail in error
> kindly delete  this e-mail from your records. If it appears that this
> mail has been forwarded to you without proper authority, please notify
> us immediately at netadmin@patni.com and delete this mail.
> _____________________________________________________________________
> 
>

RE: Multiple time method is executing for tree2

Posted by Mihir Solanki <mi...@patni.com>.
Enrique,

As per your suggestion I have gone through the JSF request processing life
cycle.

But still I am not 100% clear on the things. Could you please give me some
idea that during which phases the backing beans method will be called and
why?

Mihir

-----Original Message-----
From: Enrique Medina [mailto:e.medina.m@gmail.com] 
Sent: Wednesday, April 13, 2005 1:46 PM
To: MyFaces Discussion; mihir.solanki@patni.com
Subject: Re: Multiple time method is executing for tree2

Take a look at the JSF LifeCycle and you'll understand ;-)

On 4/13/05, Mihir Solanki <mi...@patni.com> wrote:
>  
>  
> 
> Hi all, 
> 
>   
> 
> I am having a tree2 component (only one component) in my JSF page. 
> 
>   
> 
> <h:panelGrid id="grid2" columns="1" border="0" cellpadding="1"
> cellspacing="1" align="left"> 
> 
> <x:tree2 value="#{TreeBean.treeData}" id="cabinet-tree" var="node"
> varNodeToggler="t" clientSideToggle="false"> 
> 
> <f:facet name="folder"> 
> 
> <h:commandLink immediate="true" action="#{t.toggleExpanded}"
> actionListener="#{CabinetTree.processAction}"> 
> 
> <h:graphicImage value="/images/blue-folder-open.png"
> rendered="#{t.nodeExpanded}" border="0"/> 
> 
> <h:graphicImage value="/images/blue-folder-closed.png"
> rendered="#{!t.nodeExpanded}" border="0"/> 
> 
> <h:outputText value="#{node.description}" styleClass="nodeTree"/> 
> 
> <h:outputText value=" (#{node.childCount})" styleClass="childCount"
> rendered="#{!empty node.children}"/> 
> 
> </h:commandLink> 
> 
> </f:facet> 
> 
> </x:tree2> 
> 
> </h:panelGrid> 
> 
>   
> 
> Now when I load this page, I have noticed that the "getTreeData" method of
> "TreeBean" is called two times. Further whenever I click on the tree node
> (or navigation icons), the same methods gets called three times. 
> 
>   
> 
> Can anybody tell me what is happening behind the scenes? Why this method
is
> called multiple times? 
> 
>   
> 
> Mihir 
> 
>   
>  ________________________________
>  
>  
> 
> Patni Computer Systems Ltd. 
>  
> 
> Tel : 91 79 23240905 Ext : 413 
> 
>   
> http://www.patni.com
>  World-Wide Partnerships. World-Class Solutions. 
> _____________________________________________________________________
>  
>  This e-mail message may contain proprietary, confidential or legally
> privileged information for the sole use of the person or entity to whom
this
> message was originally addressed. Any review, e-transmission dissemination
> or other use of or taking of any action in reliance upon this information
by
> persons or entities other than the intended recipient is prohibited. If
you
> have received this e-mail in error kindly delete this e-mail from your
> records. If it appears that this mail has been forwarded to you without
> proper authority, please notify us immediately at netadmin@patni.com and
> delete this mail. 
> _____________________________________________________________________



http://www.patni.com
World-Wide Partnerships. World-Class Solutions.
_____________________________________________________________________

This e-mail message may contain proprietary, confidential or legally
privileged information for the sole use of the person or entity to
whom this message was originally addressed. Any review, e-transmission
dissemination or other use of or taking of any action in reliance upon
this information by persons or entities other than the intended
recipient is prohibited. If you have received this e-mail in error
kindly delete  this e-mail from your records. If it appears that this
mail has been forwarded to you without proper authority, please notify
us immediately at netadmin@patni.com and delete this mail. 
_____________________________________________________________________

Re: Multiple time method is executing for tree2

Posted by Enrique Medina <e....@gmail.com>.
Take a look at the JSF LifeCycle and you'll understand ;-)

On 4/13/05, Mihir Solanki <mi...@patni.com> wrote:
>  
>  
> 
> Hi all, 
> 
>   
> 
> I am having a tree2 component (only one component) in my JSF page. 
> 
>   
> 
> <h:panelGrid id="grid2" columns="1" border="0" cellpadding="1"
> cellspacing="1" align="left"> 
> 
> <x:tree2 value="#{TreeBean.treeData}" id="cabinet-tree" var="node"
> varNodeToggler="t" clientSideToggle="false"> 
> 
> <f:facet name="folder"> 
> 
> <h:commandLink immediate="true" action="#{t.toggleExpanded}"
> actionListener="#{CabinetTree.processAction}"> 
> 
> <h:graphicImage value="/images/blue-folder-open.png"
> rendered="#{t.nodeExpanded}" border="0"/> 
> 
> <h:graphicImage value="/images/blue-folder-closed.png"
> rendered="#{!t.nodeExpanded}" border="0"/> 
> 
> <h:outputText value="#{node.description}" styleClass="nodeTree"/> 
> 
> <h:outputText value=" (#{node.childCount})" styleClass="childCount"
> rendered="#{!empty node.children}"/> 
> 
> </h:commandLink> 
> 
> </f:facet> 
> 
> </x:tree2> 
> 
> </h:panelGrid> 
> 
>   
> 
> Now when I load this page, I have noticed that the "getTreeData" method of
> "TreeBean" is called two times. Further whenever I click on the tree node
> (or navigation icons), the same methods gets called three times. 
> 
>   
> 
> Can anybody tell me what is happening behind the scenes? Why this method is
> called multiple times? 
> 
>   
> 
> Mihir 
> 
>   
>  ________________________________
>  
>  
> 
> Patni Computer Systems Ltd. 
>  
> 
> Tel : 91 79 23240905 Ext : 413 
> 
>   
> http://www.patni.com
>  World-Wide Partnerships. World-Class Solutions. 
> _____________________________________________________________________
>  
>  This e-mail message may contain proprietary, confidential or legally
> privileged information for the sole use of the person or entity to whom this
> message was originally addressed. Any review, e-transmission dissemination
> or other use of or taking of any action in reliance upon this information by
> persons or entities other than the intended recipient is prohibited. If you
> have received this e-mail in error kindly delete this e-mail from your
> records. If it appears that this mail has been forwarded to you without
> proper authority, please notify us immediately at netadmin@patni.com and
> delete this mail. 
> _____________________________________________________________________