Hi all,

     As I tried more Ajax in my new project, I frequently encounter one feature:
use ajax to toggle specific block of tag visible/invisible. To do this, one may use:

<div wicket:id="domIdHolderComponent" >
    <div wicket:id="componentForVisibility">
            actual content here....
            <a wicket:id="foo" >...
            <span wicket:id="bar">.....

outer webMarkupContainer "domIdHolderComponent" is ajax target to re-render,
inner "componentForVisibility" is just to toggle visibilty of "content" in certain condition.

It is quite anony to I have to add two layers of WebMarkupContainers for this. This makes
code hardly readable. It would be better we have a new component, so we can do this:

<div wicket:id="domIdHolderAndToggleBodyVisibility" >
      actual content here....
      <a wicket:id="foo" >...
      <span wicket:id="bar">.....

I tried to write a reusable Border component to simulate but it is not work as I expect....
Could I write a component do reverse of setRenderBodyOnly:

class NewComponent {
     public isRenderTagOnly() {
           return // if false just render the tag without body, else render full body

With this it may save time to struggle with ajax dom id place holder.
Any hint to do this ? or a simpler way to solve ajax toggling visibility ?

Thanks in advance!
Ingram Chen
Institue of BioMedical Sciences Academia Sinica Taiwan
blog: http://www.javaworld.com.tw/roller/page/ingramchen
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Wicket-user mailing list

Reply via email to