On Jul 31, 2014 4:25 PM, "Entropy" <[email protected]> wrote:
>
> We have an ajax button that submits a form that, if the parameters are
right,
> will download an excel file.  The developers who wrote the page used an
ajax
> behavior and then write the request out as javascript like so:
>
> target.appendJavaScript((CharSequence) ("window.location.href='" +
> getCallbackUrl() + "';"));
>
> After building the byte array resource and sticking it in place via:
>
> getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(new
> ResourceRequestHandler(rptRS, null));

See what is the type of this null here. You can use it to add the
randomness.

>
> The problem with this is that when a person changes the parameters and
> resubmits the form to get a different dynamically generated excel, there's
> some caching in play and they get the same one they downloaded earlier.
>
> We put getResourceSettings().setDefaultCacheDuration(Duration.NONE); in
the
> application init and it seemed to solve it.  But setting to no cache for
the
> whole app seems like overkill.  We'd like to set it for this one download.
> I've seen forum posts that suggest there is a setCacheDuration on some
> specific objects, but none of the ones I seem to try.
>
> How would I set the cache to none for THIS object/URL?
>
> --
> View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Excel-spreadsheet-and-cache-duration-tp4666828.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

Reply via email to