Sunday, June 30, 2013

Re: Generating multiple 'requests' based on form selections

I think your use of the term "request" is confusing. Do you need the client to issue six requests to the server with the various combinations? Or can the client issue a single request with all of the information and have the server process that as a request for six new records to be created?

If you need to actually issue six separate requests then the way I could think of doing it would be using JavaScript. Capture the submit button event and then use AJAX calls to issue the separate requests. This is a very messy way to do it as you would need to build into the client error handling and roll back for partially executed requests.

If you can have the single request then basically all of the work happens on the server.  I haven't used CakePHP 1.1 but in 1.3 you could generate an array of the model you want to save and call saveAll.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: