I think you want to be doing that in the java code, not the the HTML.
IMO one of the real strengths of Wicket is that your logic stays where
it belongs in the code and not in the presentation layer. If you have
used other frameworks, like struts or even plain JSPs, you'll be used
to putting some of that logic in the view... don't.
instead your code would look something like:
if(bool == true){
add(new Label("myComponent", "One String"));
}else{
add(new Label("myComponent", "Two String"));
}
and your HTML will be simply:
<div wicket:id="myComponent">[replaced label]</div>
Hope that helps.
- Brill
On 17-Mar-09, at 6:21 AM, Ista Pouss wrote:
Hi,
What is the best technique to do some "if" "else" and so on with
wicket ?
I need a html with something like that (stupid and naïve approch) :
<wicket:if (something = toto)>
<div> do this thing</div>
<wicket:else if (something = foo)>
<p><a href="error.html">It's not good</a></p>
<wicket:else if (something = other)>
<div>render other</div>
How to do that with wicket ?
Thanks.
---------------------------------------------------------------------
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]