By: Amok
Date: 2015-03-06
Time: 10:11
|
Generate multiple documents with only one clickOpenTBS now it's working for me, but I have a problem: I have an html form and a list of checkboxes so the user can choose one or more documents to generate (all of them are merged with the data retrieved from an unique form). But, if the user choose two or more documents to generate and click the button, once the openTBS-Show() method is called for the first time, it won't execute the code below. It just generates the first document, and ends the execution. And I'm sure i don't have any exit(); on my code.
So... any trick to solve this? |
||
By: Skrol29
Date: 2015-03-06
Time: 16:47
|
Re: Generate multiple documents with only one clickHi Amok,
TBS alone (i.e. without OpenTBS) actually exit the script by default when you are using Show(). Some options can change that behavior. But with TBS + OpenTBS then options OPENTBS_DOWNLOAD and OPENTBS_FILE should not exit the script. See : http://www.tinybutstrong.com/manual.php#php_setoption_render http://www.tinybutstrong.com/opentbs.php?doc#show |
||
By: Amok
Date: 2015-04-09
Time: 10:37
|
Re: Generate multiple documents with only one clickThank you for the quick response Skrol, but it isn't working. I've tried using SetOption('render',TBS_OUTPUT) instead of the default value which is TBS_OUTPUT + TBS_EXIT. But it doesn't prevent the script from exiting. Each time the Show() method is executed, the scripts ends. This is not a problem when I want to render only one document, but sometimes I need to render several of them. I have some checboxes, and I need to render as many documents as selected checboxes.
For example:
My GenDoc function looks like this:
It seems that it doesn't matter the value of the render property you set. I tried with SetOption('render',TBS_NOTHING) and it is just the same. It calls Show() method one time, generates the document, and exits the script. Even if I invented values for the render property, such as SetOption('render',NONSENSE) it keeps doing the same... |
||
By: Skrol29
Date: 2015-04-09
Time: 23:35
|
Re: Generate multiple documents with only one clickYou cannot download several files with HTML, only one.
Your script is not ending but only the fist document is given for download by the HTTP reply. |
||
By: Amok
Date: 2015-04-10
Time: 09:02
|
Re: Generate multiple documents with only one clickThank you Skrol. You are right, it's not a TBS/Open TBS issue, but an html handicap. Some possible solutions found here: http://stackoverflow.com/questions/2339440/download-multiple-files-with-a-single-action
|