You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mc...@apache.org on 2008/01/22 20:00:42 UTC
svn commit: r614285 -
/myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java
Author: mcooper
Date: Tue Jan 22 11:00:37 2008
New Revision: 614285
URL: http://svn.apache.org/viewvc?rev=614285&view=rev
Log:
TRINIDAD-914 Selected and disclosed row key sets in UIXTableTemplate.java are assumed to be non-null
Added checks in UIXTableTemplate.createCollectionModel() for null selectedRowKeys and disclosedRowKeys before invoking methods on them respectively so that it will not throw any NPEs.
Modified:
myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java
Modified: myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java?rev=614285&r1=614284&r2=614285&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java (original)
+++ myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java Tue Jan 22 11:00:37 2008
@@ -311,8 +311,18 @@
{
CollectionModel model = super.createCollectionModel(current, value);
- getSelectedRowKeys().setCollectionModel(model);
- getDisclosedRowKeys().setCollectionModel(model);
+ RowKeySet selectedRowKeys = getSelectedRowKeys();
+ RowKeySet disclosedRowKeys = getDisclosedRowKeys();
+
+ if (selectedRowKeys != null)
+ {
+ selectedRowKeys.setCollectionModel(model);
+ }
+
+ if (disclosedRowKeys != null)
+ {
+ disclosedRowKeys.setCollectionModel(model);
+ }
// If we were perviously sorted, restore the sort order:
if (_sortCriteria != null)