Hi Kevin,

'Twas brillig, and Kevin McArthur at 01/04/09 20:20 did gyre and gimble:
Correction from last post....

http://framework.zend.com/wiki/pages/viewpage.action?pageId=42130

Thanks for this. It looks like the right approach, but I'll hack something up shorter term for my own use.

The only comment (whcih I will add above) is that some mechanism (or naming convention?) for PRG in a multipage environment.

To illustrate, I'd say something along like:

Form has 3 parts/actions first, second and third, and a final step done.
Naming convention is that we always post to "<current part>-do".

index -> clearForm -> redir: first

Get: first
 <user fills in form for first>
Post: start-do; if (isValid()) redir: second else redir: first

Get: second
 <user fills in form for second>
Post: second-do: if (isValid()) redir: third else redir: second||first

Get: third
 <user fills in form for third>
Post: third-do: if (isValid()) redir: done else redir: third||second||first

Get: done
 <user celebrates with a nice cold beer>


Essentially, the form which handles post never, ever produces output, but instead redirects appropriately to the right controller which will display the form and present the feedback accordingly. This will mean that even after multiple failures on a given step, the back button will still work correctly.

That's my thoughts on it. I'll add to the proposal.

Col


--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

Reply via email to