2 Replies Latest reply on Sep 24, 2007 3:12 AM by mszalay

    RichFaces Tree not working in a portlet

    mszalay

      Hi

      I'm using RichFaces 3.0.1 with MyFaces to write a portlet. The portlet works, but the RichFaces rich:Tree component is not getting displayed. If I have a look at the generated html source code, the tree is there (there is a lot of javascript for the tree).

      Richfaces_Tree__idJsp2jbpns_2fdefault_2fdefault_2f47snpbj__idJsp4jbpns_2fdefault_2fdefault_2f47snpbj =
       new Tree("_id...:input", "server",
       {
       onselect: "",
       onexpand: "",
       oncollapse: ""
       },
       function(event) {
       A4J.AJAX.Submit('...'); return false;
       },
       "",
       false
       );
       Richfaces_Tree__idJsp2jbpns_2fdefault_2fdefault_2f47snpbj__idJsp4jbpns_2fdefault_2fdefault_2f47snpbj.drop = function(event,drag){var options = {'parameters':{'_idJsp2jbpns_2fdefault_2fdefault_2f47snpbj:_idJsp4jbpns_2fdefault_2fdefault_2f47snpbj':'_idJsp2jbpns_2fdefault_2fdefault_2f47snpbj:_idJsp4jbpns_2fdefault_2fdefault_2f47snpbj'} ,'actionUrl':'/portal/auth/portal/default/default/47?action=1&org.apache.myfaces.portlet.MyFacesGenericPortlet.VIEW_ID=%2FWEB-INF%2Fhome%2Findex.jsp'} ;options.parameters['dropTargetId'] = '_idJsp2jbpns_2fdefault_2fdefault_2f47snpbj:_idJsp4jbpns_2fdefault_2fdefault_2f47snpbj';Object.extend(options.parameters,drag.getParameters());if (this.options.ondrop) { if (!this.options.ondrop.call(this, event)) return; };A4J.AJAX.Submit('_idJsp0jbpns_2fdefault_2fdefault_2f47snpbj','_idJsp2jbpns_2fdefault_2fdefault_2f47snpbj',event,options);};
      //--></script><div id="_idJsp2jbpns_2fdefault_2fdefault_2f47snpbj:_idJsp4jbpns_2fdefault_2fdefault_2f47snpbj:script"><script type="text/javascript"><!--
      
      //--></script>


      The jsp looks as follows:

      <%@page contentType="text/html"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="core"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="html"%>
      <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
      <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
      <core:loadBundle var="Home" basename="Home" />
      <a4j:portlet>
       <core:view>
       <%-- content --%>
       <rich:panel>
      
       <%-- tree ---%>
       <html:form>
       <html:panelGrid width="100%">
      
       <rich:tree
       nodeSelectListener="#{navigationTree.processSelection}"
       reRender="selectedNode"
       ajaxSubmitSelection="true"
       switchType="server"
       value="#{navigationTree.treeData}" var="item">
       </rich:tree>
      
       <rich:spacer height="20" />
       <html:outputText value="#{navigationTree.message}" />
       <rich:spacer height="20" />
       <html:commandLink action="#{navigationTree.updateTree}" value="#{Home.updateButton}" />
      
       </html:panelGrid>
       </html:form>
      
       </rich:panel>
       </core:view>
      </a4j:portlet>
      


      Has anyone got this component running in a portlet yet?

      Thanks for an answer