[ 
https://issues.apache.org/jira/browse/DISPATCH-1398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16907893#comment-16907893
 ] 

Jiri Daněk commented on DISPATCH-1398:
--------------------------------------

I am not completely convinced the warning is without some truth.

The function onRootReady does not seem to be defined anywhere in the dispatch 
source. onTreeSelected is defined only in the hawtio version of dispatch.

The code initializing the fancytree in hawtio version looks like this

{code}
    var initTree = function () {
      if (!treeReady || !serviceReady)
        return;
      $('#entityTree').dynatree({
        onActivate: onTreeSelected,
        onExpand: onTreeNodeExpanded,
        selectMode: 1,
        autoCollapse: $scope.largeNetwork,
        activeVisible: !$scope.largeNetwork,
        debugLevel: 0,
        children: entityTreeChildren
      })
...
{code}

In standalone

{code}
    var initTree = function () {
      if (!treeReady || !serviceReady)
        return;
      $('#entityTree').fancytree({
        activate: onTreeNodeActivated,
        expand: onTreeNodeExpanded,
        collapse: onTreeNodeCollapsed,
        beforeActivate: onTreeNodeBeforeActivate,
        beforeSelect: function (event, data) {
          // A node is about to be selected: prevent this for folders:
          if (data.node.isFolder()) {
            return false;
          }
        },
        init: onTreeInitialized,
        selectMode: 1,
        autoCollapse: $scope.largeNetwork,
        activeVisible: !$scope.largeNetwork,
        clickFolderMode: 3,
        debugLevel: 0,
        extraClasses: {
          expander: 'fa-angle',
          connector: 'fancytree-no-connector'
        },
        source: entityTreeChildren
      });
    };
{code}

The fancytree doc I found [1] never mentions setting "onSelect" in the html div 
that will be used to initialize the fancytree.

Why does the hawtio version use {{onActivate}} and the stand-alone version 
{{activate}}. It is because of different versions of fancytree?

[1] https://github.com/mar10/fancytree/wiki/TutorialEvents

> "Expression with no effect" warning for console web
> ---------------------------------------------------
>
>                 Key: DISPATCH-1398
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-1398
>             Project: Qpid Dispatch
>          Issue Type: Bug
>          Components: Console
>    Affects Versions: 1.8.0
>            Reporter: Jiri Daněk
>            Assignee: Ernest Allen
>            Priority: Minor
>
> console/html/qdrList.html
> {noformat}
>  74        <div class="_treeContainer">
>    CID 347402 (#2 of 2): Expression with no effect (NO_EFFECT)unused_expr: 
> Accessing data with onTreeSelected and discarding the result. What was this 
> code intended to accomplish?
>    Perhaps this code is incomplete or mistyped in some way.
>  75            <div id="entityTree" onSelect="onTreeSelected" 
> onRoot="onRootReady" hideRoot="true"></div>
>  76            <div ng-init="treeReady()"></div>
>  77        </div>
> {noformat}
> There may be some js magic involved, but after a brief inspection, the 
> warning looks real to me. The stand-alone console seems to work ok, so it 
> either has no influence on functionality, I did not thing of trying what's 
> broken, (or it is a false positive warning).
> Could you please check?
> html/tmplListTree.html
> {noformat}
> 32        <div class="pane-viewport">
> 33            <div class="pane-content">
> 34                <div class="treeContainer">
>   CID 347337 (#3 of 3): Expression with no effect (NO_EFFECT)unused_expr: 
> Accessing data with onTreeSelected and discarding the result. What was this 
> code intended to accomplish?
>   Perhaps this code is incomplete or mistyped in some way.
> 35                    <div id="entityTree" onSelect="onTreeSelected" 
> onRoot="onRootReady" hideRoot="true"></div>
> 36                    <div ng-init="treeReady()"></div>
> 37                </div>
> 38            </div>
> 39        </div>
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to