0 Replies Latest reply on Jun 10, 2010 1:21 PM by ramakrishna manthena

    <rich:tree> <a4j:include > does not work in IE

    ramakrishna manthena Newbie

      i have been trying to use <rich:tree> and <a4j:include>. when i click a tree node it is not displaying the respective page in <a4j:include> in internet explorer but it is working correctly in google chrome.

       

      -- Here is my code --

      1)main.jsp

       

      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      <f:view>
      <html>
      <head>
      <title>Mail</title>
      <link href="/css/global.css" rel="stylesheet">
      </head>
      <body>
      <a4j:log level="ALL" popup="true" width="400" height="200"/>
      <h:form id="treeform">
      <rich:contextMenu attachTo="mailTree" >
      <rich:menuItem value="New Folder"></rich:menuItem>
      <rich:menuItem value="Delete Folder"></rich:menuItem>
      </rich:contextMenu>
      <h:graphicImage height="10%" width="10%" url="/images/Logo.jpg"/>
      <h:panelGrid columns="2" columnClasses="allignment">
      <rich:panel >
      <rich:tree id="mailTree"  nodeSelectListener="#{mailTree.processSelection}"
                     reRender="detailsFrame" ajaxSubmitSelection="true"  switchType="client"
                     value="#{mailTree.tree}" var="item" ajaxKeys="#{null}" treeNodeVar="treeNode" nodeFace="node"
                     showConnectingLines="true">
                     <rich:treeNode type="node" icon="#{treeNode.icon}" iconLeaf="#{treeNode.icon}" >
                          <h:outputText value="#{treeNode.data}"/>                         
                     </rich:treeNode>
                 </rich:tree>
                  </rich:panel>
                <rich:panel id="detailsFrame">
                          <a4j:include viewId = "#{mailTree.panelView}"/>
                </rich:panel>
      </h:panelGrid>            
      </h:form>
      </body>
      </html>
      </f:view>

       

      ----- java Class-> managed bean for the above jsp ------

       

      package org.proj.mail.ui.tree;

       

      import java.util.ArrayList;

      import java.util.Iterator;

      import java.util.List;

      import java.util.Map;

       

      import javax.faces.event.ActionEvent;

       

      import org.apache.commons.logging.Log;

      import org.apache.commons.logging.LogFactory;

      import org.proj.hbmDtos.MailTypes;

      import org.proj.mail.ui.tree.intf.TreeDetailsInterface;

      import org.richfaces.component.html.HtmlTree;

      import org.richfaces.event.NodeSelectedEvent;

      import org.richfaces.model.TreeNode;

       

      import com.util.jsf.tree.TreeComponent;

       

      public class MailTreeUI {

      Log log = LogFactory.getLog(MailTreeUI.class);

      TreeComponent tree = new TreeComponent();

      TreeDetailsInterface th ;

      private List<String> selectedNodeChildren = new ArrayList<String>();

      private String nodeTitle;

      private String url = "";

      private String panelView= "/jsp/inboxDets.jsp";

       

       

      public MailTreeUI(){

      tree.setData("Mail Types");

      }

      public TreeComponent getTree() {

      this.generateTree();

      return tree;

      }

      public void setTree(TreeComponent tree) {

      this.tree = tree;

      }

       

      public void generateTree(){

      try{

      List<MailTypes> types = th.getAllMailTypes(); // loads the nodes of the tree

      if(types != null && types.size() > 0){

      int i=0;

      for(MailTypes type:types){

      TreeComponent tc = new TreeComponent();

      tc.setData(type.getTypeName());

      tc.setNodeType("node");

      tc.setIcon(type.getIcon());

      i++;

      tree.addChild(i, tc);

      }

      }

      }catch(Exception e){

      log.error("error while generating mail type tree");

      e.printStackTrace();

      }

      }

       

      public void processSelection(NodeSelectedEvent event) {

      HtmlTree tree = (HtmlTree) event.getComponent();

      nodeTitle = (String) tree.getRowData();

      selectedNodeChildren.clear();

      System.out.println("\n\n"+nodeTitle+"\n\n\n");

      if(nodeTitle.equalsIgnoreCase("outbox")){

      this.panelView="/jsp/skins.jsp";

      }

      TreeNode currentNode = tree.getModelTreeNode(tree.getRowKey());

      if (currentNode.isLeaf()){

      selectedNodeChildren.add((String)currentNode.getData());

      }else

      {

      Iterator<Map.Entry<Object, TreeNode>> it = currentNode.getChildren();

      while (it!=null &&it.hasNext()) {

      Map.Entry<Object, TreeNode> entry = it.next();

      selectedNodeChildren.add(entry.getValue().getData().toString());

      }

      }

      }

       

      public String getNodeTitle() {

      return nodeTitle;

      }

      public void setNodeTitle(String nodeTitle) {

      this.nodeTitle = nodeTitle;

      }

      public TreeDetailsInterface getTh() {

      return th;

      }

      public void setTh(TreeDetailsInterface th) {

      this.th = th;

      }

      public String getPanelView() {

      return panelView;

      }

      public void setPanelView(String panelView) {

      this.panelView = panelView;

      }

      }

      ------  skins.jsp ------
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
      <f:view>
      <h:form>
         <h:panelGrid style="width: 300px">
        <rich:tabPanel>
      <rich:tab label="Tab 1"><a4j:include viewId="/jsp/inboxDets.jsp"/></rich:tab>
      <rich:tab label="Tab 2">
      <a4j:include viewId="/jsp/inboxDets.jsp"/>
      </rich:tab>
         </rich:tabPanel>      
         </h:panelGrid>
      </h:form>
      </f:view>
      ------ a4j:log -----
      Following is the log generated when a tree node is clicked in Internet explorer

      debug[22:34:31,275]: Have Event  [object Object] with properties: target: [object HTMLDivElement], srcElement:  [object HTMLDivElement], type: click
      debug[22:34:31,286]: Query preparation  for form 'treeform' requested
      debug[22:34:31,295]: Append hidden  control treeform:mailTree:1::j_id_jsp_2074312535_10NodeExpanded with value  [false] and value attribute [false]
      debug[22:34:31,306]: Append hidden  control treeform:mailTree:2::j_id_jsp_2074312535_10NodeExpanded with value  [false] and value attribute [false]
      debug[22:34:31,320]: Append hidden  control treeform:mailTree:3::j_id_jsp_2074312535_10NodeExpanded with value  [false] and value attribute [false]
      debug[22:34:31,328]: Append hidden  control treeform:mailTree:input with value  [treeform:mailTree:1::j_id_jsp_2074312535_10] and value attribute  [treeform:mailTree:1::j_id_jsp_2074312535_10]
      debug[22:34:31,337]: Append text  control treeform:j_id_jsp_2074312535_13:id0:j_id_jsp_1529677968_2:id2fsp with  value [] and value attribute [null]
      debug[22:34:31,348]: Append hidden  control treeform:j_id_jsp_2074312535_13:id0:j_id_jsp_1529677968_2:s with value  [-1] and value attribute [-1]
      debug[22:34:31,356]: Append hidden  control treeform:j_id_jsp_2074312535_13:id0_SUBMIT with value [1] and value  attribute [1]
      debug[22:34:31,365]: Append hidden  control javax.faces.ViewState with value  [SlN47ky+7xVhYRuIViEWn5CNRDGRHWln9PAqnDHib6k7NoQAevJxsjNgg9PZbD0h4W7cpN5AWKP3t/pqlwslP/vByL7e/ymD9subqUWWVHCzu9SkLFjxIQ==]  and value attribute  [SlN47ky+7xVhYRuIViEWn5CNRDGRHWln9PAqnDHib6k7NoQAevJxsjNgg9PZbD0h4W7cpN5AWKP3t/pqlwslP/vByL7e/ymD9subqUWWVHCzu9SkLFjxIQ==]
      debug[22:34:31,372]: parameter  treeform:mailTree:selectedNode with value  treeform:mailTree:1::j_id_jsp_2074312535_10
      debug[22:34:31,382]: Look up queue  with default name
      debug[22:34:31,390]: NEW AJAX REQUEST  !!! with form: treeform
      debug[22:34:31,402]: Start  XmlHttpRequest
      debug[22:34:31,411]: Request state :  1
      debug[22:34:31,418]: QueryString:  AJAXREQUEST=j_id_jsp_2074312535_0&treeform%3AmailTree%3A1%3A%3Aj_id_jsp_2074312535_10NodeExpanded=false&treeform%3AmailTree%3A2%3A%3Aj_id_jsp_2074312535_10NodeExpanded=false&treeform%3AmailTree%3A3%3A%3Aj_id_jsp_2074312535_10NodeExpanded=false&treeform%3AmailTree%3Ainput=treeform%3AmailTree%3A1%3A%3Aj_id_jsp_2074312535_10&treeform%3Aj_id_jsp_2074312535_13%3Aid0%3Aj_id_jsp_1529677968_2%3Aid2fsp=&treeform%3Aj_id_jsp_2074312535_13%3Aid0%3Aj_id_jsp_1529677968_2%3As=-1&treeform%3Aj_id_jsp_2074312535_13%3Aid0_SUBMIT=1&javax.faces.ViewState=SlN47ky%2B7xVhYRuIViEWn5CNRDGRHWln9PAqnDHib6k7NoQAevJxsjNgg9PZbD0h4W7cpN5AWKP3t%2FpqlwslP%2FvByL7e%2FymD9subqUWWVHCzu9SkLFjxIQ%3D%3D&treeform%3AmailTree%3AselectedNode=treeform%3AmailTree%3A1%3A%3Aj_id_jsp_2074312535_10&
      debug[22:34:31,461]: Request state :  2
      debug[22:34:31,469]: Request state :  3
      debug[22:34:31,476]: Request state :  4
      debug[22:34:31,484]: Request end with  state 4
      debug[22:34:31,492]: Response  with  content-type: text/xml;charset=UTF-8
      debug[22:34:31,498]: Full response  content: <?xml version="1.0"?><html  xmlns="http://www.w3.org/1999/xhtml"><head><title></title><link  class="component"  href="/a4j/s/3_3_2.SR1org/richfaces/renderkit/html/css/basic_both.xcss/DATB/eAGTiHddE7p8hjQADO8DGA__.jsf"  rel="stylesheet" type="text/css" /><link class="component"  href="/a4j/s/3_3_2.SR1org/richfaces/renderkit/html/css/extended_both.xcss/DATB/eAGTiHddE7p8hjQADO8DGA__.jsf"  media="rich-extended-skinning" rel="stylesheet" type="text/css" /><script  src="/a4j/g/3_3_2.SR1org.ajax4jsf.javascript.AjaxScript.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org.ajax4jsf.javascript.PrototypeScript.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1scripts/menu.js.jsf" type="text/javascript"> </script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/json/json-dom.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/utils.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/context-menu.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/available.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/jquery/jquery.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/jquery.utils.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/ajax4jsf/javascript/scripts/form.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/form.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/menu.js.jsf"  type="text/javascript"></script><link class="component"  href="/a4j/s/3_3_2.SR1css/menucomponents.xcss/DATB/eAGTiHddE7p8hjQADO8DGA__.jsf"  rel="stylesheet" type="text/css" /><link class="component"  href="/a4j/s/3_3_2.SR1css/panel.xcss/DATB/eAGTiHddE7p8hjQADO8DGA__.jsf"  rel="stylesheet" type="text/css" /><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/json/json-mini.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org.ajax4jsf.javascript.DnDScript.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/dnd/dnd-common.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/events.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/tree.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/tree-selection.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/tree-item.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/tree-item-dnd.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/drag-indicator.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/browser_info.js.jsf"  type="text/javascript"></script><link class="component"  href="/a4j/s/3_3_2.SR1org/richfaces/renderkit/html/css/dragIndicator.xcss/DATB/eAGTiHddE7p8hjQADO8DGA__.jsf"  rel="stylesheet" type="text/css" /><link class="component"  href="/a4j/s/3_3_2.SR1css/tree.xcss/DATB/eAGTiHddE7p8hjQADO8DGA__.jsf"  rel="stylesheet" type="text/css" /><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/script/controlUtils.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/common-scrollable-data-table.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/extended-data-table.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/ext-dt-drag-indicator.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/ext-dt-simple-draggable.js.jsf"  type="text/javascript"></script><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/ext-dt-simple-dropzone.js.jsf"  type="text/javascript"></script><link class="component"  href="/a4j/s/3_3_2.SR1css/extendedDataTable.xcss/DATB/eAGTiHddE7p8hjQADO8DGA__.jsf"  rel="stylesheet" type="text/css" /><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/datascroller.js.jsf"  type="text/javascript"></script><link class="component"  href="/a4j/s/3_3_2.SR1css/datascroller.xcss/DATB/eAGTiHddE7p8hjQADO8DGA__.jsf"  rel="stylesheet" type="text/css" /><script  src="/a4j/g/3_3_2.SR1org/richfaces/renderkit/html/scripts/skinning.js.jsf"  type="text/javascript"></script></head><body><div  xmlns:rich="http://richfaces.ajax4jsf.org/rich"></div><meta  name="Ajax-Update-Ids" content="" /><span  id="ajax-view-state"><input type="hidden" name="javax.faces.ViewState"  id="javax.faces.ViewState"  value="SlN47ky+7xVhYRuIViEWn5CNRDGRHWln9PAqnDHib6k7NoQAevJxsjNgg9PZbD0h4W7cpN5AWKP3t/pqlwslP/vByL7e/ymD9subqUWWVHCzu9SkLFjxIQ=="  /></span><meta id="Ajax-Response" name="Ajax-Response"  content="true" /></body></html>
      debug[22:34:31,509]: Header  Ajax-Expired not found, search in <meta>
      debug[22:34:31,516]: search for  elements by name 'meta'  in element #document
      debug[22:34:31,529]: Find <meta  name='Ajax-Update-Ids' content=''>
      debug[22:34:31,542]: Find <meta  name='Ajax-Response' content='true'>
      debug[22:34:31,551]: Header  Ajax-Update-Ids not found, search in <meta>
      debug[22:34:31,558]: search for  elements by name 'meta'  in element #document
      debug[22:34:31,567]: Find <meta  name='Ajax-Update-Ids' content=''>
      warn[22:34:31,575]: No information in  response about elements to replace
      debug[22:34:31,583]: call  selectSingleNode for id= org.ajax4jsf.oncomplete
      debug[22:34:31,591]: Processing  updates finished, no oncomplete function to call
      debug[22:34:31,599]: call  selectSingleNode for id= ajax-view-state
      debug[22:34:31,607]: Hidden JSF state  fields:
      debug[22:34:31,615]: Namespace for  hidden view-state input fields is undefined
      debug[22:34:31,623]: search for  elements by name 'input'  in element span
      debug[22:34:31,631]: Replace value for  inputs: 10 by new values: 1
      debug[22:34:31,639]: Input in  response: javax.faces.ViewState
      debug[22:34:31,648]: Found same input  on page with type: hidden
      debug[22:34:31,656]: Found same input  on page with type: hidden
      debug[22:34:31,664]: search for  elements by name 'INPUT'  in element span
      debug[22:34:31,672]: Replace value for  inputs: 10 by new values: 0
      debug[22:34:31,681]: call  selectSingleNode for id= _ajax:data
      debug[22:34:31,689]: call  selectSingleNode for id= _A4J.AJAX.focus
      debug[22:34:31,697]: No focus  information in response