I prepared a reusable panel and add it to my page.
There are 2 dropdownchoice in my page’s form.
im using the ajax example from https://cwiki.apache.org/WICKET/dropdownchoice-examples.html#DropDownChoiceExamples-Note
the two DDC works fine(change one’s value then hide/unhide the other one.
but it doesnt work on my panel.
im using:
private final MyPanel panel1 = new MyPanel ("MyPanel");
panel1.setOutputMarkupPlaceholderTag(true);
… in DDC1 ajax behavior method:
onUpdate(AjaxRequestTarget target) { ...
DDC2.setVisible(true);
panel1.setVisible(true);
}
I have to submit the form to hide/undide panel1 .
How can I make it work the same way as DDC2 without submitting the form?
You need :
The
that you have is actually not always needed for Ajax to work, but is needed for doing a refresh driven from the client side. And it won’t hurt anything to my knowledge …
In the behavior you need to tell the target to refresh it: