Ok, I an see where this would help if you have separate designers and programers. Try this way then:

Label veryGood = new Label("my_first_option", "Very Good!");
Label veryWell = new Label("my_second_option", "Very Well!");
Label again = new Label("my_second_option", "?");
add(veryGood);
add(veryWell);
veryWell.add(again);

bool = <expression[1|0]...>
veryGood.setVisible(bool);
veryWell.setVisible(! bool);


and your HTML will be simply:

<div wicket:id="myComponent">[replaced label]</div>

<p wicket:id="my_first_option">[Very Good ! ]</div>
<div wicket:id="my_second_option"><span wicket:id="again">[?]</ span>[Very Well !]</div>

Note: I haven't tried nesting a label inside another label, but things usually work that way in Wicket. If the label doesn't work, you can try a MarkupContainer instead, which is pretty much the same thing, just not specifically a Label (you might need to wrap both string as labels in that case). I'm not sure why you would want that "again" component though from the example it doesn't seem to need to be a component.

- Brill Pappin



On 17-Mar-09, at 7:14 AM, Ista Pouss wrote:

2009/3/17 Linda van der Pal <[email protected]>:
It sounds like you want something like this:

File.html:

<div wicket:id="label">dadada</div>


File.java:
boolean again = false; // put your logic here
if (again) {
  add(new Label("label", "Very well!");
} else {
  add(new Label("label", "Very good!");
}


I should prefer than "Very well" and "Very good" are in a html file,
or part of html file with some wicket mark inside.

For instance, something like :
add(new Panel("label", <a reference in a wicket html file>);

Thanks in advance.

---------------------------------------------------------------------
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]

Reply via email to