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 2010/05/11 00:29:12 UTC
svn commit: r942933 - in /myfaces/trinidad/trunk/trinidad-api/src/main:
java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
xrts/org/apache/myfaces/trinidad/resource/LoggerBundle.xrts
Author: arobinson74
Date: Mon May 10 22:29:11 2010
New Revision: 942933
URL: http://svn.apache.org/viewvc?rev=942933&view=rev
Log:
Add a check for when getClientId is called that the parent of the component is set
Modified:
myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
myfaces/trinidad/trunk/trinidad-api/src/main/xrts/org/apache/myfaces/trinidad/resource/LoggerBundle.xrts
Modified: myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java?rev=942933&r1=942932&r2=942933&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java (original)
+++ myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java Mon May 10 22:29:11 2010
@@ -357,6 +357,16 @@ abstract public class UIXComponentBase e
if (clientId == null)
{
+ // This should not be called when the parent has not been set. Should it be
+ // called, the value will not be re-calculated correctly. This will be the case
+ // if someone attempts to invoke this function during facelets view construction.
+ if (_parent == null)
+ {
+ _LOG.warning("INVALID_CALL_TO_GETCLIENTID", getId());
+ // Return the value, even if not valid, for backward compatibility
+ return _calculateClientId(context);
+ }
+
clientId = _calculateClientId(context);
if (_usesFacesBeanImpl)
Modified: myfaces/trinidad/trunk/trinidad-api/src/main/xrts/org/apache/myfaces/trinidad/resource/LoggerBundle.xrts
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-api/src/main/xrts/org/apache/myfaces/trinidad/resource/LoggerBundle.xrts?rev=942933&r1=942932&r2=942933&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-api/src/main/xrts/org/apache/myfaces/trinidad/resource/LoggerBundle.xrts (original)
+++ myfaces/trinidad/trunk/trinidad-api/src/main/xrts/org/apache/myfaces/trinidad/resource/LoggerBundle.xrts Mon May 10 22:29:11 2010
@@ -459,5 +459,7 @@
<!-- UNZIP_STATE_FAILED -->
<resource key="UNZIP_STATE_FAILED">Failed to unzip the page state.</resource>
+<!-- INVALID_CALL_TO_GETCLIENTID -->
+<resource key="INVALID_CALL_TO_GETCLIENTID">getClientId should not be called while the view is being constructed. Component ID: {0}</resource>
</resources>