1 Reply Latest reply on Dec 20, 2007 4:23 PM by Brian Parkinson

    Tree node select listener not working

    Brian Parkinson Newbie

      Hello -

      I've got a tree working (cool) but can't get the node select listener to work - the 'processSelection' method never gets called. I know that the tree bean is working and it's serving up the tree nodes, but no events.

      The JSF definition:

      <rich:tab id="tree_tab" label="#{i18n.tree}">
      <rich:tree style="width:300px" nodeSelectListener="#{thermostat.processSelection}"
      reRender="selectedNode" ajaxSubmitSelection="true" switchType="client"
      value="#{thermostat.treeNode}" var="item">
      </rich:tree>
      <h:outputText escape="false" value="Selected Node: #{thermostat.nodeTitle}" id="selectedNode" />
      </rich:tab>

      My bean model object implements NodeSelectedListener (is this needed - the example doesn't have this, but unsure), and implements the 'processSelection' method:

      public void processSelection(NodeSelectedEvent event)
      {
      System.out.println("I never get here");
      }

      When I launch the app inside JBoss, I get an exception - perhaps this is related? The trace is below.

      Any help is appreciated.

      Thanks.

      parki...

      --- x8 snip


      09:35:07,062 WARN [lifecycle] executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@63ae08) threw exception
      java.lang.NullPointerException
      at org.ajax4jsf.renderkit.HeaderResourcesRendererBase.getUrisSet(HeaderResourcesRendererBase.java:99)
      at org.ajax4jsf.renderkit.HeaderResourcesRendererBase.getHeaderScripts(HeaderResourcesRendererBase.java:52)
      at org.ajax4jsf.context.AjaxContextImpl.processHeadResources(AjaxContextImpl.java:442)
      at org.ajax4jsf.context.AjaxContextImpl.processHeadResources(AjaxContextImpl.java:459)
      at org.ajax4jsf.context.AjaxContextImpl.processHeadResources(AjaxContextImpl.java:459)
      at org.ajax4jsf.context.AjaxContextImpl.processHeadResources(AjaxContextImpl.java:459)
      at org.ajax4jsf.context.AjaxContextImpl.processHeadResources(AjaxContextImpl.java:366)
      at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:245)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:595)
      09:35:07,062 ERROR [[FacesServlet]] Servlet.service() for servlet FacesServlet threw exception
      java.lang.NullPointerException
      at org.ajax4jsf.renderkit.HeaderResourcesRendererBase.getUrisSet(HeaderResourcesRendererBase.java:99)
      at org.ajax4jsf.renderkit.HeaderResourcesRendererBase.getHeaderScripts(HeaderResourcesRendererBase.java:52)
      at org.ajax4jsf.context.AjaxContextImpl.processHeadResources(AjaxContextImpl.java:442)
      at org.ajax4jsf.context.AjaxContextImpl.processHeadResources(AjaxContextImpl.java:459)
      at org.ajax4jsf.context.AjaxContextImpl.processHeadResources(AjaxContextImpl.java:459)
      at org.ajax4jsf.context.AjaxContextImpl.processHeadResources(AjaxContextImpl.java:459)
      at org.ajax4jsf.context.AjaxContextImpl.processHeadResources(AjaxContextImpl.java:366)
      at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:245)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:595)
      09:35:15,265 INFO [Authentication] In authentication login. (login)
      09:35:15,265 INFO [Authentication] The value for topdir: 'C:/cygwin/home/parki/tools/java/jboss-4.2.1.GA/server/default/tmp/deploy/
      tmp56411webapp.ear-contents/webapp-exp.war/WEB-INF/'. (login)
      09:35:15,515 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from file [C:\cygwin\home\parki\tools\java\jboss-4.2.1.GA\
      server\default\tmp\deploy\tmp56411webapp.ear-contents\webapp-exp.war\WEB-INF\spring.xml]
      09:35:15,718 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [com/ecobee/foundation/model/spri
      ng-test-thermostat.xml]
      09:35:15,843 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [com/ecobee/foundation/model/spri
      ng-test-user.xml]
      09:35:15,875 INFO [GenericApplicationContext] Refreshing org.springframework.context.support.GenericApplicationContext@4b9101: disp
      lay name [org.springframework.context.support.GenericApplicationContext@4b9101]; startup date [Thu Dec 20 09:35:15 CST 2007]; root o
      f context hierarchy
      09:35:15,890 INFO [GenericApplicationContext] Bean factory for application context [org.springframework.context.support.GenericAppl
      icationContext@4b9101]: org.springframework.beans.factory.support.DefaultListableBeanFactory@110b205
      09:35:16,078 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultLis
      tableBeanFactory@110b205: defining beans [mapConfig,dataSource,sqlMapClient,alertDao,logDao,statusDao,thermostatDao,userDao,calendar
      Event1,calendarEvent2,climate1,climate2,climate3,climateZone1,climateZone2,climateZone3,climateZone4,contractorInfo,equipmentInfo1,e
      quipmentInfo2,internetConfig,location,period1,period2,period3,period4,period5,program,setting,thermostat,wifiConfig,zone1,zone2,cust
      omEditorConfigurer,user1,user2,user3,user4]; root of factory hierarchy
      09:35:16,109 INFO [SingleConnectionDataSource] Loaded JDBC driver: com.mysql.jdbc.Driver
      09:35:17,250 INFO [SingleConnectionDataSource] Established shared JDBC Connection: com.mysql.jdbc.Connection@6a54f9
      09:35:17,859 INFO [STDOUT] Checking parki against Rt6+7BawfvuXp760joOqUhkebmBZ7CDA = true
      09:35:17,890 INFO [Authentication] Authorization accepted for: parki@ecobee.com (login)

        • 1. Re: Tree node select listener not working
          Brian Parkinson Newbie

          Wehoops - meant <a4j:form>.

          Found the problem.

          Needed to wrap in an a4j:include.

          <rich:tab id="tree_tab" label="#{i18n.tree}">
          <a4j:form>
          <rich:tree style="width:300px" nodeSelectListener="#{thermostat.processSelection}"
          reRender="selectedNode" ajaxSubmitSelection="true" switchType="client"
          value="#{thermostat.treeNode}" var="item">
          </rich:tree>
          <h:outputText value="Selected Node: #{thermostat.nodeTitle}" id="selectedNode" />
          </a4j:form>
          </rich:tab>

          parki...