Author: ivaynberg
Date: Thu Oct 8 17:34:13 2009
New Revision: 823238
URL: http://svn.apache.org/viewvc?rev=823238&view=rev
Log:
WICKET-2513 enclosure would sometimes make hidden components visible
Issue: WICKET-2513
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/internal/Enclosure.java
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/internal/Enclosure.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/internal/Enclosure.java?rev=823238&r1=823237&r2=823238&view=diff
==============================================================================
---
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/internal/Enclosure.java
(original)
+++
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/internal/Enclosure.java
Thu Oct 8 17:34:13 2009
@@ -196,10 +196,16 @@
if (tag.isAutoComponentTag() == false)
{
final Component child =
container.get(tag.getId());
+ final boolean childVisibility =
child.isVisibilityAllowed();
- // record original visiblity allowed value,
will restore later
- changes.put(child, child.isVisibilityAllowed());
- child.setVisibilityAllowed(isVisible());
+ // 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();