You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Geoff Callender (Created) (JIRA)" <ji...@apache.org> on 2012/04/20 12:02:40 UTC

[jira] [Created] (TAP5-1911) Tree leaf is still not selectable

Tree leaf is still not selectable
---------------------------------

                 Key: TAP5-1911
                 URL: https://issues.apache.org/jira/browse/TAP5-1911
             Project: Tapestry 5
          Issue Type: Bug
    Affects Versions: 5.3.2, 5.3.1
            Reporter: Geoff Callender


I can't make a tree leaf selectable. When I click on a leaf there's a javascript error in tree.js:

    function doAnimate(element) {
        var sublist = $(element).up('li').down("ul");

        var dim = sublist.getDimensions();
tree.js:52TypeError: 'undefined' is not an object (evaluating 'sublist.getDimensions')

        var duration = Math.min(dim.height * cfg.ANIMATION_RATE,
            cfg.MAX_ANIMATION_DURATION)

        new Effect.toggle(sublist, cfg.TOGGLE_TYPE, {
            duration : duration,
            queue : {
                position : 'end',
                scope : cfg.QUEUE_NAME
            }
        });
    }

It (sublist) is undefined because I clicked on 'tree_1', which has an 'li' up from it but no 'ul' down from there:

<li>
	<span id="tree_1" class="t-tree-icon t-leaf-node t-tree-expanded"></span>
	<span class="t-tree-label t-selectable">
	    100 Philosophy	
	</span>
</li>

I saw in TAP5-1629 that I have to provide a TreeSelectionModel if I want it to be selectable, and that is what I had done:

        <t:tree t:id="tree" t:model="treeModel" t:selectionModel="selectionModel"/>

	public TreeSelectionModel<CategoryNode> getSelectionModel() {
		if (selectionModel == null) {
			selectionModel = new DefaultTreeSelectionModel<CategoryNode>();
		}
		return selectionModel;
	}



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (TAP5-1911) Tree leaf is still not selectable

Posted by "Geoff Callender (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258849#comment-13258849 ] 

Geoff Callender edited comment on TAP5-1911 at 4/21/12 1:20 PM:
----------------------------------------------------------------

I didn't realise you can click on the leaf's label! That works fine. The javascript error occurs when you click on the leaf's icon.

Regardless, I still don't get how to make use of this component. It sends an Ajax request when you select or unselect a node, yet it ignores the response. I expected it to respond to a returned zone or a page.

So this issue represents (a) a bug and (b) either a request for more functionality or, if the functionality is already there, documentation on how to use it.

This is important to me because I'm trying to develop a decent example to put in JumpStart.

Cheers,

Geoff
                
      was (Author: geoffcallender):
    I didn't realise you can click on the leaf's label! That works fine. The javascript error occurs when you click on the leaf's icon.
                  
> Tree leaf is still not selectable
> ---------------------------------
>
>                 Key: TAP5-1911
>                 URL: https://issues.apache.org/jira/browse/TAP5-1911
>             Project: Tapestry 5
>          Issue Type: Bug
>    Affects Versions: 5.3.1, 5.3.2
>            Reporter: Geoff Callender
>
> I can't make a tree leaf selectable. When I click on a leaf there's a javascript error in tree.js:
>     function doAnimate(element) {
>         var sublist = $(element).up('li').down("ul");
>         var dim = sublist.getDimensions();
> tree.js:52TypeError: 'undefined' is not an object (evaluating 'sublist.getDimensions')
>         var duration = Math.min(dim.height * cfg.ANIMATION_RATE,
>             cfg.MAX_ANIMATION_DURATION)
>         new Effect.toggle(sublist, cfg.TOGGLE_TYPE, {
>             duration : duration,
>             queue : {
>                 position : 'end',
>                 scope : cfg.QUEUE_NAME
>             }
>         });
>     }
> It (sublist) is undefined because I clicked on 'tree_1', which has an 'li' up from it but no 'ul' down from there:
> <li>
> 	<span id="tree_1" class="t-tree-icon t-leaf-node t-tree-expanded"></span>
> 	<span class="t-tree-label t-selectable">
> 	    100 Philosophy	
> 	</span>
> </li>
> I saw in TAP5-1629 that I have to provide a TreeSelectionModel if I want it to be selectable, and that is what I had done:
>         <t:tree t:id="tree" t:model="treeModel" t:selectionModel="selectionModel"/>
> 	public TreeSelectionModel<CategoryNode> getSelectionModel() {
> 		if (selectionModel == null) {
> 			selectionModel = new DefaultTreeSelectionModel<CategoryNode>();
> 		}
> 		return selectionModel;
> 	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1911) Tree leaf is still not selectable

Posted by "Geoff Callender (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258849#comment-13258849 ] 

Geoff Callender commented on TAP5-1911:
---------------------------------------

I didn't realise you can click on the leaf's label! That works fine. The javascript error occurs when you click on the leaf's icon.
                
> Tree leaf is still not selectable
> ---------------------------------
>
>                 Key: TAP5-1911
>                 URL: https://issues.apache.org/jira/browse/TAP5-1911
>             Project: Tapestry 5
>          Issue Type: Bug
>    Affects Versions: 5.3.1, 5.3.2
>            Reporter: Geoff Callender
>
> I can't make a tree leaf selectable. When I click on a leaf there's a javascript error in tree.js:
>     function doAnimate(element) {
>         var sublist = $(element).up('li').down("ul");
>         var dim = sublist.getDimensions();
> tree.js:52TypeError: 'undefined' is not an object (evaluating 'sublist.getDimensions')
>         var duration = Math.min(dim.height * cfg.ANIMATION_RATE,
>             cfg.MAX_ANIMATION_DURATION)
>         new Effect.toggle(sublist, cfg.TOGGLE_TYPE, {
>             duration : duration,
>             queue : {
>                 position : 'end',
>                 scope : cfg.QUEUE_NAME
>             }
>         });
>     }
> It (sublist) is undefined because I clicked on 'tree_1', which has an 'li' up from it but no 'ul' down from there:
> <li>
> 	<span id="tree_1" class="t-tree-icon t-leaf-node t-tree-expanded"></span>
> 	<span class="t-tree-label t-selectable">
> 	    100 Philosophy	
> 	</span>
> </li>
> I saw in TAP5-1629 that I have to provide a TreeSelectionModel if I want it to be selectable, and that is what I had done:
>         <t:tree t:id="tree" t:model="treeModel" t:selectionModel="selectionModel"/>
> 	public TreeSelectionModel<CategoryNode> getSelectionModel() {
> 		if (selectionModel == null) {
> 			selectionModel = new DefaultTreeSelectionModel<CategoryNode>();
> 		}
> 		return selectionModel;
> 	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1911) Tree leaf is still not selectable

Posted by "Lance (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13260650#comment-13260650 ] 

Lance commented on TAP5-1911:
-----------------------------

I think that you might have misunderstood what is managed by the tree component and what is managed by the developer
1. The tree component keeps track of which "folders" are open and closed so that when you navigate away and come back, the tree state is maintained.
2. The tree component does not concern itself with leaf actions. A developer can customise leaf actions by specifying a "label" block which may contain a checkbox for example.
                
> Tree leaf is still not selectable
> ---------------------------------
>
>                 Key: TAP5-1911
>                 URL: https://issues.apache.org/jira/browse/TAP5-1911
>             Project: Tapestry 5
>          Issue Type: Bug
>    Affects Versions: 5.3.1, 5.3.2
>            Reporter: Geoff Callender
>
> I can't make a tree leaf selectable. When I click on a leaf there's a javascript error in tree.js:
>     function doAnimate(element) {
>         var sublist = $(element).up('li').down("ul");
>         var dim = sublist.getDimensions();
> tree.js:52TypeError: 'undefined' is not an object (evaluating 'sublist.getDimensions')
>         var duration = Math.min(dim.height * cfg.ANIMATION_RATE,
>             cfg.MAX_ANIMATION_DURATION)
>         new Effect.toggle(sublist, cfg.TOGGLE_TYPE, {
>             duration : duration,
>             queue : {
>                 position : 'end',
>                 scope : cfg.QUEUE_NAME
>             }
>         });
>     }
> It (sublist) is undefined because I clicked on 'tree_1', which has an 'li' up from it but no 'ul' down from there:
> <li>
> 	<span id="tree_1" class="t-tree-icon t-leaf-node t-tree-expanded"></span>
> 	<span class="t-tree-label t-selectable">
> 	    100 Philosophy	
> 	</span>
> </li>
> I saw in TAP5-1629 that I have to provide a TreeSelectionModel if I want it to be selectable, and that is what I had done:
>         <t:tree t:id="tree" t:model="treeModel" t:selectionModel="selectionModel"/>
> 	public TreeSelectionModel<CategoryNode> getSelectionModel() {
> 		if (selectionModel == null) {
> 			selectionModel = new DefaultTreeSelectionModel<CategoryNode>();
> 		}
> 		return selectionModel;
> 	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1911) Tree leaf is still not selectable

Posted by "Geoff Callender (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258849#comment-13258849 ] 

Geoff Callender commented on TAP5-1911:
---------------------------------------

I didn't realise you can click on the leaf's label! That works fine. The javascript error occurs when you click on the leaf's icon.
                
> Tree leaf is still not selectable
> ---------------------------------
>
>                 Key: TAP5-1911
>                 URL: https://issues.apache.org/jira/browse/TAP5-1911
>             Project: Tapestry 5
>          Issue Type: Bug
>    Affects Versions: 5.3.1, 5.3.2
>            Reporter: Geoff Callender
>
> I can't make a tree leaf selectable. When I click on a leaf there's a javascript error in tree.js:
>     function doAnimate(element) {
>         var sublist = $(element).up('li').down("ul");
>         var dim = sublist.getDimensions();
> tree.js:52TypeError: 'undefined' is not an object (evaluating 'sublist.getDimensions')
>         var duration = Math.min(dim.height * cfg.ANIMATION_RATE,
>             cfg.MAX_ANIMATION_DURATION)
>         new Effect.toggle(sublist, cfg.TOGGLE_TYPE, {
>             duration : duration,
>             queue : {
>                 position : 'end',
>                 scope : cfg.QUEUE_NAME
>             }
>         });
>     }
> It (sublist) is undefined because I clicked on 'tree_1', which has an 'li' up from it but no 'ul' down from there:
> <li>
> 	<span id="tree_1" class="t-tree-icon t-leaf-node t-tree-expanded"></span>
> 	<span class="t-tree-label t-selectable">
> 	    100 Philosophy	
> 	</span>
> </li>
> I saw in TAP5-1629 that I have to provide a TreeSelectionModel if I want it to be selectable, and that is what I had done:
>         <t:tree t:id="tree" t:model="treeModel" t:selectionModel="selectionModel"/>
> 	public TreeSelectionModel<CategoryNode> getSelectionModel() {
> 		if (selectionModel == null) {
> 			selectionModel = new DefaultTreeSelectionModel<CategoryNode>();
> 		}
> 		return selectionModel;
> 	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (TAP5-1911) Tree leaf is still not selectable

Posted by "Geoff Callender (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258849#comment-13258849 ] 

Geoff Callender edited comment on TAP5-1911 at 4/21/12 1:20 PM:
----------------------------------------------------------------

I didn't realise you can click on the leaf's label! That works fine. The javascript error occurs when you click on the leaf's icon.

Regardless, I still don't get how to make use of this component. It sends an Ajax request when you select or unselect a node, yet it ignores the response. I expected it to respond to a returned zone or a page.

So this issue represents (a) a bug and (b) either a request for more functionality or, if the functionality is already there, documentation on how to use it.

This is important to me because I'm trying to develop a decent example to put in JumpStart.

Cheers,

Geoff
                
      was (Author: geoffcallender):
    I didn't realise you can click on the leaf's label! That works fine. The javascript error occurs when you click on the leaf's icon.
                  
> Tree leaf is still not selectable
> ---------------------------------
>
>                 Key: TAP5-1911
>                 URL: https://issues.apache.org/jira/browse/TAP5-1911
>             Project: Tapestry 5
>          Issue Type: Bug
>    Affects Versions: 5.3.1, 5.3.2
>            Reporter: Geoff Callender
>
> I can't make a tree leaf selectable. When I click on a leaf there's a javascript error in tree.js:
>     function doAnimate(element) {
>         var sublist = $(element).up('li').down("ul");
>         var dim = sublist.getDimensions();
> tree.js:52TypeError: 'undefined' is not an object (evaluating 'sublist.getDimensions')
>         var duration = Math.min(dim.height * cfg.ANIMATION_RATE,
>             cfg.MAX_ANIMATION_DURATION)
>         new Effect.toggle(sublist, cfg.TOGGLE_TYPE, {
>             duration : duration,
>             queue : {
>                 position : 'end',
>                 scope : cfg.QUEUE_NAME
>             }
>         });
>     }
> It (sublist) is undefined because I clicked on 'tree_1', which has an 'li' up from it but no 'ul' down from there:
> <li>
> 	<span id="tree_1" class="t-tree-icon t-leaf-node t-tree-expanded"></span>
> 	<span class="t-tree-label t-selectable">
> 	    100 Philosophy	
> 	</span>
> </li>
> I saw in TAP5-1629 that I have to provide a TreeSelectionModel if I want it to be selectable, and that is what I had done:
>         <t:tree t:id="tree" t:model="treeModel" t:selectionModel="selectionModel"/>
> 	public TreeSelectionModel<CategoryNode> getSelectionModel() {
> 		if (selectionModel == null) {
> 			selectionModel = new DefaultTreeSelectionModel<CategoryNode>();
> 		}
> 		return selectionModel;
> 	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1911) Tree leaf is still not selectable

Posted by "Geoff Callender (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13260464#comment-13260464 ] 

Geoff Callender commented on TAP5-1911:
---------------------------------------

I've moved issue (b) out into TAP5-1916.
                
> Tree leaf is still not selectable
> ---------------------------------
>
>                 Key: TAP5-1911
>                 URL: https://issues.apache.org/jira/browse/TAP5-1911
>             Project: Tapestry 5
>          Issue Type: Bug
>    Affects Versions: 5.3.1, 5.3.2
>            Reporter: Geoff Callender
>
> I can't make a tree leaf selectable. When I click on a leaf there's a javascript error in tree.js:
>     function doAnimate(element) {
>         var sublist = $(element).up('li').down("ul");
>         var dim = sublist.getDimensions();
> tree.js:52TypeError: 'undefined' is not an object (evaluating 'sublist.getDimensions')
>         var duration = Math.min(dim.height * cfg.ANIMATION_RATE,
>             cfg.MAX_ANIMATION_DURATION)
>         new Effect.toggle(sublist, cfg.TOGGLE_TYPE, {
>             duration : duration,
>             queue : {
>                 position : 'end',
>                 scope : cfg.QUEUE_NAME
>             }
>         });
>     }
> It (sublist) is undefined because I clicked on 'tree_1', which has an 'li' up from it but no 'ul' down from there:
> <li>
> 	<span id="tree_1" class="t-tree-icon t-leaf-node t-tree-expanded"></span>
> 	<span class="t-tree-label t-selectable">
> 	    100 Philosophy	
> 	</span>
> </li>
> I saw in TAP5-1629 that I have to provide a TreeSelectionModel if I want it to be selectable, and that is what I had done:
>         <t:tree t:id="tree" t:model="treeModel" t:selectionModel="selectionModel"/>
> 	public TreeSelectionModel<CategoryNode> getSelectionModel() {
> 		if (selectionModel == null) {
> 			selectionModel = new DefaultTreeSelectionModel<CategoryNode>();
> 		}
> 		return selectionModel;
> 	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1911) Tree leaf is still not selectable

Posted by "Lance (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13260650#comment-13260650 ] 

Lance commented on TAP5-1911:
-----------------------------

I think that you might have misunderstood what is managed by the tree component and what is managed by the developer
1. The tree component keeps track of which "folders" are open and closed so that when you navigate away and come back, the tree state is maintained.
2. The tree component does not concern itself with leaf actions. A developer can customise leaf actions by specifying a "label" block which may contain a checkbox for example.
                
> Tree leaf is still not selectable
> ---------------------------------
>
>                 Key: TAP5-1911
>                 URL: https://issues.apache.org/jira/browse/TAP5-1911
>             Project: Tapestry 5
>          Issue Type: Bug
>    Affects Versions: 5.3.1, 5.3.2
>            Reporter: Geoff Callender
>
> I can't make a tree leaf selectable. When I click on a leaf there's a javascript error in tree.js:
>     function doAnimate(element) {
>         var sublist = $(element).up('li').down("ul");
>         var dim = sublist.getDimensions();
> tree.js:52TypeError: 'undefined' is not an object (evaluating 'sublist.getDimensions')
>         var duration = Math.min(dim.height * cfg.ANIMATION_RATE,
>             cfg.MAX_ANIMATION_DURATION)
>         new Effect.toggle(sublist, cfg.TOGGLE_TYPE, {
>             duration : duration,
>             queue : {
>                 position : 'end',
>                 scope : cfg.QUEUE_NAME
>             }
>         });
>     }
> It (sublist) is undefined because I clicked on 'tree_1', which has an 'li' up from it but no 'ul' down from there:
> <li>
> 	<span id="tree_1" class="t-tree-icon t-leaf-node t-tree-expanded"></span>
> 	<span class="t-tree-label t-selectable">
> 	    100 Philosophy	
> 	</span>
> </li>
> I saw in TAP5-1629 that I have to provide a TreeSelectionModel if I want it to be selectable, and that is what I had done:
>         <t:tree t:id="tree" t:model="treeModel" t:selectionModel="selectionModel"/>
> 	public TreeSelectionModel<CategoryNode> getSelectionModel() {
> 		if (selectionModel == null) {
> 			selectionModel = new DefaultTreeSelectionModel<CategoryNode>();
> 		}
> 		return selectionModel;
> 	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1911) Tree leaf is still not selectable

Posted by "Geoff Callender (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13260464#comment-13260464 ] 

Geoff Callender commented on TAP5-1911:
---------------------------------------

I've moved issue (b) out into TAP5-1916.
                
> Tree leaf is still not selectable
> ---------------------------------
>
>                 Key: TAP5-1911
>                 URL: https://issues.apache.org/jira/browse/TAP5-1911
>             Project: Tapestry 5
>          Issue Type: Bug
>    Affects Versions: 5.3.1, 5.3.2
>            Reporter: Geoff Callender
>
> I can't make a tree leaf selectable. When I click on a leaf there's a javascript error in tree.js:
>     function doAnimate(element) {
>         var sublist = $(element).up('li').down("ul");
>         var dim = sublist.getDimensions();
> tree.js:52TypeError: 'undefined' is not an object (evaluating 'sublist.getDimensions')
>         var duration = Math.min(dim.height * cfg.ANIMATION_RATE,
>             cfg.MAX_ANIMATION_DURATION)
>         new Effect.toggle(sublist, cfg.TOGGLE_TYPE, {
>             duration : duration,
>             queue : {
>                 position : 'end',
>                 scope : cfg.QUEUE_NAME
>             }
>         });
>     }
> It (sublist) is undefined because I clicked on 'tree_1', which has an 'li' up from it but no 'ul' down from there:
> <li>
> 	<span id="tree_1" class="t-tree-icon t-leaf-node t-tree-expanded"></span>
> 	<span class="t-tree-label t-selectable">
> 	    100 Philosophy	
> 	</span>
> </li>
> I saw in TAP5-1629 that I have to provide a TreeSelectionModel if I want it to be selectable, and that is what I had done:
>         <t:tree t:id="tree" t:model="treeModel" t:selectionModel="selectionModel"/>
> 	public TreeSelectionModel<CategoryNode> getSelectionModel() {
> 		if (selectionModel == null) {
> 			selectionModel = new DefaultTreeSelectionModel<CategoryNode>();
> 		}
> 		return selectionModel;
> 	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira