Personally, I think, it is much more elegant to call setVisible on the component you want to display or hide, or, when the outcome of the condition can change on each render, override isVisible to return the outcome of the condition.
Emond Papegaaij On Friday 17 April 2009 08:50:21 Vladimir K wrote: > Try EmptyPanel component which is shipped with Wicket. > > if (condition) > add(new YourVisibleComponent("componentId")); > else > add(new EmptyPanel("componentId")); > > Do not forget about OOD. You can introduce createYourVisibleComponent() > method which creates empty panel in base class and some certain component > in derived classes. > > subbu_tce wrote: > > Hi, > > I am a new wicket user. > > How do we include / exclude content or components in pages based on > > conditions. > > What is the equivalent in Wicket to the if tag in the JSTL tag library? > > > > The reason i ask this question is because irrespective of whether i add > > the > > component in the page, i need to have the markup for the component in the > > HTML. > > > > Thanks in advance for the answers. > > > > Thanks, > > Subbu. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org