While I am on the topic...

On Jan 3, 2006, at 3:52 AM, Miguel Arroz wrote:

I'm building an WO application to manage the participant of a conference. One of the features is a public form where people may register themselves on the conference, and the registration will later be approved by someone from the organization team.

To do that, I have a main page, that links to a "subscription" page with a form. When the user submits a form with no errors, a confirmation page is shown, basically with a message that tells the user he will receive an email shortly with the confirmation.

On the form page, I create a new user and context, and bind the user fields with the form fields.

I would do this immediately after the save and before showing the confirm page. That way, if the user backtracks, they will get a fresh, blank form.


The problem is... if the user is in the confirmation page, and goes "back" in the browser, he will see the form again. If he changes data and submits again, he will effectively change his data.

This is a common problem in web apps, compounded in WO by the fact that it normally maintains state. Pierre Bernard has an article and code on this on his website. There are a few different ways of handling this.


I may think of a number of solutions for this (not binding directly to the user, but to temporary variables; having some king of "alreadySubmited" flag; etc). What I would like is to have your opinion to know what is the more "WOish" solution, the best practise. I'm sure you all had this problem before, and I'm sure you all solved it! :)

In this case, I would probably go with the alreadySubmitted flag and if it is set, then don't save and just return the confirmation page.


Chuck

--
Coming in 2006 - an introduction to web applications using WebObjects and Xcode http://www.global-village.net/wointro

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to