Well, it's true, but the problem I was heaving wasn't related to
coupling between panels or anything, but it was the fact that somehow,
though I set the panels to invisible in the submit handler, the page
seem to ignore this fact until I reopen it.
What do you mean by "reopen" it?
The following works for me, it toggles between panels when the button is pressed:
public Index(final PageParameters parameters)
{
add(new TestPanel("a"));
add(new TestPanelB("b").setVisible(false));
add(new Form("form") {
protected void onSubmit()
{
Component a=getPage().get("a");
a.setVisible(!a.isVisible());
Component b=getPage().get("b");
b.setVisible(!b.isVisible());
}
});
}
{
add(new TestPanel("a"));
add(new TestPanelB("b").setVisible(false));
add(new Form("form") {
protected void onSubmit()
{
Component a=getPage().get("a");
a.setVisible(!a.isVisible());
Component b=getPage().get("b");
b.setVisible(!b.isVisible());
}
});
}
-Igor