Re: Modal window and resource request target
I Ernesto, I am successfully using the solution you suggested, for use-cases where I have to initiate a pdf-download as a result of a form (contained within a modal window) submit, where in the form.onSubmit() I first close the modal and then start the download as below : public void onSubmit(AjaxRequestTarget target) { getModalWindow().close(target); // initiates report download downloadResource.initiate(target); } The only problem is with regards to Internet Explorer, which blocks the file-download with the tab/message : "To help protect your security, Internet Explorer blocked this site from downloading files to your computer.Click here for options...". One has to click "File Download" (in the available options) to continue with the download. I believe the blocker intrudes in, when it notices change in "window.location.href" value (which is part of the solution) by the resulting response script. Any suggestions/workarounds for this ? I would really want to avoid this filedownload blocker.. Thanks, Farhan. reiern70 wrote: > > Maybe the solution Sven proposes here can be of some help > > http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html > > <http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html> > Best, > > Ernesto > > On Tue, Nov 17, 2009 at 6:51 AM, mfs wrote: > >> >> Am looking for something very similar. Matej can you elaborate on what >> you >> meant by getting the url of the request listener ? >> >> Thanks in advance >> Farhan. >> >> >> >> jwray wrote: >> > >> > >> > Hi, >> > >> > thanks for the prompt reply. Can you give me some details about where >> to >> > get the URL or request listener from? >> > >> > thanks >> > Jonny >> > >> > >> > Matej Knopp-2 wrote: >> >> >> >> This is a bit tricky thing to do. You'd have to redirect from ajax >> >> request. >> >> >> >> so you could get URL for the request listener and then use >> >> RedirectRequestTarget. >> >> >> >> -Matej >> >> >> >> On Tue, Jul 8, 2008 at 10:23 PM, jwray >> wrote: >> >>> >> >>> Hi, >> >>> >> >>> I have the situation in which an action applied to a specific object >> >>> needs >> >>> to obtain some information from the user then construct a dynamic >> >>> resource >> >>> (pdf file) based on the object and obtained information. >> >>> >> >>> The list of object are contained in AjaxFallbackDefaultDataTable and >> I >> >>> am >> >>> currently approaching the problem by using a modal window to obtain >> the >> >>> extra parameters when the user clicks a specific AjaxFallbackLink on >> a >> >>> table >> >>> row. This works fine but, when I try and stream the constructed >> resource >> >>> nothing happens. This is the code in my WindowClosedCallback >> function: >> >>> >> >>> public void onClose(AjaxRequestTarget target) { >> >>> >> >>>if(panel.getNumberOfDays() != null){ >> >>> System.out.println("Visiting resource"); >> >>>TubeLabelsResource resource = new >> >>> TubeLabelsResource(study.getId(), >> >>> searchServices); >> >>>ResourceStreamRequestTarget requestTarget = new >> >>> ResourceStreamRequestTarget(resource.getResourceStream()); >> >>>RequestCycle.get().setRequestTarget(requestTarget); >> >>>} >> >>> } >> >>> >> >>> any pointers as to how to get the resource to stream in the onClose, >> or >> >>> an >> >>> alternative approach to the problem would be gratefully received. >> >>> >> >>> thanks >> >>> Jonny >> >>> -- >> >>> View this message in context: >> >>> >> http://www.nabble.com/Modal-window-and-resource-request-target-tp18348263p18348263.html >> >>> Sent from the Wicket - User mailing list archive at Nabble.com. >> >>> >> >>> >> >>> - >> >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> &g
Re: Modal window and resource request target
Thats Ernesto, that certainly is one rather clean alternative. Thanks, Farhan. reiern70 wrote: > > Maybe the solution Sven proposes here can be of some help > > http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html > > <http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html> > Best, > > Ernesto > > On Tue, Nov 17, 2009 at 6:51 AM, mfs wrote: > >> >> Am looking for something very similar. Matej can you elaborate on what >> you >> meant by getting the url of the request listener ? >> >> Thanks in advance >> Farhan. >> >> >> >> jwray wrote: >> > >> > >> > Hi, >> > >> > thanks for the prompt reply. Can you give me some details about where >> to >> > get the URL or request listener from? >> > >> > thanks >> > Jonny >> > >> > >> > Matej Knopp-2 wrote: >> >> >> >> This is a bit tricky thing to do. You'd have to redirect from ajax >> >> request. >> >> >> >> so you could get URL for the request listener and then use >> >> RedirectRequestTarget. >> >> >> >> -Matej >> >> >> >> On Tue, Jul 8, 2008 at 10:23 PM, jwray >> wrote: >> >>> >> >>> Hi, >> >>> >> >>> I have the situation in which an action applied to a specific object >> >>> needs >> >>> to obtain some information from the user then construct a dynamic >> >>> resource >> >>> (pdf file) based on the object and obtained information. >> >>> >> >>> The list of object are contained in AjaxFallbackDefaultDataTable and >> I >> >>> am >> >>> currently approaching the problem by using a modal window to obtain >> the >> >>> extra parameters when the user clicks a specific AjaxFallbackLink on >> a >> >>> table >> >>> row. This works fine but, when I try and stream the constructed >> resource >> >>> nothing happens. This is the code in my WindowClosedCallback >> function: >> >>> >> >>> public void onClose(AjaxRequestTarget target) { >> >>> >> >>>if(panel.getNumberOfDays() != null){ >> >>> System.out.println("Visiting resource"); >> >>>TubeLabelsResource resource = new >> >>> TubeLabelsResource(study.getId(), >> >>> searchServices); >> >>>ResourceStreamRequestTarget requestTarget = new >> >>> ResourceStreamRequestTarget(resource.getResourceStream()); >> >>>RequestCycle.get().setRequestTarget(requestTarget); >> >>>} >> >>> } >> >>> >> >>> any pointers as to how to get the resource to stream in the onClose, >> or >> >>> an >> >>> alternative approach to the problem would be gratefully received. >> >>> >> >>> thanks >> >>> Jonny >> >>> -- >> >>> View this message in context: >> >>> >> http://www.nabble.com/Modal-window-and-resource-request-target-tp18348263p18348263.html >> >>> Sent from the Wicket - User mailing list archive at Nabble.com. >> >>> >> >>> >> >>> - >> >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> >>> For additional commands, e-mail: users-h...@wicket.apache.org >> >>> >> >>> >> >> >> >> - >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> >> >> >> >> > >> > >> >> -- >> View this message in context: >> http://old.nabble.com/Modal-window-and-resource-request-target-tp18348263p26384787.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > -- View this message in context: http://old.nabble.com/Modal-window-and-resource-request-target-tp18348263p26399891.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Modal window and resource request target
Maybe the solution Sven proposes here can be of some help http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html <http://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html> Best, Ernesto On Tue, Nov 17, 2009 at 6:51 AM, mfs wrote: > > Am looking for something very similar. Matej can you elaborate on what you > meant by getting the url of the request listener ? > > Thanks in advance > Farhan. > > > > jwray wrote: > > > > > > Hi, > > > > thanks for the prompt reply. Can you give me some details about where to > > get the URL or request listener from? > > > > thanks > > Jonny > > > > > > Matej Knopp-2 wrote: > >> > >> This is a bit tricky thing to do. You'd have to redirect from ajax > >> request. > >> > >> so you could get URL for the request listener and then use > >> RedirectRequestTarget. > >> > >> -Matej > >> > >> On Tue, Jul 8, 2008 at 10:23 PM, jwray > wrote: > >>> > >>> Hi, > >>> > >>> I have the situation in which an action applied to a specific object > >>> needs > >>> to obtain some information from the user then construct a dynamic > >>> resource > >>> (pdf file) based on the object and obtained information. > >>> > >>> The list of object are contained in AjaxFallbackDefaultDataTable and I > >>> am > >>> currently approaching the problem by using a modal window to obtain the > >>> extra parameters when the user clicks a specific AjaxFallbackLink on a > >>> table > >>> row. This works fine but, when I try and stream the constructed > resource > >>> nothing happens. This is the code in my WindowClosedCallback function: > >>> > >>> public void onClose(AjaxRequestTarget target) { > >>> > >>>if(panel.getNumberOfDays() != null){ > >>>System.out.println("Visiting resource"); > >>>TubeLabelsResource resource = new > >>> TubeLabelsResource(study.getId(), > >>> searchServices); > >>> ResourceStreamRequestTarget requestTarget = new > >>> ResourceStreamRequestTarget(resource.getResourceStream()); > >>>RequestCycle.get().setRequestTarget(requestTarget); > >>>} > >>> } > >>> > >>> any pointers as to how to get the resource to stream in the onClose, or > >>> an > >>> alternative approach to the problem would be gratefully received. > >>> > >>> thanks > >>> Jonny > >>> -- > >>> View this message in context: > >>> > http://www.nabble.com/Modal-window-and-resource-request-target-tp18348263p18348263.html > >>> Sent from the Wicket - User mailing list archive at Nabble.com. > >>> > >>> > >>> - > >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >>> For additional commands, e-mail: users-h...@wicket.apache.org > >>> > >>> > >> > >> - > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >> For additional commands, e-mail: users-h...@wicket.apache.org > >> > >> > >> > > > > > > -- > View this message in context: > http://old.nabble.com/Modal-window-and-resource-request-target-tp18348263p26384787.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Modal window and resource request target
Am looking for something very similar. Matej can you elaborate on what you meant by getting the url of the request listener ? Thanks in advance Farhan. jwray wrote: > > > Hi, > > thanks for the prompt reply. Can you give me some details about where to > get the URL or request listener from? > > thanks > Jonny > > > Matej Knopp-2 wrote: >> >> This is a bit tricky thing to do. You'd have to redirect from ajax >> request. >> >> so you could get URL for the request listener and then use >> RedirectRequestTarget. >> >> -Matej >> >> On Tue, Jul 8, 2008 at 10:23 PM, jwray wrote: >>> >>> Hi, >>> >>> I have the situation in which an action applied to a specific object >>> needs >>> to obtain some information from the user then construct a dynamic >>> resource >>> (pdf file) based on the object and obtained information. >>> >>> The list of object are contained in AjaxFallbackDefaultDataTable and I >>> am >>> currently approaching the problem by using a modal window to obtain the >>> extra parameters when the user clicks a specific AjaxFallbackLink on a >>> table >>> row. This works fine but, when I try and stream the constructed resource >>> nothing happens. This is the code in my WindowClosedCallback function: >>> >>> public void onClose(AjaxRequestTarget target) { >>> >>>if(panel.getNumberOfDays() != null){ >>>System.out.println("Visiting resource"); >>>TubeLabelsResource resource = new >>> TubeLabelsResource(study.getId(), >>> searchServices); >>>ResourceStreamRequestTarget requestTarget = new >>> ResourceStreamRequestTarget(resource.getResourceStream()); >>> RequestCycle.get().setRequestTarget(requestTarget); >>>} >>> } >>> >>> any pointers as to how to get the resource to stream in the onClose, or >>> an >>> alternative approach to the problem would be gratefully received. >>> >>> thanks >>> Jonny >>> -- >>> View this message in context: >>> http://www.nabble.com/Modal-window-and-resource-request-target-tp18348263p18348263.html >>> Sent from the Wicket - User mailing list archive at Nabble.com. >>> >>> >>> ----------------- >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> > > -- View this message in context: http://old.nabble.com/Modal-window-and-resource-request-target-tp18348263p26384787.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Modal window and resource request target
Hi, thanks for the prompt reply. Can you give me some details about where to get the URL or request listener from? thanks Jonny Matej Knopp-2 wrote: > > This is a bit tricky thing to do. You'd have to redirect from ajax > request. > > so you could get URL for the request listener and then use > RedirectRequestTarget. > > -Matej > > On Tue, Jul 8, 2008 at 10:23 PM, jwray <[EMAIL PROTECTED]> wrote: >> >> Hi, >> >> I have the situation in which an action applied to a specific object >> needs >> to obtain some information from the user then construct a dynamic >> resource >> (pdf file) based on the object and obtained information. >> >> The list of object are contained in AjaxFallbackDefaultDataTable and I am >> currently approaching the problem by using a modal window to obtain the >> extra parameters when the user clicks a specific AjaxFallbackLink on a >> table >> row. This works fine but, when I try and stream the constructed resource >> nothing happens. This is the code in my WindowClosedCallback function: >> >> public void onClose(AjaxRequestTarget target) { >> >>if(panel.getNumberOfDays() != null){ >>System.out.println("Visiting resource"); >>TubeLabelsResource resource = new >> TubeLabelsResource(study.getId(), >> searchServices); >>ResourceStreamRequestTarget requestTarget = new >> ResourceStreamRequestTarget(resource.getResourceStream()); >>RequestCycle.get().setRequestTarget(requestTarget); >>} >> } >> >> any pointers as to how to get the resource to stream in the onClose, or >> an >> alternative approach to the problem would be gratefully received. >> >> thanks >> Jonny >> -- >> View this message in context: >> http://www.nabble.com/Modal-window-and-resource-request-target-tp18348263p18348263.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Modal-window-and-resource-request-target-tp18348263p18348836.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modal window and resource request target
This is a bit tricky thing to do. You'd have to redirect from ajax request. so you could get URL for the request listener and then use RedirectRequestTarget. -Matej On Tue, Jul 8, 2008 at 10:23 PM, jwray <[EMAIL PROTECTED]> wrote: > > Hi, > > I have the situation in which an action applied to a specific object needs > to obtain some information from the user then construct a dynamic resource > (pdf file) based on the object and obtained information. > > The list of object are contained in AjaxFallbackDefaultDataTable and I am > currently approaching the problem by using a modal window to obtain the > extra parameters when the user clicks a specific AjaxFallbackLink on a table > row. This works fine but, when I try and stream the constructed resource > nothing happens. This is the code in my WindowClosedCallback function: > > public void onClose(AjaxRequestTarget target) { > >if(panel.getNumberOfDays() != null){ >System.out.println("Visiting resource"); >TubeLabelsResource resource = new > TubeLabelsResource(study.getId(), > searchServices); >ResourceStreamRequestTarget requestTarget = new > ResourceStreamRequestTarget(resource.getResourceStream()); >RequestCycle.get().setRequestTarget(requestTarget); >} > } > > any pointers as to how to get the resource to stream in the onClose, or an > alternative approach to the problem would be gratefully received. > > thanks > Jonny > -- > View this message in context: > http://www.nabble.com/Modal-window-and-resource-request-target-tp18348263p18348263.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Modal window and resource request target
Hi, I have the situation in which an action applied to a specific object needs to obtain some information from the user then construct a dynamic resource (pdf file) based on the object and obtained information. The list of object are contained in AjaxFallbackDefaultDataTable and I am currently approaching the problem by using a modal window to obtain the extra parameters when the user clicks a specific AjaxFallbackLink on a table row. This works fine but, when I try and stream the constructed resource nothing happens. This is the code in my WindowClosedCallback function: public void onClose(AjaxRequestTarget target) { if(panel.getNumberOfDays() != null){ System.out.println("Visiting resource"); TubeLabelsResource resource = new TubeLabelsResource(study.getId(), searchServices); ResourceStreamRequestTarget requestTarget = new ResourceStreamRequestTarget(resource.getResourceStream()); RequestCycle.get().setRequestTarget(requestTarget); } } any pointers as to how to get the resource to stream in the onClose, or an alternative approach to the problem would be gratefully received. thanks Jonny -- View this message in context: http://www.nabble.com/Modal-window-and-resource-request-target-tp18348263p18348263.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]