Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
OnClick-Function in Webtree?
posted

Hi,

I'm actually evaluating the JSF-Controls for our Product, so I'm not very experienced with NetAdvantage.

Is there a way to call clientside Javascript-functions when an item is getting selected in a treeView.

I managed it to define some ActionListeners in my ControllerBeanfor my treeNodes, but I can't call any JS-Functions.

        ELContext elContext = context.getELContext();
        MethodExpression exprActionListener = application.getExpressionFactory().createMethodBLOCKED EXPRESSION.

Thanks in advance ,Mike

Parents Reply
  • 1324
    posted in reply to Michael

    Hello Mike,

    I cheked and found no issue while working with CSOM for TreeView.
    Following is the sample JSP which I test this:

    <%@ page language="java" pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="
    http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://ko.infragistics.com/faces/netadvantage"
     prefix="ig"%>


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>My JSF 'TreeViewTest.jsp' starting page</title>
    <script>

    function nodeExpanded(sender, args) {
     alert("Node Expanded");
    }

    function nodeClick(sender, args) {
     alert("Node Clicked");
    }

    function myAjaxRequesting(sender, args) {
    }

    function myAjaxResponseCompleted(sender, args) {
    }

    </script>
    </head>
    <body>
    <f:view>
    <h:form>
    <ig:treeView
    style="border: 1px solid silver; height: 200; width: 300">

    <ig:treeViewClientEvents nodeExpanded="nodeExpanded"
    nodeClick="nodeClick" />
        
    <ig:treeNode id="treeNode1" value="My Computer"
    iconUrl="/resources/myComputer.gif">

    <ig:treeNode value="Local Disk (C:)"
    iconUrl="/resources/localDisk.gif">

    <ig:treeNode value="Folder 1">
    <ig:treeNode value="Folder 1-1" />

    <ig:treeNode value="Folder 1-2" />
    </ig:treeNode>

    <ig:treeNode value="Folder 2">
    <ig:treeNode value="Folder 2-1" />
    <ig:treeNode value="Folder 2-2" />
    </ig:treeNode>
    </ig:treeNode>
    <ig:treeNode disabled="true"
    value="CD Drive (D:)  -->  (disabled node)"
    iconUrl="/resources/cdDrive.gif" />
    <ig:treeNode value="Control Panel"
    iconUrl="/resources/controlPanel.gif">
    <ig:treeNode value="Fonts" iconUrl="/resources/fonts.gif" />
    <ig:treeNode value="Network Connections"
    iconUrl="/resources/networkConnections.gif" />
    <ig:treeNode value="Printers and Faxes"
    iconUrl="/resources/printersFaxes.gif" />
    <ig:treeNode value="Scheduled Tasks"
    iconUrl="/resources/scheduledTasks.gif" />
    </ig:treeNode>
    </ig:treeNode>
    <ig:treeNode id="treeNode2" value="My Network Places"
    iconUrl="/resources/myNetworkPlaces.gif">
    <ig:treeNode value="Entire Network"
    iconUrl="/resources/entireNetwork.gif" />
    <ig:treeNode value="www.sun.com (redirect to the page)"
    href="http://www.sun.com" />
    </ig:treeNode>
    </ig:treeView>
    </h:form>
    </f:view>
    </body>
    </html>

    The expand and click event are triggerd without any issue. There is no any beans used here so you can check this easily.

    Hope it helps you.

    Roshan

     

Children