Yeah, I do something similar. You can override the isVisible method in your components, possibly adding some logic that ties the visibility to a variable. You only have to manage the one variable then and all the components will know when to display or not.
On Fri, Jul 23, 2010 at 9:02 AM, Nivedan Nadaraj <[email protected]> wrote: > I have done the setVisible too for hiding components. Sometimes if there > were a group of them, placing them in a container(WebMarkupContainer) > and setting the visibility to t/f on the container works too. > > Cheers > Niv > > > On Fri, Jul 23, 2010 at 2:36 PM, Andrea Selva <[email protected]> wrote: > >> Hi, >> Instead of switching between components, i think that using the setVisible >> method of component class could be a better solution. This is the principle >> i read in the in Wicket in Action book when the want to hide a container of >> other thing. >> I hope this could help you >> Andrea >> >> On Thu, Jul 22, 2010 at 11:22 PM, mgoodson <[email protected]> >> wrote: >> >> > >> > Hi, this could be a stupid question but I am just wondering what the best >> > way >> > is to hide a component. >> > Say I have a button on a form and when it renders sometimes I want it to >> > show and some times not. >> > I could either use 2 fragments, one with the button in it and one that's >> > empty and switch between the two. Or the other option that I can think of >> > is >> > to turn the visibility on and off. >> > Anyone got any reasons for or against with option? >> > Thanks >> > -- >> > View this message in context: >> > >> http://apache-wicket.1842946.n4.nabble.com/Best-way-to-hide-a-component-tp2299412p2299412.html >> > Sent from the Wicket - User mailing list archive at Nabble.com. >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: [email protected] >> > For additional commands, e-mail: [email protected] >> > >> > >> > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
