Author: ivaynberg
Date: Thu Oct 8 17:35:57 2009
New Revision: 823240
URL: http://svn.apache.org/viewvc?rev=823240&view=rev
Log:
WICKET-2513 enclosure would sometimes incorrectly make a hidden component
visible
Issue: WICKET-2513
Modified:
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/internal/Enclosure.java
Modified:
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/internal/Enclosure.java
URL:
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/internal/Enclosure.java?rev=823240&r1=823239&r2=823240&view=diff
==============================================================================
---
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/internal/Enclosure.java
(original)
+++
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/markup/html/internal/Enclosure.java
Thu Oct 8 17:35:57 2009
@@ -198,9 +198,16 @@
if (tag.isAutoComponentTag() == false)
{
final Component child =
container.get(tag.getId());
- // record original visiblity allowed value,
will restore later
- changes.put(child, child.isVisibilityAllowed());
- child.setVisibilityAllowed(isVisible());
+ final boolean childVisibility =
child.isVisibilityAllowed();
+
+ // we only apply visibility changes to hide a
component, otherwise it would be
+ // possible to unhide a component which should
be hidden
+ if (!isVisible() && childVisibility)
+ {
+ // record original visiblity allowed
value, will restore later
+ changes.put(child, childVisibility);
+ child.setVisibilityAllowed(false);
+ }
}
}
it.rewind();