[richfaces-issues] [JBoss JIRA] Created: (RF-4931) Tree Adaptors: ClassCastException in StackingTreeModel

Nick Belaevski (JIRA) jira-events at lists.jboss.org
Thu Nov 13 21:02:36 EST 2008


Tree Adaptors: ClassCastException in StackingTreeModel
------------------------------------------------------

                 Key: RF-4931
                 URL: https://jira.jboss.org/jira/browse/RF-4931
             Project: RichFaces
          Issue Type: Patch
    Affects Versions: 3.1.x
            Reporter: Nick Belaevski


ClassCastException in StackingTreeModel.java:137 

Method doSetupKey throws classCastException for one of the scenario.
 
Steps:-
Search items so that we get Tree(richfaces) list on page.
Delete the one of the node from tree (ajax delete)
After that we tried to reset the search parameters (They are in different a4j:region than the tree) by clicking on Reset button
which means we had to rerender tree for reset operation.
While rerendering the tree we got class cast exception. at line 137.
 
Following is the code we fixed in our project.
 
protected StackingTreeModel doSetupKey(Iterator<Key> keyIterator, Iterator<StackEntry> entriesIterator, FacesContext context, Object modelKey) {
 if (modelKey != null) {
  if (!setupModel(modelKey, context)) {
   //no key is available
   leaveModel(getRoot().stackEntries.iterator(), null, context);
   return null;
  }
  
  //TODO what's here?
 }
 
 if (keyIterator != null && keyIterator.hasNext()) {
  //Patch added by Atul
  Object obj = keyIterator.next();
  if(obj == null || !(obj instanceof Key)) {
   leaveModel(entriesIterator, null, context);
   return this;
  }
  Key key = (Key)obj;
  //Patch ends by Atul
  //Following is orginal code commented by Atul for above patch. 
  //Key key = keyIterator.next();



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the richfaces-issues mailing list