You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Duong BaTien <du...@gmail.com> on 2005/04/14 17:51:12 UTC

Re: Tree2 extension

Hello Sean and the very active List:

First, thanks for the latest examples and a nice tree2 demo. I looked at 
tree2 source code and decided to leverage available codes of tree2 for 
tree rendering while using actionListener and action of the configurable 
commandLink to wire user selected node to backend processing.

For that purpose, i (1) have my own implementation of TreeNodeBase so i 
can have other properties as required. (2) access the HtmlTree and call 
toggleExpanded() to transmit user selected node to tree2 before doing my 
own backend processing under commandLink actionListener. Things work as 
expected thanks to Sean effort :-). However, there are some issues that 
i look for suggestions/solutions:

1) In the example, the commandLink wraps over the folder graphic and the 
node description while the nav-plus and nav-minux are handled by the 
tree2. The result is that a click on nav-plus and nav-minus on my 
implementation does not do anything. I look at the example of the 
server-side tree, nav-plus and nav-minus do response. So, i prabably 
miss something from tree2 htmlTree besides the toggleExpanded(). Any 
other setting and/or method i need to activate from htmlTree when user 
selects a node? (i enclose my tree2 setting for your reference).

2) Is there any way to just display the level below the root and NOT to 
display the root as default display? This will save user 1 click and 
premium space on a web page.

3) Currently, the TreeBackend.java harcodes the treeData. Is there any 
thought (1) to use IoC configuration to set the treeData content for the 
default and (2) the content will be updated from the database and make 
tree2 immediately responses to the new content?

Thanks

BaTien
DBGROUPS


Re: Tree2 extension

Posted by Duong BaTien <du...@gmail.com>.
Sean Schofield wrote:

>>1) In the example, the commandLink wraps over the folder graphic and the
>>node description while the nav-plus and nav-minux are handled by the
>>tree2. The result is that a click on nav-plus and nav-minus on my
>>implementation does not do anything. I look at the example of the
>>server-side tree, nav-plus and nav-minus do response. So, i prabably
>>miss something from tree2 htmlTree besides the toggleExpanded(). Any
>>other setting and/or method i need to activate from htmlTree when user
>>selects a node? (i enclose my tree2 setting for your reference).
>>    
>>
>
>This is a known limitation.  We're working on coming up with a
>solution that would work for *both* client and server-side toggle.
>  
>
Please announce when a solution is ready.

> 
>  
>
>>2) Is there any way to just display the level below the root and NOT to
>>display the root as default display? This will save user 1 click and
>>premium space on a web page.
>>    
>>
>
>Yes.  Use showRootNode=false.  That will be more obvious once we have
>some documentation in place. :-)
>
>  
>
Excellent. It works :-) This means tree2 can now be a part of a very 
sophisticated page similar to a multi-level marketing report, shown in 
the list to request features from tree2.

>>3) Currently, the TreeBackend.java harcodes the treeData. Is there any
>>thought (1) to use IoC configuration to set the treeData content for the
>>default and (2) the content will be updated from the database and make
>>tree2 immediately responses to the new content?
>>    
>>
>
>I would defnitely not hardcode the data in a real application.  There
>are a variety of mechanisms for updating the data but its not
>something specific to tree2.  Think dataTable and apply the same
>solution to tree2.  As for refreshing with new data that will happen
>during renderResponse (same as a dataTable.)  There is no way to
>"push" the new tree obviously because we're talking HTML which is a
>request/response model.
>  
>
Following is our solution. I look for comments/suggestions from others, 
especially from Craig. Hope this may help others as well.

There is a report somewhere about the limitation of Jsf lifecycle to 
reload the content of its backing beans in session scope. One suggested 
solution is to programmatically delete the backing bean and reload it 
with new content. I do not use this approach.

Rather, i use Struts-Shale DialogController as backing bean and 
ViewController to control the initial state of the DialogController. In 
this way, the same DialogController will be able to serve different 
contents from ViewController. A good thing is that i am able to 
implement this mechanism as nested tabs using current myfaces tiles 
viewHandler :-).

BaTien
DBGROUPS

>HTH,
>sean
>
>  
>
>>BaTien
>>
>
>
>  
>


Re: Tree2 extension

Posted by Sean Schofield <se...@gmail.com>.
> 1) In the example, the commandLink wraps over the folder graphic and the
> node description while the nav-plus and nav-minux are handled by the
> tree2. The result is that a click on nav-plus and nav-minus on my
> implementation does not do anything. I look at the example of the
> server-side tree, nav-plus and nav-minus do response. So, i prabably
> miss something from tree2 htmlTree besides the toggleExpanded(). Any
> other setting and/or method i need to activate from htmlTree when user
> selects a node? (i enclose my tree2 setting for your reference).

This is a known limitation.  We're working on coming up with a
solution that would work for *both* client and server-side toggle.
 
> 2) Is there any way to just display the level below the root and NOT to
> display the root as default display? This will save user 1 click and
> premium space on a web page.

Yes.  Use showRootNode=false.  That will be more obvious once we have
some documentation in place. :-)

> 3) Currently, the TreeBackend.java harcodes the treeData. Is there any
> thought (1) to use IoC configuration to set the treeData content for the
> default and (2) the content will be updated from the database and make
> tree2 immediately responses to the new content?

I would defnitely not hardcode the data in a real application.  There
are a variety of mechanisms for updating the data but its not
something specific to tree2.  Think dataTable and apply the same
solution to tree2.  As for refreshing with new data that will happen
during renderResponse (same as a dataTable.)  There is no way to
"push" the new tree obviously because we're talking HTML which is a
request/response model.

HTH,
sean

> BaTien