Hi John,
Normally the error, info, fatal messages on Component enter the message
into the List of Feedback messages in the Session. The messages are
accumulated during the pre render phase of the request cycle and then
the entire list is detached at the end of the request cycle. see
org.apache.wicket.Session#cleanupFeedbackMessages()
The easy way would be to extend the default FeedbackPanel (or something
custom from the IFeedback interface) which would take care of consuming
the messages and apply your implementation to render the errors out as a
javascript alert.
Regards,
Mike
I need to display messages via a javascript alert box rather than .error or
.info messages which is provided in Component. I currently have the following.
The problem is that the message remains. The alert appears whenever there is an
error however how do I remove it? And is this the best approach? Thank you.
.. extends AbstractBehavior {
private String message;
public void setMessage(String message) {
this.message = message;
}
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.renderOnLoadJavascript("alert('" + message + "');");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]