Hello,
I am playing around with WiQuery which looks very cool.
In their examples they show an advanced dialog that uses
AbstractDefaultAjaxBehavior#getCallbackUrl
In the example, the behavior is added to a page.
Then, in the script (I'll put it below), the 'getCallbackUrl' is called.
The problem I am having is that my dialog is located inside a Panel.
I create everything in the constructor, so when that method is being called,
I get the IllegalStateException from Component#getPage that is being called
indirectly from getCallbackUrl .
My solution was to add the dialog to the onBeforeRender of the panel.
Is this the only way to fix the problem?
Here's the script that the WiQuery button of the WiQuery Dialog has:
buttonsAdv.add(new DialogButton("Save",
JsScope.quickScope("wicketSubmitFormById('" + "form" + "','"
+ *deleteSnapshotFormAjaxBehavior.getCallbackUrl(false)* +
"', null, null, null, null, null);")));
and here's the behavior:
deleteSnapshotFormAjaxBehavior = new AbstractDefaultAjaxBehavior() {
private static final long serialVersionUID = 1L;
/* (non-Javadoc)
* @see
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior#respond(org.apache.wicket.ajax.AjaxRequestTarget)
*/
@Override
protected void respond(AjaxRequestTarget target) {
getSession().cleanupFeedbackMessages();
extractionManager.deleteSnapshot(snapshotToDelete);
target.addComponent(snapshotsTable);
target.addComponent(feedback);
info(getString("extract.rdb.message.snapshot.deleted", new
Model(snapshotToDelete)));
snapshotToDelete = null;
advancedDialog.close(target);
}
};
Thanks for help...
Eyal Golan
egolan74@...
Visit:
http://jvdrums.sourceforge.net/LinkedIn:
http://www.linkedin.com/in/egolan74P Save a tree. Please don't print this e-mail unless it's really necessary