Download inside component

41 views
Skip to first unread message

LaDarrius Stewart

unread,
Jun 13, 2014, 11:08:22 AM6/13/14
to web...@googlegroups.com
Currently have a modal being filled by the following code....
            links=[lambda row: BUTTON('Apply Payment',
                            _onclick="web2py_component('%s', 'modalinfo');" % \
                                     URL('default', 'applypayment2.load', args=row.Inv_Header.id),
                            **{'_data-toggle': 'modal',  '_data-target' : '#myModal',
                               '_class' : 'two btn btn-success', '_id' : 'show'})]
Inside this modal I have a submit button with a call to a ReportLab method that returns a response.stream. Within the modal it returns the raw PDF data(garbage) instead of initiating the automatic download as the same code does on non-component views.

This message is for named person(s) only.  It may contain confidential and/or legally privileged information.  No confidentiality or privilege is waived or lost should mis-transmission occur.  If you receive this message in error, delete it (and all copies) and notify the sender.  You must not, directly or indirectly,use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. GAD GROUP TECHNOLOGY, INC. reserves the right to monitor all e-mail communications through its networks.

Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity.

This e-mail has been virus and content scanned by GAD GROUP TECHNOLOGY, INC.

Anthony

unread,
Jun 13, 2014, 11:40:01 AM6/13/14
to web...@googlegroups.com

Limedrop

unread,
Jun 13, 2014, 9:42:41 PM6/13/14
to web...@googlegroups.com
I use that jquery plugin and it is very good.  Note that you need to set cookies within the download function, something  like this...

    response.cookies['fileDownload'] = 'true'
    response.cookies['fileDownload']['path'] = "/"
Reply all
Reply to author
Forward
0 new messages