0 Replies Latest reply on Feb 5, 2008 12:17 PM by freemarket

    JBDS hung in javascript loop (richfaces 3.1.4GA)

    freemarket

      Hi,

      Javascript Error popup is:

      A runtime error has occurred.
      Do you with to Debug?

      Line: 0
      Error: 'Position' is null or not an object

      this is JBDS 1.0.0.GA running on Windows XP-32bit using JRE 1.5.0_14.

      There is a thread on nabble that refers to this as well tracing back to a
      component of scriptaculous:

      http://www.nabble.com/-WicketStuff-Scriptaculous--DragNDrop-problem-in-IE6-IE7.-tt15128482.html#a15291546

      I have posted a reference to the jboss tool and to the richfaces links on that forum in the hope that both communities can solve this issue.

      This comes about in the context of a scrollable data table, which mostly works using richfaces 3.1.4 GA. I will post those details to the richfaces users forum to not waste bandwidth here.

      This is reproducible. xhtml for scrollabledataTable follows:

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:a4j="http://richfaces.org/a4j">
      
      
      <rich:scrollableDataTable id="approveList" rows="15" var="charmrec" height="400px"
       rowKeyVar="rkv" width="753" value="#{approvalsCrudBean.myDataList}" selection="#{approveTblBean.selection}">
       <a4j:support event="onRowDblClick" action="#{approveTblBean.takeSelection}" oncomplete="javascript:Richfaces.showModalPanel('approveEnter');"/>
       <rich:column id="approveRelrequest">
       <f:facet name="header"><h:outputText styleClass="headerText" value="Request #"/></f:facet>
       <h:outputText value="#{charmrec.id}"/>
       </rich:column>
       <rich:column id="approveSummary">
       <f:facet name="header"><h:outputText styleClass="headerText" value="Summary"/></f:facet>
       <h:outputText value="#{charmrec.summary}"/>
       </rich:column>
       <rich:column id="approveEnv">
       <f:facet name="header"><h:outputText styleClass="headerText" value="Env"/></f:facet>
       <h:outputText value="#{charmrec.env}"/>
       </rich:column>
       <rich:column id="approveType">
       <f:facet name="header"><h:outputText styleClass="headerText" value="Type"/></f:facet>
       <h:outputText value="#{charmrec.type}"/>
       </rich:column>
       <rich:column id="approveStatus">
       <f:facet name="header"><h:outputText styleClass="headerText" value="Status"/></f:facet>
       <h:outputText value="#{charmrec.status}"/>
       </rich:column>
       <rich:column id="approveSignedby">
       <f:facet name="header"><h:outputText styleClass="headerText" value="Signer"/></f:facet>
       <h:outputText value="#{charmrec.signedby}"/>
       </rich:column>
       </rich:scrollableDataTable>
       <rich:modalPanel id="approveEnter">
       <f:facet name="header">
       <h:outputText value="Approve Deployment"/>
       </f:facet>
       <f:facet name="controls">
       <span style="cursor:pointer" onclick="javascript:Richfaces.hideModalPanel('approveEnter')">X</span>
       </f:facet>
       <rich:dataTable id="approveTable" value="#{approveTblBean.selectedDeploys}" var="sel">
       <rich:column id="approveEnv">
       <f:facet name="header"><h:outputText styleClass="headerText" value="Env"/></f:facet>
       <h:outputText value="#{sel.env}"/>
       </rich:column>
       <rich:column id="approveType">
       <f:facet name="header"><h:outputText styleClass="headerText" value="Type"/></f:facet>
       <h:outputText value="#{sel.type}"/>
       </rich:column>
       <rich:column id="approveSignedBy">
       <f:facet name="header"><h:outputText styleClass="headerText" value="Signer"/></f:facet>
       <h:outputText value="#{sel.signedby}"/>
       </rich:column>
       </rich:dataTable>
       </rich:modalPanel>
      </ui:composition>


      The approveTblBean code follows:

      /**
       *
       */
      package com.ml.beans;
      
      import java.math.BigDecimal;
      import java.util.ArrayList;
      import java.util.Arrays;
      import java.util.Iterator;
      import java.util.List;
      import java.util.Random;
      
      import com.ml.dbdto.CharmsDerived;
      import com.ml.dbobj.*;
      import com.ml.util.FacesUtil;
      
      import org.richfaces.model.ScrollableTableDataModel.SimpleRowKey;
      import org.richfaces.model.selection.SimpleSelection;
      
      public class ApproveTblBean {
       private SimpleSelection selection = new SimpleSelection();
       private ArrayList<CharmsApprovalsVw> selectedDeploys = new ArrayList<CharmsApprovalsVw>();
      
       private List <CharmsApprovalsVw> allDeploys = null;
      
       public List <CharmsApprovalsVw> getAllDeploys() {
       synchronized (this) {
       if (allDeploys == null) {
       ApprovalsCrudBean approvdata = (ApprovalsCrudBean)FacesUtil.getSessionMapValue("approvalsCrudBean");
       allDeploys = (List<CharmsApprovalsVw>)approvdata.getMyDataList();
       }
       }
      
       return allDeploys;
       }
      
       public SimpleSelection getSelection() {
       return selection;
       }
      
       public void setSelection(SimpleSelection selection) {
       System.out.println("Setting Started");
       this.selection = selection;
       System.out.println("Setting Complete");
       }
      
       public String takeSelection() {
       getSelectedDeploys().clear();
       Iterator<SimpleRowKey> iterator = getSelection().getKeys();
       while (iterator.hasNext()){
       SimpleRowKey key = iterator.next();
       getSelectedDeploys().add(getAllDeploys().get(key.intValue()));
       }
       return null;
       }
      
       public ArrayList<CharmsApprovalsVw> getSelectedDeploys() {
       return selectedDeploys;
       }
      
       public void setSelectedDeploys(ArrayList<CharmsApprovalsVw> selectedDeploys) {
       this.selectedDeploys = selectedDeploys;
       }
      }
      


      I am able to retrieve my data from the DAO, put in up in the datascrollabletable, double click on a row and get that selection to popup.
      After closing the modalPanel, I double click on another row and then
      I go into the nasty javascript error as per above.

      Any tips? I suspect this is within the larger scope of my application. Also I note that the rows of the scrollabledatatable are shifted to the right. They are rendered under the header facets and then they jump rightwards.

      Web.xml follows:

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
       <description>Change Release Mgmgt</description>
       <display-name>charms</display-name>
       <context-param>
       <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
       <param-value>.xhtml</param-value>
       </context-param>
       <context-param>
       <param-name>facelets.REFRESH_PERIOD</param-name>
       <param-value>2</param-value>
       </context-param>
       <context-param>
       <param-name>facelets.DEVELOPMENT</param-name>
       <param-value>true</param-value>
       </context-param>
       <context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>server</param-value>
       </context-param>
       <context-param>
       <param-name>com.sun.faces.validateXml</param-name>
       <param-value>true</param-value>
       </context-param>
       <context-param>
       <param-name>com.sun.faces.verifyObjects</param-name>
       <param-value>true</param-value>
       </context-param>
       <context-param>
       <param-name>org.ajax4jsf.SKIN</param-name>
       <param-value>#{skinBean.skin}</param-value>
       </context-param>
       <context-param>
       <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
       <param-value>com.sun.facelets.FaceletViewHandler</param-value>
       </context-param>
       <context-param>
       <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
       <param-value>true</param-value>
       </context-param>
       <context-param>
       <param-name>org.ajax4jsf.COMPRESS_STYLE</param-name>
       <param-value>false</param-value>
       </context-param>
       <context-param>
       <param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
       <param-value>NEKO</param-value>
       </context-param>
       <context-param>
       <param-name>org.richfaces.LoadScriptStrategy</param-name>
       <param-value>DEFAULT</param-value>
       </context-param>
       <filter>
       <display-name>Ajax4jsf Filter</display-name>
       <filter-name>ajax4jsf</filter-name>
       <filter-class>org.ajax4jsf.Filter</filter-class>
       </filter>
       <filter-mapping>
       <filter-name>ajax4jsf</filter-name>
       <servlet-name>Faces Servlet</servlet-name>
       <dispatcher>FORWARD</dispatcher>
       <dispatcher>REQUEST</dispatcher>
       <dispatcher>INCLUDE</dispatcher>
       <dispatcher>ERROR</dispatcher>
       </filter-mapping>
       <servlet>
       <servlet-name>Faces Servlet</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet>
       <servlet-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>*.jsf</url-pattern>
       </servlet-mapping>
       <login-config>
       <auth-method>BASIC</auth-method>
       </login-config>
      </web-app>


      Regards,
      Henry