You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Brendan Conner (JIRA)" <my...@incubator.apache.org> on 2005/07/21 18:05:29 UTC

[jira] Created: (MYFACES-350) Use 'node.isLeaf()' in tree2 to decide whether to display the navigation icon

Use 'node.isLeaf()' in tree2 to decide whether to display the navigation icon
-----------------------------------------------------------------------------

         Key: MYFACES-350
         URL: http://issues.apache.org/jira/browse/MYFACES-350
     Project: MyFaces
        Type: Improvement
    Versions: Nightly Build    
 Environment: IBM RAS using MyFaces JSF implementation
    Reporter: Brendan Conner
    Priority: Minor


I would like to suggest the following 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() changed 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.

Currently, the workaround is to override the node's getChildCount() method to return the number of records *expected* if the user were to request the fetch.  However, the "expected" number of records is not always known, so, in these cases, getChildCount() would have to be coded to return an arbitrary number greater than zero, which is kind of a kluge.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-350) Use 'node.isLeaf()' in tree2 to decide whether to display the navigation icon

Posted by "sean schofield (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-350?page=comments#action_12317456 ] 

sean schofield commented on MYFACES-350:
----------------------------------------

OK this fix caused another problem (see related issue) so I made an additional change:

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

This should still solve the original problem without causing any new ones.

> Use 'node.isLeaf()' in tree2 to decide whether to display the navigation icon
> -----------------------------------------------------------------------------
>
>          Key: MYFACES-350
>          URL: http://issues.apache.org/jira/browse/MYFACES-350
>      Project: MyFaces
>         Type: Improvement
>     Versions: Nightly Build
>  Environment: IBM RAS using MyFaces JSF implementation
>     Reporter: Brendan Conner
>     Priority: Minor
>      Fix For: Nightly Build

>
> I would like to suggest the following 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() changed 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.
> Currently, the workaround is to override the node's getChildCount() method to return the number of records *expected* if the user were to request the fetch.  However, the "expected" number of records is not always known, so, in these cases, getChildCount() would have to be coded to return an arbitrary number greater than zero, which is kind of a kluge.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (MYFACES-350) Use 'node.isLeaf()' in tree2 to decide whether to display the navigation icon

Posted by "sean schofield (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-350?page=comments#action_12317568 ] 

sean schofield commented on MYFACES-350:
----------------------------------------

In order to address Brendan's concerns I changed this back  to just check node.isLeaf().  I did change the isLeaf() method TreeNodeBase to also return true if the child count was zero (regardless of the value of leaf.)  This way if someone adds something as a branch but then no children are added, it will be rendered like a leaf.

> Use 'node.isLeaf()' in tree2 to decide whether to display the navigation icon
> -----------------------------------------------------------------------------
>
>          Key: MYFACES-350
>          URL: http://issues.apache.org/jira/browse/MYFACES-350
>      Project: MyFaces
>         Type: Improvement
>     Versions: Nightly Build
>  Environment: IBM RAS using MyFaces JSF implementation
>     Reporter: Brendan Conner
>     Priority: Minor
>      Fix For: Nightly Build

>
> I would like to suggest the following 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() changed 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.
> Currently, the workaround is to override the node's getChildCount() method to return the number of records *expected* if the user were to request the fetch.  However, the "expected" number of records is not always known, so, in these cases, getChildCount() would have to be coded to return an arbitrary number greater than zero, which is kind of a kluge.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (MYFACES-350) Use 'node.isLeaf()' in tree2 to decide whether to display the navigation icon

Posted by "sean schofield (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-350?page=all ]
     
sean schofield closed MYFACES-350:
----------------------------------

    Fix Version: Nightly Build
     Resolution: Fixed

Good idea.  Sorry it took me so long to get around to it.

> Use 'node.isLeaf()' in tree2 to decide whether to display the navigation icon
> -----------------------------------------------------------------------------
>
>          Key: MYFACES-350
>          URL: http://issues.apache.org/jira/browse/MYFACES-350
>      Project: MyFaces
>         Type: Improvement
>     Versions: Nightly Build
>  Environment: IBM RAS using MyFaces JSF implementation
>     Reporter: Brendan Conner
>     Priority: Minor
>      Fix For: Nightly Build

>
> I would like to suggest the following 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() changed 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.
> Currently, the workaround is to override the node's getChildCount() method to return the number of records *expected* if the user were to request the fetch.  However, the "expected" number of records is not always known, so, in these cases, getChildCount() would have to be coded to return an arbitrary number greater than zero, which is kind of a kluge.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira