[web2py] Re: response.stream and web2py_component

2012-09-18 Thread maverick
Yes it was the older version. Thanks for your suggestions guys, I used a combination of response.js and frame to render the response and also open a save as dialog.. In short: in form_query(): response.js = jQuery('#ddl').attr('src','form_query_download') And form_query_download():

[web2py] Re: response.stream and web2py_component

2012-09-12 Thread maverick
Anthony, Thanks for the explanation. I tried cacheable=True in my select(), like: rows = db().select(db.vmt_weekly.ALL, cacheable=True) but it is met with internal error: type 'exceptions.SyntaxError' invalid select attribute: cacheable Is there something I'm missing? mave On Tuesday,

[web2py] Re: response.stream and web2py_component

2012-09-12 Thread Anthony
Are you using the latest version of web2py? That's a new option. On Wednesday, September 12, 2012 4:43:50 AM UTC-4, maverick wrote: Anthony, Thanks for the explanation. I tried cacheable=True in my select(), like: rows = db().select(db.vmt_weekly.ALL, cacheable=True) but it is met with

[web2py] Re: response.stream and web2py_component

2012-09-11 Thread maverick
Anthony, The second option sounds more like what I want to do. And yes I don't want to load the file itself into the component DIV. But as I stated earlier, I'm trying to do two things from within the same controller form_query(). To summarize, (with reference to the code below) what I'm

[web2py] Re: response.stream and web2py_component

2012-09-11 Thread Anthony
Can you show me how I could modify form_query() to embed JS (if I've understood your second option correctly) in order to trigger the download? You're not going to be able to have a single call to form_query both return HTML content and stream a file at the same time -- those are two

[web2py] Re: response.stream and web2py_component

2012-09-07 Thread maverick
I do want to also display content in the DIV. In addition to displaying content in the DIV, I want the controller to also trigger a file download. A more accurate version of the form_query() controller would be something like: In reponse to the form submission, it has to return a dict

[web2py] Re: response.stream and web2py_component

2012-09-07 Thread Anthony
window.open('{{=URL('reports', 'form_query')}}' + '/' + jQuery(this).val()); is still the way to trigger the download. The jQuery change event handler could trigger the component loading *in addition* to triggering the above command. Another option might be to include the above JS in a script

[web2py] Re: response.stream and web2py_component

2012-09-06 Thread Massimo Di Pierro
I think you should use iframe src={{=URL('reports', 'form_query.load')}} style=width:0px; height:0px; border:0/iframe On Thursday, 6 September 2012 11:48:56 UTC-5, maverick wrote: Hello! I want to stream a file as an attachment in the response. I have this function: def form_query():

[web2py] Re: response.stream and web2py_component

2012-09-06 Thread Anthony
My response from Stack Overflow: jQuery('#rep_type').change(function(){ window.open('{{=URL('reports', 'form_query')}}' + '/' + jQuery(this).val()); }); If you want the file to download as an attachment, don't use a component. A component creates a div for displaying content, but you just