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.
>
>
--
View this message in context:
http://www.nabble.com/Adding-components-to-Pages-based-on-conditionals-tp23091567p23092032.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]