Gabor,
That is because a WResource is not intended to be used like this. A
WResource has a url() method, and that is what has to b e requested in
order to download the file. So your options are:
1. Make a WAnchor for the WResource (see WAnchor constructors that
take a WResource)
MyResource *mr = new MyResource(... ,this);
new WAnchor(mr, "Click to download", this);
-> When the anchor is clicked, handleRequest will be invoked
2. Connect to the clicked() signal of a WPushButton and use
WApplication::redirect(mr->url). The redirection will cause the
WResource to be accessed (but may also cause your session to be
terminated with recent Wt versions - an issue we must (or have
recently) fix).
Wim.
2011/6/1 Gabor E. Tusnady <[email protected]>:
> Thank you this examples, and the new WStreamResource class. However,
> something is missing for me. I have attached a test source. Wim, please
> correct it, because in this code handleRequest method has never been
> reached...
>
> Thanks
> Gabor
>
>> The documentation of WResource explains it with an example. Another
>> example: the source code of WStreamResource.C (or WFileResource in
>> older Wt).
>>
>> Wim.
>>
>> ------------------------------------------------------------------------------
>> Simplify data backup and recovery for your virtual environment with vRanger.
>> Installation's a snap, and flexible recovery options mean your data is safe,
>> secure and there when you need it. Data protection magic?
>> Nope - It's vRanger. Get your free trial download today.
>> http://p.sf.net/sfu/quest-sfdev2dev
>> _______________________________________________
>> witty-interest mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
> ------------------------------------------------------------------------------
> Simplify data backup and recovery for your virtual environment with vRanger.
> Installation's a snap, and flexible recovery options mean your data is safe,
> secure and there when you need it. Data protection magic?
> Nope - It's vRanger. Get your free trial download today.
> http://p.sf.net/sfu/quest-sfdev2dev
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest