You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Tadeáš Palusga (JIRA)" <ji...@apache.org> on 2013/11/13 22:49:22 UTC

[jira] [Created] (TAP5-2222) Allow NODE_SELECTED and NODE_UNSELECTED events for inner tree nodes

Tadeáš Palusga created TAP5-2222:
------------------------------------

             Summary: Allow NODE_SELECTED and NODE_UNSELECTED events for inner tree nodes
                 Key: TAP5-2222
                 URL: https://issues.apache.org/jira/browse/TAP5-2222
             Project: Tapestry 5
          Issue Type: Improvement
          Components: tapestry-core
    Affects Versions: 5.3.7
            Reporter: Tadeáš Palusga
            Priority: Trivial


Hi, 
  I run into the situation that I need to use NODE_SELECTED and NODE_UNSELECTED events not only for leaf nodes but for inner nodes too.

I think the previous sentence is as describing as it can be :)

I'm new in committing/pull-requesting/patch-requesting to open-source project so please be lenient to me :)


I provide simple patch - I added parameter "selectableNodes", which is used to determine if inner nodes should be selectable - default is false due to backward compatibility



72,79d71
< 
<     /**
<      * Optional parameter used to specify whether inner nodes should be selectable or not. Default value
<      * is false.
<      */
<     @Parameter
<     private boolean selectableNodes;
< 
184,185d175
< 
< 
198,200d187
< 
<                     if (selectableNodes)
<                         addSelectLinkBinding(spec);
203c190,202
<                     addSelectLinkBinding(spec);
---
>                     if (selectionModel != null)
>                     {
>                         // May need to address this in the future; in other tree implementations I've constructed,
>                         // folders are selectable, and selections even propagate up and down the tree.
> 
>                         Link selectLeaf = resources.createEventLink("select", node.getId());
> 
>                         spec.put("selectURL", selectLeaf.toString());
>                         if (selectionModel.isSelected(node))
>                         {
>                             spec.put("selected", true);
>                         }
>                     }
225a225
>         }
227,242c227
<             private void addSelectLinkBinding(JSONObject spec) {
<                 if (selectionModel != null)
<                 {
<                     // May need to address this in the future; in other tree implementations I've constructed,
<                     // folders are selectable, and selections even propagate up and down the tree.
< 
<                     Link selectLeaf = resources.createEventLink("select", node.getId());
< 
<                     spec.put("selectURL", selectLeaf.toString());
<                     if (selectionModel.isSelected(node))
<                     {
<                         spec.put("selected", true);
<                     }
<                 }
<             }
<         };
---
>                 ;




--
This message was sent by Atlassian JIRA
(v6.1#6144)