HI to all,
Problem:
I have an admin generated application.
In generator.yml I had an action in the list:
generator:
class: sfPropelGenerator
<snip>
config:
<snip>
list:
action:
myAction: ~
MyAction produces a PDF and send it to the browser using sfTCPDF.
After the user has received (and checked) the file I have to ask him
if I can update the database.
Solutions:
1) At the end of myAction I can redirect to a confirmation form, but
if some other user add new records to the database, while I'm waiting
for the answer, I'll update more records than I have processed.
2) Store the ids of the records I have processed in the session (can
be thousands) and recover the ids from it in the action that updates
the DB.
3) I can use javascript and attach a onclick method to the link in the
form; then I can, using AJAX, receive from the browser the command to
generate the PDF, send the PDF and the ids of the records I have
processed to the javascript function, have the javascript function
print the PDF and ask the user if the database can be update, receive
the response from the javascript function with the ids and, in case,
update the DB. (It is like the previous solution, but I can use the
confirm popup, nicer than a form, and forget the ids on the server
side).
4) I can add to the DB a field to store an unique random string to
mark the processed records, the same string I send as a cookie and if
I receive the ok from the user I can retrieve the cookie and process
the DB.
5) for sure there is a simpler way that I can not see.... ;-) (like
ask for confirmation without leaving myAction so that I can use
transaction...)
Stefano
If you think that my question is not symfony related (I'm writing my
first web application), excuse me for the OT, and forget this message.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---