Hide: target.addJavaScript("document.getElementById('" + component.getMarkupId() + "').style.display='none';");
Show: target.addJavaScript("document.getElementById('" + component.getMarkupId() + "').style.display='';"); It doesn't remove the component from the output stream, it just manipulates the style of the tag itself. Martijn On 8/31/06, Ingram Chen <[EMAIL PROTECTED]> wrote: > 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">..... > </div> > </div> > > 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">..... > </div> > > 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 > Java [EMAIL PROTECTED] > 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 > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > -- Download Wicket 1.2.2 now! New Ajax components: Tree, TreeTable and ModalWindow -- http://wicketframework.org ------------------------------------------------------------------------- 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 http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user