[prev in list] [next in list] [prev in thread] [next in thread] 

List:       myfaces-user
Subject:    RE: Suggested Enhancement to Tree2
From:       "CONNER, BRENDAN \(SBCSI\)" <bc1378 () sbc ! com>
Date:       2005-06-30 16:28:30
Message-ID: 67538F65C12991418BE2801290008A07C25A37 () ilnort1msgusr15 ! ITServices ! sbc ! com
[Download RAW message or body]

The thing I don't like about using getChildCount(), rather than
isLeaf(), is that the application developer may not have a way of
knowing how many children are yet to be fetched, so the getChildCount()
method may have to be coded using a bogus number greater than zero, just
to force the + sign to be displayed, which is kind of a kluge.

OK, I'll stop answering my own postings now and see if others have an
opinion on the topic.  Sorry I had to miss JavaOne this year (after
having attended the previous two years), since I would like to have met
the people involved with MyFaces.  Maybe next year!

- Brendan

-----Original Message-----
From: CONNER, BRENDAN (SBCSI) 
Sent: Thursday, June 30, 2005 11:18 AM
To: 'MyFaces Discussion'; 'Sean Schofield'
Subject: RE: Suggested Enhancement to Tree2


Or, maybe the application developer could code the getChildCount()
method to return the number of records *expected* if the user were to
request the fetch.  That could be done without changing the Tree2
component's implementation itself.

Is there a semantic difference between node.getChildCount() == 0 and
isLeaf() that others are relying upon?

- Brendan

-----Original Message-----
From: CONNER, BRENDAN (SBCSI) 
Sent: Thursday, June 30, 2005 10:56 AM
To: 'MyFaces Discussion'; 'Sean Schofield'
Subject: Suggested Enhancement to Tree2


I would like to make the following suggested enhancement to Tree2 that
would make it more amenable to grabbing data "on the fly" as the user is
expanding nodes.  Here's the problem:

Currently, Tree2 does not display the + navigation icon if the number of
child nodes is zero, regardless of whether there are children yet to be
fetched.  What I'd like to have happen is that the + navigation icon is
displayed only if the node is not a leaf node, regardless of whether
there are currently child nodes.

In other words, I would like to have the following line in
HtmlRenderer.encodeNavigation() from:

        bitMask += (node.getChildCount()>0) ? CHILDREN : NOTHING;

to:

        bitMask += (node.isLeaf) ? CHILDREN : NOTHING;

If we make this change, then the application developer has more control
over whether the + navigation symbol appears, since the application
developer can override the isLeaf() method in the node itself.

Let me know what you think....

- Brendan

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic