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/28 23:41:19 UTC
svn commit: r1097622 - in /myfaces/trinidad/branches/1.2.12.5.0-branch: ./
trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/
trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/
trinidad-sandbox/sandbox-api/src/ma...
Author: arobinson74
Date: Thu Apr 28 21:41:19 2011
New Revision: 1097622
URL: http://svn.apache.org/viewvc?rev=1097622&view=rev
Log:
Merge of trunk SVN revisions 1096803, 1096816 and 1096825 for TRINIDAD-2047
Modified:
myfaces/trinidad/branches/1.2.12.5.0-branch/ (props changed)
myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java
myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java
myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java
myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/ (props changed)
myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event/ (props changed)
Propchange: myfaces/trinidad/branches/1.2.12.5.0-branch/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Apr 28 21:41:19 2011
@@ -4,4 +4,4 @@
/myfaces/trinidad/branches/1.2.9.1-branch:697924,699406,699496
/myfaces/trinidad/branches/TRINIDAD-1402:745675
/myfaces/trinidad/branches/jwaldman_StyleMap:754977-770778
-/myfaces/trinidad/trunk:894885,915962,962582,1002826,1031716,1076418
+/myfaces/trinidad/trunk:894885,915962,962582,1002826,1031716,1076418,1096803,1096816,1096825
Modified: myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java?rev=1097622&r1=1097621&r2=1097622&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java (original)
+++ myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java Thu Apr 28 21:41:19 2011
@@ -55,6 +55,15 @@ import org.apache.myfaces.trinidad.model
abstract public class UIXTableTemplate extends UIXIteratorTemplate
implements CollectionComponent
{
+/**/ static public final FacesBean.Type TYPE = new FacesBean.Type(UIXIterator.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);
/**
@@ -422,8 +431,17 @@ abstract public class UIXTableTemplate e
state[1] = super.__getMyStampState();
state[2] = Integer.valueOf(getFirst());
state[3] = Boolean.valueOf(isShowAll());
- state[4] = getSelectedRowKeys();
- state[5] = 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[4] = selectedRowKeys;
+ state[5] = disclosedRowKeys;
+
return state;
}
@@ -536,6 +554,25 @@ abstract public class UIXTableTemplate e
@Override
public Object getProperty(PropertyKey key)
{
+ 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.
+ return 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.
+ return super.getProperty(SELECTED_ROW_KEYS_KEY);
+ }
+
Object value = super.getProperty(key);
if (key == DISCLOSED_ROW_KEYS_KEY)
{
Modified: myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java?rev=1097622&r1=1097621&r2=1097622&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java (original)
+++ myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java Thu Apr 28 21:41:19 2011
@@ -56,6 +56,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)
{
@@ -170,8 +180,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;
}
@@ -210,6 +229,25 @@ abstract public class UIXTreeTemplate ex
@Override
public Object getProperty(PropertyKey key)
{
+ 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.
+ return 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.
+ return super.getProperty(SELECTED_ROW_KEYS_KEY);
+ }
+
Object value = super.getProperty(key);
if (key == DISCLOSED_ROW_KEYS_KEY)
{
Modified: myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java?rev=1097622&r1=1097621&r2=1097622&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java (original)
+++ myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java Thu Apr 28 21:41:19 2011
@@ -770,6 +770,11 @@ public abstract class UIXCollection exte
/**
* Gets the currencyObject to setup the rowData to use to build initial
* stamp state.
+ * <p>
+ * This allows the collection model to have an initial row key outside of the UIComponent.
+ * Should the model be at a row that is not the first row, the component will restore the row
+ * back to the initial row key instead of a null row key once stamping is done.
+ * </p>
*/
private Object _getCurrencyKeyForInitialStampState()
{
@@ -1466,11 +1471,15 @@ public abstract class UIXCollection exte
FacesContext context = getFacesContext();
Object currencyObj = getRowKey();
- // TRINIDAD-2047: we do not need to save stamp state if there is no active stamp
- if (currencyObj == null)
- {
- return;
- }
+ // Note: even though the currencyObj may be null, we still need to save the state. The reason
+ // is that the code does not clear out the state when it is saved, instead, the un-stamped
+ // state is saved. Once the row key is set back to null, this un-stamped state is restored
+ // onto the children components. This restoration allows editable value holders, show detail
+ // items and nested UIXCollections to clear their state.
+ // For nested UIXCollections, this un-stamped state is required to set the nested collection's
+ // _state (internal state containing the stamp state) to null when not on a row key. Without
+ // that call, the nested UIXCollection components would end up sharing the same stamp state
+ // across parent rows.
int position = 0;
for(UIComponent stamp : getStamps())
Propchange: myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Apr 28 21:41:19 2011
@@ -3,4 +3,4 @@
/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component:895708
/myfaces/trinidad/branches/1.2.9.1-branch/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component:699406,699496
/myfaces/trinidad/branches/TRINIDAD-1402/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component:745675
-/myfaces/trinidad/trunk/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component:894885,915962,962582,1002826,1031716,1076418
+/myfaces/trinidad/trunk/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component:894885,915962,962582,1002826,1031716,1076418,1096803,1096816,1096825
Propchange: myfaces/trinidad/branches/1.2.12.5.0-branch/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Apr 28 21:41:19 2011
@@ -3,4 +3,4 @@
/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event:895708
/myfaces/trinidad/branches/1.2.9.1-branch/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event:699406,699496
/myfaces/trinidad/branches/TRINIDAD-1402/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event:745675
-/myfaces/trinidad/trunk/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event:894885,915962,962582,1002826,1031716,1076418
+/myfaces/trinidad/trunk/trinidad-sandbox/sandbox-api/src/main/java/org/apache/myfaces/trinidad/sandbox/event:894885,915962,962582,1002826,1031716,1076418,1096803,1096816,1096825