> This component has a default initial state of collapsed. Is it possible to
> have an initial state of expanded.
Search the archives for some earlier discussions regarding this.
There is interest in a solution but it will require some help from
users who are willing to put in a little bit of time to help with the
solution. So far nobody has offered to assist.
> Also what is a possible solution to
> keeping it always expanded? I tried extending this component, and doing
> something like:
>
>
>
> public class HtmlTreeExpanded extends HtmlTree
>
> {
>
> // stores initial state
>
> private boolean initial = true;
>
>
>
> public boolean isNodeExpanded()
>
> {
>
> if (!super.isNodeExpanded()){
>
> if (initial){
>
> toggleExpanded();
>
> initial = false;
>
> }
>
> }
>
> return super.isNodeExpanded();
>
> }
>
>
>
>
>
> }
If you always want the node to be expanded why not just have
isNodeExpanded return true?
Also, you seem to be trying to toggle the expanded state in
isNodeExpanded. That sounds like a recipe for trouble ;-) This
method is used to *check* if the node is expanded or not. You don't
know how many times or what will prompt this check. isNodeExpanded is
essentially a "getter" method. If you decide to override a getter
method and have it do "setter" stuff you are doing so at your own
risk.
[snip]
> Rahul Pilani
sean