You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Francisco Diaz Trepat - gmail <fr...@gmail.com> on 2007/11/22 16:18:53 UTC

Ajax File Download with Form Process and Result Refresh

Hi

I have a forms that performs a calculation and shows the result, all done by
an ajax form.

I have an ajax link that has to return a PDF, but also "refresh" the results
or execute the ajax form submit.

Also if the form proces fails for a validation (eg. empty field) then I
should show the validation messages in my feedback panel, and do not process
de pdf for download.


Anyone?

thanks,

f(t)

Re: Ajax File Download with Form Process and Result Refresh

Posted by Maurice Marrink <ma...@gmail.com>.
A regular form and an ajaxbutton should get you a long way. Assuming
you have a feedbackpanel on your page.
The onSubmit of your button should do something like:
onSubmit(AjaxRequestTarget target)
{
//do calculation
target.addComponent(getForm());

//somehow create and or upload pdf

}
onError(AjaxRequestTarget target)
{
 //refresh feedback to show feedback messages
 target.add(feedbackpanel);
}

Now if someone else can explain the best way to serve a file from or
after an ajax call.
I think you have to use a regular request for that but who knows :)

Maurice


On Nov 22, 2007 4:18 PM, Francisco Diaz Trepat - gmail
<fr...@gmail.com> wrote:
> Hi
>
> I have a forms that performs a calculation and shows the result, all done by
> an ajax form.
>
> I have an ajax link that has to return a PDF, but also "refresh" the results
> or execute the ajax form submit.
>
> Also if the form proces fails for a validation (eg. empty field) then I
> should show the validation messages in my feedback panel, and do not process
> de pdf for download.
>
>
> Anyone?
>
> thanks,
>
> f(t)
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org