There's the possibility to call:

doJavaScript("window.open('" + my_resource->url() + "','_blank');");

But that's not recommended because pop-up blockers will spoil the fun. Also
this cannot work without JS.

Best regards,
Wim.



2014/1/15 Muhammad Nasser Al-Noimi <mnno...@gmail.com>

> Thanks for reply,
>
> Calling setLinkTarget doesn't work for me. I want to load document from
> methode used to generate it not using button click or link.
>
> Thanks,
>
>
> On Tue, Jan 14, 2014 at 10:08 PM, Koen Deforche <k...@emweb.be> wrote:
>
>> Hey,
>>
>> Using setLinkTarget(Wt::TargetNewWindow) should do that.
>>
>> Regards,
>> koen
>>
>>
>> 2014/1/12 Muhammad Nasser Al-Noimi <mnno...@gmail.com>
>>
>>>
>>> Thanks a lot it worked perfectly. But I want to open my resource in a
>>> new page (somthing like window.open('my_resource_link','_blank'))
>>> I'm currently using WApplication::redirect but it loads the page in the
>>> same page.
>>>
>>> Thanks
>>>
>>>
>>> On Fri, Jan 10, 2014 at 12:42 PM, Wim Dumon <w...@emweb.be> wrote:
>>>
>>>> WPushButton::setLink, WPushButton::setLinkTarget
>>>>
>>>> Wim.
>>>>
>>>>
>>>>
>>>> 2014/1/10 Muhammad Nasser Al-Noimi <mnno...@gmail.com>
>>>>
>>>>> Perfect, It work thanks a lot.
>>>>>
>>>>>  Any idea how to load the document in a new page without using
>>>>> WAnchor (from click signal)?
>>>>>
>>>>>
>>>>> On Thu, Jan 9, 2014 at 3:50 PM, Wim Dumon <w...@emweb.be> wrote:
>>>>>
>>>>>> Hello Muhammad,
>>>>>>
>>>>>> You unintentionally reset your disposition type to Attachment.
>>>>>>
>>>>>> This is the documentation of suggestFileName:
>>>>>> void  
>>>>>> suggestFileName<http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WResource.html#a30a0736f36f44b2a47ab25e9aa164851>
>>>>>>  (const 
>>>>>> Wt::WString<http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WString.html>
>>>>>>  &name, 
>>>>>> DispositionType<http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WResource.html#a7dc9607a6e0aef4b40e6f2f52c0183f8>
>>>>>>  
>>>>>> dispositionType<http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WResource.html#ad082d7bbce509860315637853061efbd>
>>>>>> =Attachment<http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WResource.html#a7dc9607a6e0aef4b40e6f2f52c0183f8a1a147c93388938ce29e8fed6717202ee>
>>>>>> )
>>>>>> BR,
>>>>>> Wim.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2014/1/9 Muhammad Nasser Al-Noimi <mnno...@gmail.com>
>>>>>>
>>>>>>> Hello Wim,
>>>>>>>
>>>>>>> I tried every possible way (deiposition, mimetype), but I got
>>>>>>> nothing, The browser still view download the file.
>>>>>>> I tested it on Firefox and Chromium.
>>>>>>>
>>>>>>> This is my code:
>>>>>>>     WFileResource* pdfReport = new
>>>>>>> WFileResource("reports/3002f648-8f7b-48d6-b7a4-13e331d2b175.pdf");
>>>>>>>     pdfReport->setDispositionType(WResource::Inline);
>>>>>>>     pdfReport->setMimeType("application/pdf");
>>>>>>>     pdfReport->suggestFileName("Report.pdf");
>>>>>>>     new WAnchor(pdfReport, "Report", this);
>>>>>>>
>>>>>>> My browser support view pdf.
>>>>>>> I want to view pdf after many processes using WPushButton not link
>>>>>>>
>>>>>>> Regards,
>>>>>>> Nasser
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Jan 8, 2014 at 1:42 PM, Wim Dumon <w...@emweb.be> wrote:
>>>>>>>
>>>>>>>> Hello Muhammad,
>>>>>>>>
>>>>>>>> And if you use a WFileResource, and set the disposition type to the
>>>>>>>> proper value? That should show it in the browser if your browser is 
>>>>>>>> capable
>>>>>>>> of doing so.
>>>>>>>>
>>>>>>>> BR,
>>>>>>>> Wim.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 2014/1/8 Muhammad Nasser Al-Noimi <mnno...@gmail.com>
>>>>>>>>
>>>>>>>>> Any hint about how I can do it? Using "meta" works if I'm not
>>>>>>>>> redirecting using Wt application. But when I redirect to the web-page
>>>>>>>>> through Witty application, the browser start to download the PDF 
>>>>>>>>> document
>>>>>>>>> instead of loading it in built in viewer.
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Sun, Jan 5, 2014 at 10:32 AM, Muhammad Nasser Al-Noimi <
>>>>>>>>> mnno...@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I'm trying to view a pdf document into browser but the browser is
>>>>>>>>>> trying to download the document each time I try to load it into 
>>>>>>>>>> browser.
>>>>>>>>>>
>>>>>>>>>> I tried the following but I failed:
>>>>>>>>>> - using meta: <META HTTP-EQUIV="CONTENT-TYPE"
>>>>>>>>>> CONTENT="application/pdf; charset=utf-8">
>>>>>>>>>> - using javascript object such as: http://pdfobject.com/\
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I'm using the following instruction to do the job:
>>>>>>>>>> MainApplication::instance()->redirect("mydocument.pdf");
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> Nasser Al-Noimi
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> Rapidly troubleshoot problems before they affect your business.
>>>>>>>>> Most IT
>>>>>>>>> organizations don't have a clear picture of how application
>>>>>>>>> performance
>>>>>>>>> affects their revenue. With AppDynamics, you get 100% visibility
>>>>>>>>> into your
>>>>>>>>> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of
>>>>>>>>> AppDynamics Pro!
>>>>>>>>>
>>>>>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
>>>>>>>>> _______________________________________________
>>>>>>>>> witty-interest mailing list
>>>>>>>>> witty-interest@lists.sourceforge.net
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> Rapidly troubleshoot problems before they affect your business.
>>>>>>>> Most IT
>>>>>>>> organizations don't have a clear picture of how application
>>>>>>>> performance
>>>>>>>> affects their revenue. With AppDynamics, you get 100% visibility
>>>>>>>> into your
>>>>>>>> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of
>>>>>>>> AppDynamics Pro!
>>>>>>>>
>>>>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
>>>>>>>> _______________________________________________
>>>>>>>> witty-interest mailing list
>>>>>>>> witty-interest@lists.sourceforge.net
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
>>>>>>> Learn Why More Businesses Are Choosing CenturyLink Cloud For
>>>>>>> Critical Workloads, Development Environments & Everything In Between.
>>>>>>> Get a Quote or Start a Free Trial Today.
>>>>>>>
>>>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> witty-interest mailing list
>>>>>>> witty-interest@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
>>>>>> Learn Why More Businesses Are Choosing CenturyLink Cloud For
>>>>>> Critical Workloads, Development Environments & Everything In Between.
>>>>>> Get a Quote or Start a Free Trial Today.
>>>>>>
>>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>>>>>> _______________________________________________
>>>>>> witty-interest mailing list
>>>>>> witty-interest@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
>>>>> Learn Why More Businesses Are Choosing CenturyLink Cloud For
>>>>> Critical Workloads, Development Environments & Everything In Between.
>>>>> Get a Quote or Start a Free Trial Today.
>>>>>
>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>>>>> _______________________________________________
>>>>> witty-interest mailing list
>>>>> witty-interest@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>>>>>
>>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
>>>> Learn Why More Businesses Are Choosing CenturyLink Cloud For
>>>> Critical Workloads, Development Environments & Everything In Between.
>>>> Get a Quote or Start a Free Trial Today.
>>>>
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>>>> _______________________________________________
>>>> witty-interest mailing list
>>>> witty-interest@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>>>>
>>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
>>> Learn Why More Businesses Are Choosing CenturyLink Cloud For
>>> Critical Workloads, Development Environments & Everything In Between.
>>> Get a Quote or Start a Free Trial Today.
>>>
>>> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> witty-interest mailing list
>>> witty-interest@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
>> Learn Why More Businesses Are Choosing CenturyLink Cloud For
>> Critical Workloads, Development Environments & Everything In Between.
>> Get a Quote or Start a Free Trial Today.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>> _______________________________________________
>> witty-interest mailing list
>> witty-interest@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/witty-interest
>>
>>
>
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to