Re: file download + refresh
Re: file download + refresh
- Subject: Re: file download + refresh
- From: OCsite via Webobjects-dev <email@hidden>
- Date: Fri, 2 Sep 2022 17:09:19 +0200
Thanks! Alas, although I do use my own poor-man's Ajax-like code (which
actually predates Ajax :)) in some pages, in this particular case it would be
sorta overkill.
Having checked all the possibilities I've accepted (with a surprise) that such
a trivial task is highly non-trivial :), and instead re-written the application
so that the refresh is not needed anymore. That was easiest solution by far :)
Thanks again,
OC
> On 2. 9. 2022, at 9:29, Hugi Thordarson <email@hidden> wrote:
>
> If you're using the Ajax framework, you can also do something like…
>
> <wo:AjaxUpdateContainer id="dlContainer">
> <p>Number of downloads: <wo:str value="$numberOfDownloads" /></p>
> </wo:AjaxUpdateContainer>
> <wo:AjaxPing cacheKey="$numberOfDownloads" targetContainerID="dlContainer" />
>
> <wo:link action="$download">Download</wo:link>
>
> …and just increment numberOfDownloads on each download.
>
> Note that AjaxPing submits lightweight requests at regular intervals (3000ms
> by default, settable by the frequency binding) to check for changes to the
> watched value, so it might not be suitable if you have a lot of these pages
> open for a longer time.
>
> Cheers,
> - hugi
>
>
>> On 1 Sep 2022, at 10:13, OCsite via Webobjects-dev
>> <email@hidden <mailto:email@hidden>>
>> wrote:
>>
>> Hi there,
>>
>> thanks for previous answers, the JS solution works like a charm.
>> Nevertheless, I've bumped into another problem: along with downloading the
>> file (returning appropriate WOResponse from my action method), I would need
>> to refresh the page as well, to increment a visible download counter etc. Is
>> there a known solution for that? I guess again some JS trick will be needed,
>> and alas, JS is not my forte.
>>
>> Thanks again,
>> OC
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list (email@hidden
>> <mailto:email@hidden>)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden