You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Briggs, John" <JB...@premierfarnell.com> on 2004/11/10 10:50:29 UTC

Modifying a Tree

I am building a tree using the MyFaces tree component which is built by
initialy loading the root node with two layer's of children below it. Upon
selecting the lowest level layer node I then add new children to the
selected node.
The tree is updating correctly as the selected node changes to have a folder
icon indicating that it has more levels below it, but the '+' doesn't appear
next to it unless I colapse and then expand the node containing the selected
node.
Has anyone any suggestions how to fix this ?
 
Thanks
John


***************************Disclaimer***************************

The contents of this e-mail and any file transmitted with it are confidential and intended solely for the individual or entity to whom they are addressed.  The content may also contain legal, professional or other privileged information. If you received this e-mail in error, please destroy it immediately.  You should not copy or use it for any purpose nor disclose its contents to any other person. The views stated herein do not necessarily represent the view of the Company.

Please ensure you have adequate virus protection before you open or detach any documents from this transmission. The Company does not accept any liability for  viruses.

Premier Farnell plc
150 Armley Road
Leeds
LS12 2QQ
Telephone +44 (0) 870 129 8608
Fax +44 (0) 870 129 8610

Registered in England
Company Number 876412
Registered Office: Farnell House, Forge Lane, Leeds LS12 2NE

************************************************************


Re: Modifying a Tree

Posted by xudong <xu...@aristoga.com>.
Hi,

I think we have the following ways to do it:

1) Why you initially load the root node with two layer's of children 
below it? I think you want to give users exact information about the 
first layer of children whether they have their own children. So you can 
use the same strategy recursively. Whenever you click a tree node of n 
level, you need to update its children with nodes of n+2 level.

2) You could initially load the root node with:
   - one layer's of children
    and
   -  dummy children for the first layer of children if they really have 
children. I mean you just get whether a tree node has its own children 
rather than the real children. when you click the tree node, you then 
get its children from server side.

I am wondering whether you can give me your source codes related to this 
question. I will be glad to change your codes directly. :=)

best wishes,
xudong

Briggs, John wrote:

> I am building a tree using the MyFaces tree component which is built 
> by initialy loading the root node with two layer's of children below 
> it. Upon selecting the lowest level layer node I then add new children 
> to the selected node.
> The tree is updating correctly as the selected node changes to have a 
> folder icon indicating that it has more levels below it, but the '+' 
> doesn't appear next to it unless I colapse and then expand the node 
> containing the selected node.
> Has anyone any suggestions how to fix this ?
>  
> Thanks
> John
>
>
> ***************************Disclaimer***************************
>
> The contents of this e-mail and any file transmitted with it are 
> confidential and intended solely for the individual or entity to whom 
> they are addressed. The content may also contain legal, professional 
> or other privileged information. If you received this e-mail in error, 
> please destroy it immediately. You should not copy or use it for any 
> purpose nor disclose its contents to any other person. The views 
> stated herein do not necessarily represent the view of the Company.
>
> Please ensure you have adequate virus protection before you open or 
> detach any documents from this transmission. The Company does not 
> accept any liability for viruses.
>
> Premier Farnell plc
> 150 Armley Road
> Leeds
> LS12 2QQ
> Telephone +44 (0) 870 129 8608
> Fax +44 (0) 870 129 8610
>
> Registered in England
> Company Number 876412
> Registered Office: Farnell House, Forge Lane, Leeds LS12 2NE
>
> ************************************************************



Re: problem with Scrollable Table

Posted by No Galz <an...@yahoo.com>.
Hii Birgit,

Thanks for your tip. It does work! 

I can see that the f:param doesn't work the way i
thought. But, f:param is used in the myfaces examples
and i just tried to make it run. 

Thanks for your help.
regards
fargo


--- Birgit Linner <bi...@ovsag.de> wrote:

> Hi!
> I am not sure, why your code is not working, I don't
> know, what your 
> outputText-part is doing.. I send you the code I use
> (and that is 
> working), perhaps you'll find some hints.
> 
> <x:dataScroller for="projektTabelle"
> id="dataScroller" 
> pageIndexVar="pageIndexVar"
> pageCountVar="pageCountVar">
>      <f:facet name="first"><h:outputText
> styleClass="dataScroller" 
> value="|<< Anfang"/></f:facet>
>      <f:facet name="previous"><h:outputText
> styleClass="dataScroller" 
> value="<< vorherige Seite"/></f:facet>
>      <f:facet name="next"><h:outputText
> styleClass="dataScroller" 
> value="n�chste Seite >>"/></f:facet>
>      <f:facet name="last"><h:outputText
> styleClass="dataScroller" 
> value="Ende >>|"/></f:facet>
>      <h:outputText value="Seite #{pageIndexVar} von
> #{pageCountVar}"/>
>   </x:dataScroller>
> 
> Best regards,
> Birgit
> 
> No Galz wrote:
> 
> >Hii,
> >
> >I am using the scrollable table functionality of
> >myfaces. I am able to get my datatable scrollable,
> but
> >the pageCount and pageIndex variable are missing in
> my
> >page. What could be the reason?? I m using the
> >following code..for getting the page variables...
> >
> >        <x:dataScroller 
> >           id="scroll_2" 
> >           for="employeesData" 
> >           pageCountVar="pageCount"  
> >           pageIndexVar="pageIndex">
> >           
> >          <h:outputFormat value="Pages" >
> >            <f:param value="#{pageIndex}" />
> >            <f:param value="#{pageCount}" />
> >          </h:outputFormat>
> >        </x:dataScroller>
> >
> >Do i need to set these variables in my bean..or it
> is
> >handled by the scroller component? Can someone
> help?
> >
> >Regards,
> >fargo
> >
> >
> >		
> >__________________________________ 
> >Do you Yahoo!? 
> >Check out the new Yahoo! Front Page. 
> >www.yahoo.com 
> > 
> >
> >
> >
> >
> >  
> >
> 
> 
> 



		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 


Re: problem with Scrollable Table

Posted by No Galz <an...@yahoo.com>.
Ohh...my stupidness. The resources file was having
problem. It does work with f:param too.

Sorry for my mistake.

regards
fargo
--- Birgit Linner <bi...@ovsag.de> wrote:

> Hi!
> I am not sure, why your code is not working, I don't
> know, what your 
> outputText-part is doing.. I send you the code I use
> (and that is 
> working), perhaps you'll find some hints.
> 
> <x:dataScroller for="projektTabelle"
> id="dataScroller" 
> pageIndexVar="pageIndexVar"
> pageCountVar="pageCountVar">
>      <f:facet name="first"><h:outputText
> styleClass="dataScroller" 
> value="|<< Anfang"/></f:facet>
>      <f:facet name="previous"><h:outputText
> styleClass="dataScroller" 
> value="<< vorherige Seite"/></f:facet>
>      <f:facet name="next"><h:outputText
> styleClass="dataScroller" 
> value="n�chste Seite >>"/></f:facet>
>      <f:facet name="last"><h:outputText
> styleClass="dataScroller" 
> value="Ende >>|"/></f:facet>
>      <h:outputText value="Seite #{pageIndexVar} von
> #{pageCountVar}"/>
>   </x:dataScroller>
> 
> Best regards,
> Birgit
> 
> No Galz wrote:
> 
> >Hii,
> >
> >I am using the scrollable table functionality of
> >myfaces. I am able to get my datatable scrollable,
> but
> >the pageCount and pageIndex variable are missing in
> my
> >page. What could be the reason?? I m using the
> >following code..for getting the page variables...
> >
> >        <x:dataScroller 
> >           id="scroll_2" 
> >           for="employeesData" 
> >           pageCountVar="pageCount"  
> >           pageIndexVar="pageIndex">
> >           
> >          <h:outputFormat value="Pages" >
> >            <f:param value="#{pageIndex}" />
> >            <f:param value="#{pageCount}" />
> >          </h:outputFormat>
> >        </x:dataScroller>
> >
> >Do i need to set these variables in my bean..or it
> is
> >handled by the scroller component? Can someone
> help?
> >
> >Regards,
> >fargo
> >
> >
> >		
> >__________________________________ 
> >Do you Yahoo!? 
> >Check out the new Yahoo! Front Page. 
> >www.yahoo.com 
> > 
> >
> >
> >
> >
> >  
> >
> 
> 
> 



		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 


Re: Tree Rendering question

Posted by No Galz <an...@yahoo.com>.
Hii,

My incomplete mail sent by mistake. My question is:

How i can define a default location for my icons??

In the example i have provided, my folder icon is not
rendered...where i m wrong?

Regards,
fargo


--- No Galz <an...@yahoo.com> wrote:

> Hii All,
> 
> In case of tree extension tag, how can one define
> the
> tree icon pictures? I used the following
> 
> <x:tree id="tree" 
>   value="#{treeModel}"
>   styleClass="tree"
>   nodeClass="treenode"
> selectedNodeClass="treenodeSelected"
> 						iconLine="/conf/images/tree/line.gif"
> 						iconNoline="/conf/images/tree/noline.gif"
> 						iconChild="/conf/images/tree/folder.png"
> 					
> iconChildFirst="/conf/images/tree/line_first.gif"
> 					
> iconChildMiddle="/conf/images/tree/line_middle.gif"
> 					
> iconChildLast="/conf/images/tree/line_last.gif"
> 						iconNodeOpen="/conf/images/tree/node_open.gif"
> 					
>
iconNodeOpenFirst="/conf/images/tree/node_open_first.gif"
> 					
>
iconNodeOpenMiddle="/conf/images/tree/node_open_middle.gif"
> 					
>
iconNodeOpenLast="/conf/images/tree/node_open_last.gif"
> 					
> iconNodeClose="/conf/images/tree/node_close.gif"
> 					
>
iconNodeCloseFirst="/conf/images/tree/node_close_first.gif"
> 					
>
iconNodeCloseMiddle="/conf/images/tree/node_close_middle.gif"
> 					
>
iconNodeCloseLast="/conf/images/tree/node_close_last.gif"
> 					
>                         expandRoot="true">
>                 </x:tree>
> 
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> Check out the new Yahoo! Front Page. 
> www.yahoo.com 
>  
> 
> 



		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 


Tree Rendering question

Posted by No Galz <an...@yahoo.com>.
Hii All,

In case of tree extension tag, how can one define the
tree icon pictures? I used the following

<x:tree id="tree" 
  value="#{treeModel}"
  styleClass="tree"
  nodeClass="treenode"
selectedNodeClass="treenodeSelected"
						iconLine="/conf/images/tree/line.gif"
						iconNoline="/conf/images/tree/noline.gif"
						iconChild="/conf/images/tree/folder.png"
					
iconChildFirst="/conf/images/tree/line_first.gif"
					
iconChildMiddle="/conf/images/tree/line_middle.gif"
						iconChildLast="/conf/images/tree/line_last.gif"
						iconNodeOpen="/conf/images/tree/node_open.gif"
					
iconNodeOpenFirst="/conf/images/tree/node_open_first.gif"
					
iconNodeOpenMiddle="/conf/images/tree/node_open_middle.gif"
					
iconNodeOpenLast="/conf/images/tree/node_open_last.gif"
						iconNodeClose="/conf/images/tree/node_close.gif"
					
iconNodeCloseFirst="/conf/images/tree/node_close_first.gif"
					
iconNodeCloseMiddle="/conf/images/tree/node_close_middle.gif"
					
iconNodeCloseLast="/conf/images/tree/node_close_last.gif"
					
                        expandRoot="true">
                </x:tree>



		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 


Re: problem with Scrollable Table

Posted by Birgit Linner <bi...@ovsag.de>.
Hi!
I am not sure, why your code is not working, I don't know, what your 
outputText-part is doing.. I send you the code I use (and that is 
working), perhaps you'll find some hints.

<x:dataScroller for="projektTabelle" id="dataScroller" 
pageIndexVar="pageIndexVar" pageCountVar="pageCountVar">
     <f:facet name="first"><h:outputText styleClass="dataScroller" 
value="|<< Anfang"/></f:facet>
     <f:facet name="previous"><h:outputText styleClass="dataScroller" 
value="<< vorherige Seite"/></f:facet>
     <f:facet name="next"><h:outputText styleClass="dataScroller" 
value="nächste Seite >>"/></f:facet>
     <f:facet name="last"><h:outputText styleClass="dataScroller" 
value="Ende >>|"/></f:facet>
     <h:outputText value="Seite #{pageIndexVar} von #{pageCountVar}"/>
  </x:dataScroller>

Best regards,
Birgit

No Galz wrote:

>Hii,
>
>I am using the scrollable table functionality of
>myfaces. I am able to get my datatable scrollable, but
>the pageCount and pageIndex variable are missing in my
>page. What could be the reason?? I m using the
>following code..for getting the page variables...
>
>        <x:dataScroller 
>           id="scroll_2" 
>           for="employeesData" 
>           pageCountVar="pageCount"  
>           pageIndexVar="pageIndex">
>           
>          <h:outputFormat value="Pages" >
>            <f:param value="#{pageIndex}" />
>            <f:param value="#{pageCount}" />
>          </h:outputFormat>
>        </x:dataScroller>
>
>Do i need to set these variables in my bean..or it is
>handled by the scroller component? Can someone help?
>
>Regards,
>fargo
>
>
>		
>__________________________________ 
>Do you Yahoo!? 
>Check out the new Yahoo! Front Page. 
>www.yahoo.com 
> 
>
>
>
>
>  
>



problem with Scrollable Table

Posted by No Galz <an...@yahoo.com>.
Hii,

I am using the scrollable table functionality of
myfaces. I am able to get my datatable scrollable, but
the pageCount and pageIndex variable are missing in my
page. What could be the reason?? I m using the
following code..for getting the page variables...

        <x:dataScroller 
           id="scroll_2" 
           for="employeesData" 
           pageCountVar="pageCount"  
           pageIndexVar="pageIndex">
           
          <h:outputFormat value="Pages" >
            <f:param value="#{pageIndex}" />
            <f:param value="#{pageCount}" />
          </h:outputFormat>
        </x:dataScroller>

Do i need to set these variables in my bean..or it is
handled by the scroller component? Can someone help?

Regards,
fargo


		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com