You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2010/01/04 15:17:50 UTC
svn commit: r895632 -
/myfaces/trinidad/branches/trinidad-2.0.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
Author: matzew
Date: Mon Jan 4 14:17:49 2010
New Revision: 895632
URL: http://svn.apache.org/viewvc?rev=895632&view=rev
Log:
minior change on the set Parent method; when adding a component, we set the reference before we process the event stuff; on removal we set the new reference after doing the event stuff
Modified:
myfaces/trinidad/branches/trinidad-2.0.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
Modified: myfaces/trinidad/branches/trinidad-2.0.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-2.0.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java?rev=895632&r1=895631&r2=895632&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-2.0.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java (original)
+++ myfaces/trinidad/branches/trinidad-2.0.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java Mon Jan 4 14:17:49 2010
@@ -406,14 +406,20 @@
public void setParent(UIComponent parent)
{
// do we add this component ?
- if (parent != null && parent.isInView())
+ if (parent != null)
{
- // trigger the ADD_EVENT and call setInView(true)
- // recursive for all kids/facets...
- // Application.publishEvent(java.lang.Class, java.lang.Object) must be called, passing
- // PostAddToViewEvent.class as the first argument and the newly added component as the second
- // argument.
- _publishPostAddToViewEvent(getFacesContext(), this);
+ // set the reference
+ _parent = parent;
+
+ if (parent.isInView())
+ {
+ // trigger the ADD_EVENT and call setInView(true)
+ // recursive for all kids/facets...
+ // Application.publishEvent(java.lang.Class, java.lang.Object) must be called, passing
+ // PostAddToViewEvent.class as the first argument and the newly added component as the second
+ // argument.
+ _publishPostAddToViewEvent(getFacesContext(), this);
+ }
}
else
{
@@ -424,8 +430,10 @@
// doing this => recursive
_publishPreRemoveFromViewEvent(getFacesContext(), this);
}
+
+ // (un)set the reference
+ _parent = parent;
}
- _parent = parent;
}
@Override