You'd probably need to return script that can create the message
client-side, for instance, if you're creating the message based on fields in
the form.  I'm not sure if you need to generate the message server-side.

--
Jeremy Thomerson
http://www.wickettraining.com



On Tue, Apr 21, 2009 at 2:00 PM, Julian Sinai <[email protected]> wrote:

>
> Hi, I need to display a confirmation message to the user before submitting
> a form. It's pretty standard to use the code below when the message is known
> at the time of button or link construction. But what about when the message
> must be synthesized at the time of the button click? I've tried using a
> model, but that didn't help. I would appreciate any help.
>
> Thanks,
> Julian
>
>
> @Override
> protected IAjaxCallDecorator getAjaxCallDecorator()
> {
> return new AjaxPreprocessingCallDecorator(super.getAjaxCallDecorator())
> {
> @Override
> public CharSequence preDecorateScript(CharSequence script)
> {
>  return "if(!confirm('" + message
>      + "')) return false;" + script;
> }
> };
> }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to