You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by "venkataprasad.n" <ve...@hcl.com> on 2011/09/26 15:43:05 UTC

CheckBox in wicketTester

Hi,
I am using a checkbox in my markup. once the checkbox is clicked I need to
get the markupcontainer displayed in my page.

Html file:

<form wicket:id="form">
<input type="checkbox" wicket:id="check">
</input>
<div wicket:id="wmc">
...
</div
</form>

 java code is 

Form form = new Form("form");
final WebMarkupContainer wmc = new WebMarkupContainer("wmc");
add(form);
wmc.setVisible(false);
form.add(wmc);

form.add(new AjaxCheckBox("check",new PropertyModel(wmc,"visible")))
{
   protected void onUpdate(AjaxRequestTarget tgt)
{
   if(tgt != null)
{
   tgt.addComponent("wmc");
}
}
}

If the checkbox is not selected , then the webmarkupcontainer component is
returned as null.

Suggest how to select the checkbox which inturn will populate the webmarkup
container using wickettester.

Thanks in advance.





--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/CheckBox-in-wicketTester-tp3843793p3843793.html
Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.