Hi,
In the current implementation, going from setVisible(false) to setVisible(true) in ajax does not work, The current workaround of this bug is to surround the element with an other and to rerender the surounding element. I found this way not very smart and too frustating for the user. We actually need to surounding because nothing is render when setVisible is false.

In https://issues.apache.org/jira/browse/WICKET-365 issue, I propose a fix. This fix will simply render a tag with an id and a style display:none. I don't think it is very expensive and works well with all browsers (IE, FF, Safari) and also in html table (often a problem in IE). With this patch it is possible to change the visibility of a component in a page without surounding it and adding it to the target. This issue has been tagged as won't fix, But I still think it is a good stuff

For exemple a template(1) with foo.setVisible(false) and bar.setVisible(false) will be render as (2). See https://issues.apache.org/jira/secure/attachment/12353204/Component.patch.txt

(1)
<div wicket:id="bar">
   <div>Inner</div>
   <p>lsdkqjlqkdsfj</p>
   ... a lot of inner content
</div>
<table>
    <tr>
      <td>
            ....
      </td>
   </tr>
   <tr wicket:id="foo">
      <td>bla bla</td>
   </tr>
</table>



(2)
<div id="bar0" style="display:none"></div>
<table>
    <tr>
      <td>
            ....
      </td>
   </tr>
   <tr id="foo1" style="display:none"></tr>
</table>

I think this patch can make setVisible(false -> true) in ajax smarter and more intuitive for user.

WDYT?



Reply via email to