1 Reply Latest reply on Feb 27, 2008 2:11 PM by aish

    Error 'ClientUI' is undefined  - during <rich:scrollabledata

    aish

      Hi,

      I have a web page and its layout is as given in index.jsp

      Depending on the menu item selected, the corresponding page is displayed in the "centerGrid" outputPanel. Things are working fine for the various menu item. For one of the menu item, I display the datalist using <rich:scrollabledataTable>. I tested this scrollabledataTable and it is working perfectly as a standalone page. When I call this page using the menu item, I get the error "Error: ClientUI is undefined". I do not know what I am missing and where I am wrong as this page works fine as a standalone page.

      Please let me know where I am going wrong.

      Here is the index.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"%>


      default-menu
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">



      <f:view>

      <h:form id="myForm">

      <h:panelGrid id="mainGrid" columns="1" style="width:900px;height:550px;" border="1">

      <h:panelGrid id="headerGrid" columns="1" style="width:100%;height:100px;valign:top;" border="0">
      </h:panelGrid>

      <h:panelGrid id="menuGrid" columns="2"
      style="width:100%;height:370px;valign:top;" border="1">

      <a4j:include viewId="/default-menu.jsp" />

      <a4j:outputPanel id="centerGrid" >
      <h:panelGrid id="contentGrid" columns="1" border="0"
      style="width:775px;height:100%;valign:top;">

      <a4j:include viewId="#{UINavigation.address}" id="viewLink">
      </a4j:include>
      </h:panelGrid>
      </a4j:outputPanel>

      </h:panelGrid>

      <h:panelGrid id="footerGrid" columns="1" style="width:100%;height:80px;valign:top;" border="1">
      <a4j:include viewId="/pageFooter.jsp" />
      </h:panelGrid>

      </h:panelGrid>



      </h:form>

      </f:view>




      The scrollabledataTable page is
      =================

      <%@ 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"%>

      <rich:scrollableDataTable rowKeyVar="rkv"
      frozenColCount="1" height="210px"
      width="775px" id="test" value="#{TableDetail.dissummarytbl}"
      var="category" sortMode="single"
      selection="#{TableDetail.scrollableDataTableSelection}"
      binding="#{TableDetail.sdTable}"
      focus="test" onRowClick="RowClick()" >


      <rich:column id="Status">
      <f:facet name="header">
      <h:outputText value="Status" />
      </f:facet>
      <h:outputText value="#{category.status}" />
      </rich:column>

      </rich:scrollableDataTable>
      <rich:spacer height="20px" id="space1"></rich:spacer>
      <a4j:commandButton id="cmdButton" value="." reRender="table" style="width:0px;height:0px"
      action="#{TableDetail.takeSelection}" immediate="true"/>

      <a4j:outputPanel id="table" >

      <h:outputText value="Summary Table Details : " />
      <rich:spacer height="5px" id="space2"></rich:spacer>

      <rich:dataTable value="#{TableDetail.selectedRecSummaryDetails}" var="sumdetail">
      <rich:column>
      <f:facet name="header">
      <h:outputText value="file_id" /></f:facet>
      <h:outputText value="#{sumdetail.file_id}" />
      </rich:column>
      <rich:column>

      </rich:dataTable>



      </a4j:outputPanel>


      =====

      The bean dissummarytbl used to get the list for the scrollabledatatable is as follows:
      =======

      public List getDissummarytbl() throws SQLException, NamingException
      {

      if (datasource == null)
      {
      assignDataSource(tdsDataSourceName, "TDS");
      }


      Connection conn=null;
      try
      {
      conn = datasource.getConnection();





      Statement summaryTblStmt=conn.createStatement();
      String sSql = "select status, ml_sti_file_id,ml_sti_src_sys_cd, formatcategory,ml_sti_srcsys_dttm,ml_sti_cycle_cd, ml_sti_load_dttm from TDSADMIN.summary_tbl where rownum<20";
      ResultSet summaryTblResult = summaryTblStmt.executeQuery(sSql);

      this.datalist = new ArrayList();

      while (summaryTblResult.next())
      {
      Summary SummInfo = new Summary();

      SummInfo.setStatus(summaryTblResult.getString("STATUS"));
      SummInfo.setMl_sti_file_id(summaryTblResult.getString("ml_sti_file_id"));
      SummInfo.setMl_sti_src_sys_cd(summaryTblResult.getString("ml_sti_src_sys_cd"));
      SummInfo.setFormatcategory(summaryTblResult.getString("formatcategory"));
      SummInfo.setMl_sti_srcsys_dttm(summaryTblResult.getString("ml_sti_srcsys_dttm"));
      SummInfo.setMl_sti_cycle_cd(summaryTblResult.getString("ml_sti_cycle_cd"));
      SummInfo.setMl_sti_load_dttm(summaryTblResult.getString("ml_sti_load_dttm"));

      this.datalist.add(SummInfo);


      // if (summaryTblResult.getRow() == 1 && (!rowSelected) ) /* !rowSelected was added for row selectin using pagination */
      if (summaryTblResult.getRow() == 1 )
      {
      selectedRecStatus = summaryTblResult.getString("STATUS");
      selectedRecml_sti_file_id = summaryTblResult.getString("ml_sti_file_id");
      selectedRecml_sti_src_sys_cd = summaryTblResult.getString("ml_sti_src_sys_cd");
      selectedRecformatcategory = summaryTblResult.getString("formatcategory");
      selectedRecml_sti_srcsys_dttm=summaryTblResult.getString("ml_sti_srcsys_dttm");
      selectedRecml_sti_cycle_cd=summaryTblResult.getString("ml_sti_cycle_cd");
      selectedRecml_sti_load_dttm=summaryTblResult.getString("ml_sti_load_dttm");

      }

      }

      return this.datalist;
      }

      catch(SQLException e)
      {
      //FacesContext context = FacesContext.getCurrentInstance();
      //context.addMessage(null, new FacesMessage("Exception executing in this query: " + e));
      e.printStackTrace();

      }
      finally
      {
      try
      {
      conn.close();
      }

      catch (SQLException e)
      {
      System.out.println("Exception occured while closing connection\n");
      e.printStackTrace();
      }
      }

      return this.datalist;
      }

        • 1. Re: Error 'ClientUI' is undefined  - during <rich:scrollable
          aish

          With reference to my previous post, I debugged the code and came to know that the error occured at the below statement.

          Can you please take a look at the below line and let me know why I am getting the error - "Error : ClientUI not defined"

          Thanks a lot

          Aish



          window.Richfaces_ScrollableGrid_myForm__id8_test = new ClientUI.controls.grid.ScrollableGrid({'client_id':'myForm:_id8:test','columnsCount':7,'ids':['Status','formatcategory','ml_sti_file_id','ml_sti_src_sys_cd','ml_sti_srcsys_dttm','ml_sti_cycle_cd','ml_sti_load_dttm'] ,'hideWhenScrolling':false,'onSortAjaxUpdate':function(event){A4J.AJAX.Submit('_viewRoot','myForm',event,{'parameters':{'myForm:_id8:test:sortStartRow':event.startRow,'myForm:_id8:test:sortOrder':event.order,'myForm:_id8:test':'myForm:_id8:test','myForm:_id8:test:sortIndex':event.index,'myForm:_id8:test:sortColumn':event.column} ,'actionUrl':'/Run/index.faces?javax.portlet.faces.DirectLink=true','oncomplete':function(request,event,data){window.Richfaces_ScrollableGrid_myForm__id8_test.onSortComplete(request,event,data)}} ); return false;},'rowsCount':0,'selectionInput':'myForm:_id8:test:s'} );