Yes Brian, actually you're right for IMAP, but that was just an example. Let's take a look another situation: I have an table (or model) with customers and one of controller actions is for searching customers by different criterions. Assuming user want to find customers with (criterion1=X OR criterion2=Y OR .....ciriterionN=N) where user can select each criterion and can remove selected criterion too. On the first step user select criterion1=X and adds this criterion to search logic and it appears in view, on second step user adds criterion2=Y and it appears in view too, ..... and so on. On step Z user decides to remove criterion2=Y from the search logic. In this example I have to find a way to pass data stored in view (search logic generated by adding or removing criterions) to controller, where to add or remove new criterion.
On Aug 16, 9:09 pm, brian <[email protected]> wrote: > But that's what IMAP is designed for: fetch just the headers first and > then fetch the body of whatever messages one is interested in. > > On Sun, Aug 16, 2009 at 1:14 PM, senser<[email protected]> wrote: > > > Yes, I have implemented a similar logic already in other controller, > > but in this way I have to query the IMAP server twice - one for > > fetching headers to display, and once again to fetch whole message and > > store it to DB. I was thinking for some way to get the message just > > once at all, display only particular headers in view and then store it > > without an extra call to IMAP server. > > > On Aug 16, 7:53 pm, brian <[email protected]> wrote: > >> Or, come to that, don't use a form at all. Create another action to > >> save an email using an ID and pass that in a regular link. If you want > >> to be able to save several at once (eg. select them with checkboxes) > >> of course, you'll need a form. But the principle is the same: just > >> pass the message ID back to your app and have it grab whatever you > >> want to save from the remote server. > > >> On Sun, Aug 16, 2009 at 11:41 AM, Roel<[email protected]> wrote: > > >> > Well basically all you need in your form is an identifier and data > >> > that the user can change. > >> > If you got some identifier of the messages you need to save, then you > >> > can use that to save the data from your mail server directly to your > >> > database. There is no need to send all the data to the client and then > >> > let the client send it back to the server unaltered. > > >> > -Roel > > >> > On Aug 16, 8:48 am, senser <[email protected]> wrote: > >> >> Hello, > > >> >> I was wondering if there is a way to send some data (often > >> >> intermediate to large array) from view to controller action. > >> >> For example - I have an controller action that reads emails from > >> >> remote IMAP server and displays unread messages in corresponding view > >> >> offering to user to save desired emails in database. The problem is > >> >> that form in view displays only some of message headers (from, to and > >> >> subject) but I want to save all headers in database (i.e. message-id). > >> >> I can make a hidden field to hold this fields, but sometimes fields > >> >> are very large and hidden field is not the best way. > >> >> Is there any other way to send data from view to controller action? > > >> >> Cheers! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
