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
Hello Mike,
Have you tried this with version 9.1 of NetAdvantage. The new CSOM feature has been introduced for this and I hope you can definitely do this using it. You can have a look for this feature by following sample at NetAdvantage site:
http://java.samples.infragistics.com/NetAdvantage/JSF/2009.1/featurebrowser/webtree/csom/index.faces
Roshan.
Hello Roshan,
first of all thanks four your answer. This is exactly what I needed, if it would work :-).
Here is what I have done:
Before I had this in my jsp-page:
<ig:treeView dataKeyName="name" pageSize="5" dataSource="#{editDeviceTree.nodes}"> </ig:treeView>
This did show me the nodes in the way I wanted them. When I now insert the Client Event tag, the tree disappears completely on my rendered page:
<ig:treeView dataKeyName="name" pageSize="5" dataSource="#{editDeviceTree.nodes}"> <ig:treeViewClientEvents id="testid" nodeExpanded="nodeExpanded"/> </ig:treeView>
On the other hand, when I try the CSOM feature with the datechooser-Example of the developersGuide, it works fine and the javascript-function gets called.
<ig:dateChooser> <ig:dateChooserClientEvents popupOpening="nodeExpanded"/> </ig:dateChooser>
Do you have an idea why it does not work with the tree?
Thanks,
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://es.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:treeViewstyle="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
thanks again for your time.
I tried the tree from your example and it worked fine, but when I try to create the nodelist in my bean my tree still disappears. (example from my previous post).
Do you have any idea what I am doing wrong or is the CSOM-feature not working with beans?
I am not sure about that.. Have you added following script in your application?function myAjaxRequesting(sender, args) {}
I am not sure if it could be the reason but you can give it a trial. In case if you still have problem..Then try to provide small size code of your application here (beans, and JSP). I will look into this and try to find out the reason.
Thank you.Roshan
Hi Roshan,
the two functions didn't make a difference.
But in the meantime, I've contacted the Infragistics Developer Support directly and they told me that there is a bug in the WebTree and they search for a resolution.
I will let you know what they find out if you are interested.
Thanks a lot,