Not Transfer related but if you use a UUID as a hidden form field and save this 
too if a form is re-submitted you can ignore the insert IF the UUID already 
exists in the database.




________________________________
From: Dan Wilson <[email protected]>
To: [email protected]
Sent: Tuesday, January 6, 2009 8:54:05 PM
Subject: [transfer-dev] Re: back button update transfer object

How I handle it in 95% of cases is do a redirect to a neutral page once the 
form was successfully submitted.

<cflocation> for the win!


dw


On Tue, Jan 6, 2009 at 3:47 PM, Mark Mandel <[email protected]> wrote:


Brian,

This is more of an application design / user training question.

If a user hits the back button, then they go back to the 'create new'
screen... which has no idea what was previously entered.

So if they hit submit again, your app has no way to know what their
last insert was.

How you handle this, I think is going to be really up to the needs of
your application.

Mark


On Wed, Jan 7, 2009 at 6:15 AM, Brian FitzGerald
<[email protected]> wrote:
>
> Hey guys, any thoughts are appreciated ...
>
> When a user submits a quiz, my QuizResult transfer object is saved -
> transfer.save(QuizResult)
>
> The problem occurs when the user hits "back" to fix their answers and
> resubmit ... at this point transfer runs save again, but instead of an
> update, it tries to do another create.  This generates a SQL error
> since it tries to insert a duplicate record ... the TO doesn't realize
> it's already persisted
>
> in order to force transfer to run create or update in the correct
> scenario, I stuck in an "exists" method ...
>
> if( exists(quizResult) )
> {
>   transfer.update(quizResult);
> }
> else
> {
>  transfer.create(quizResult);
> }
>
> but this is still giving me problems because, after hitting the back
> button, the transfer object still thinks it isn't persisted even when
> it is, so while it does run "update", it also blows up: "The Transfer
> Object of type 'quizResult.QuizResult' has not been created in the
> database"
>
> Can anyone point me in the right direction on this?  Thanks in advance
> >
>



--
E: [email protected]
W: www.compoundtheory.com





-- 
"Come to the edge, he said. They said: We are afraid. Come to the edge, he 
said. They came. He pushed them and they flew."

Guillaume Apollinaire quotes



      
--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" 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/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to