You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ar...@apache.org on 2011/04/26 19:40:37 UTC
svn commit: r1096821 - in /myfaces/trinidad/branches/trinidad-1.2.x: ./
trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java
Author: arobinson74
Date: Tue Apr 26 17:40:36 2011
New Revision: 1096821
URL: http://svn.apache.org/viewvc?rev=1096821&view=rev
Log:
TRINIDAD-2047 - apply the new fix to the tree as well
Modified:
myfaces/trinidad/branches/trinidad-1.2.x/ (props changed)
myfaces/trinidad/branches/trinidad-1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java
Propchange: myfaces/trinidad/branches/trinidad-1.2.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Apr 26 17:40:36 2011
@@ -8,4 +8,4 @@
/myfaces/trinidad/branches/anrobins_1.2.12.3_visitTree_3:984258-984269
/myfaces/trinidad/branches/anrobins_1.2.12.3_visitTree_4:984270-988607
/myfaces/trinidad/branches/jwaldman_StyleMap:754977-770778
-/myfaces/trinidad/trunk:930425,932153,1002826,1031716,1076418,1096803
+/myfaces/trinidad/trunk:930425,932153,1002826,1031716,1076418,1096803,1096816
Modified: myfaces/trinidad/branches/trinidad-1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java?rev=1096821&r1=1096820&r2=1096821&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java (original)
+++ myfaces/trinidad/branches/trinidad-1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java Tue Apr 26 17:40:36 2011
@@ -59,6 +59,16 @@ abstract public class UIXTreeTemplate ex
/**/ static public final PropertyKey DISCLOSED_ROW_KEYS_KEY = null;
/**/ static public final PropertyKey SELECTED_ROW_KEYS_KEY = null;
+/**/ static public final FacesBean.Type TYPE = new FacesBean.Type(org.apache.myfaces.trinidad.component.UIXHierarchy.TYPE);
+
+ // These are "fake" properties that allow the table to get the disclosed row keys and the
+ // selected row key without triggering the call to getCollectionModel from the
+ // RowKeyFacesBeanWrapper class. See the stamp state saving code for its usage.
+ static private final PropertyKey _DISCLOSED_ROW_KEYS_WITHOUT_MODEL_KEY =
+ TYPE.registerKey("disclosedRowKeysWithoutModel", RowKeySet.class);
+ static private final PropertyKey _SELECTED_ROW_KEYS_WITHOUT_MODEL_KEY =
+ TYPE.registerKey("selectedRowKeysWithoutModel", RowKeySet.class);
+
@Deprecated
public void setRowDisclosureListener(MethodBinding binding)
{
@@ -192,8 +202,17 @@ abstract public class UIXTreeTemplate ex
Object[] state = new Object[4];
state[0] = super.__getMyStampState();
state[1] = getFocusRowKey();
- state[2] = getSelectedRowKeys();
- state[3] = getDisclosedRowKeys();
+
+ // Use "hidden" property keys to allow the row key sets to be retrieved without the
+ // RowKeyFacesBeanWrapper trying to resolve the collection model to be set into the row key
+ // set. This is needed to stop the unnecessary lookup of the collection model when it is not
+ // needed during stamp state saving of the table.
+ RowKeySet selectedRowKeys = (RowKeySet)getProperty(_SELECTED_ROW_KEYS_WITHOUT_MODEL_KEY);
+ RowKeySet disclosedRowKeys = (RowKeySet)getProperty(_DISCLOSED_ROW_KEYS_WITHOUT_MODEL_KEY);
+
+ state[2] = selectedRowKeys;
+ state[3] = disclosedRowKeys;
+
return state;
}
@@ -275,6 +294,24 @@ abstract public class UIXTreeTemplate ex
}
}
}
+ else if (key == _DISCLOSED_ROW_KEYS_WITHOUT_MODEL_KEY)
+ {
+ // This case is only true if the table is trying to serialize the disclosed row keys to
+ // the stamp state of a parent UIXCollection. This work-around prevents EL evaluation to
+ // get the collection model during stamp state saving. This should be permissible as the
+ // state saving code does not need the collection model to be set in the row key set in
+ // order to save its state.
+ value = super.getProperty(DISCLOSED_ROW_KEYS_KEY);
+ }
+ else if (key == _SELECTED_ROW_KEYS_WITHOUT_MODEL_KEY)
+ {
+ // This case is only true if the table is trying to serialize the selected row keys to
+ // the stamp state of a parent UIXCollection. This work-around prevents EL evaluation to
+ // get the collection model during stamp state saving. This should be permissible as the
+ // state saving code does not need the collection model to be set in the row key set in
+ // order to save its state.
+ value = super.getProperty(SELECTED_ROW_KEYS_KEY);
+ }
return value;
}