You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by de...@apache.org on 2017/09/17 12:30:48 UTC
[myfaces-trinidad] 25/36: The default for clientId caching was
accidentally true. Argh!! Fix case where the component is moved between
NamingContainers and therefore needs to clear the cached clientIds
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git
commit 42b48e360cd373aaa49ba1c4ea370685a4211374
Author: Blake Sullivan <bs...@apache.org>
AuthorDate: Tue Mar 2 03:34:30 2010 +0000
The default for clientId caching was accidentally true. Argh!! Fix case where the component is moved between NamingContainers and therefore needs to clear the cached clientIds
---
.../trinidad/component/UIXComponentBase.java | 24 +++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
index bf57526..ff71c3f 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
@@ -488,7 +488,25 @@ abstract public class UIXComponentBase extends UIXComponent
@Override
public void setParent(UIComponent parent)
{
- _parent = parent;
+ if (parent != _parent)
+ {
+ _parent = parent;
+
+ // clear cached client ids if necessary
+ if (_clientId != null)
+ {
+ String newClientId = _calculateClientId(FacesContext.getCurrentInstance());
+
+ // if our clientId changed as a result of being reparented (because we moved
+ // between NamingContainers for instance) then we need to clear out
+ // all of the cached client ids for our subtree
+ if (!_clientId.equals(newClientId))
+ {
+ clearCachedClientIds();
+ _clientId = newClientId;
+ }
+ }
+ }
}
@@ -1790,8 +1808,8 @@ abstract public class UIXComponentBase extends UIXComponent
if (cacheClientIds == null)
{
- // see if client is enabled for the application (the default is on)
- boolean cachingEnabled = !Boolean.TRUE.equals(
+ // see if client is enabled for the application (the default is off)
+ boolean cachingEnabled = Boolean.TRUE.equals(
context.getExternalContext().
getApplicationMap().get(_INIT_PROP_CLIENT_ID_CACHING_ENABLED));
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.