]
Nick Belaevski updated RF-4931:
-------------------------------
Fix Version/s: 3.1.x
Assignee: Nick Belaevski
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
Assignee: Nick Belaevski
Fix For: 3.1.x
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: