2 Replies Latest reply on Sep 23, 2009 2:19 PM by Snow White CC

    ClassCastException

    Snow White CC Newbie

      Hi,

      I am getting a "java.lang.ClassCastException" when invoking action listener for a component.
      Error is:

      SEVERE: java.lang.ClassCastException: java.util.ArrayList cannot be cast to javax.faces.model.DataModel
      


      My Action Listener code is
      public void isValidAccess(ActionEvent event) {
       UIComponent component = event.getComponent();
       System.out.println("Action Listener from Id: " + component.getId());
       isValid = AccessManager.checkElementIdAccess(identity
       .getUsername(),"editId");
      


      and my facelet page is
       <rich:dataTable value="#{lstSoHeaders}" var="item" id="table" rows="25">
       <rich:column sortBy="#{item.soNumber}" >
       <f:facet name="header">SO #</f:facet>
      
       <a4j:commandLink id="editId" actionListener="#{module1Manager.isValidAccess}" action="#{module1Manager.editModule}" value="#{item.soNumber}" reRender="table"/>
      
      
       </rich:column>
       <rich:column>
       <f:facet name="header">Entry Date</f:facet>
       <h:outputText value="#{item.entryDate}"/>
       </rich:column>
       ............
       <rich:column>
       <f:facet name="header">CompanyName</f:facet>
       <h:outputText value="#{item.companyName}" />
       </rich:column>
       <f:facet name="footer">
       <rich:datascroller for="table" maxPages="8">
       <f:facet name="first">
       <h:outputText value="First" />
       </f:facet>
       <f:facet name="last">
       <h:outputText value="Last" />
       </f:facet>
       </rich:datascroller>
       </f:facet>
       </rich:dataTable>
      


      I did not understand why I am getting this error. Can anyone please help.

      Thanks