RE: Detect data change in cfform

2009-06-28 Thread Gabriel

Nathan

Wouldn't it make more sense to place a confirmation on the cancel button?
Rather than checking all of the data against the original, then asking the
user whether it was really what they wanted to do if it's different, then
saving/discarding it based on their response?

As an aside, if users are clicking cancel by mistake, you may also want to
take a look at your UI - the controls should be clear enough that
submit/cancel are distinct and difficult to confuse with one another.

Gabriel.

-Original Message-
From: Nathan Chen [mailto:nathan.c...@cu.edu] 
Sent: Saturday, 27 June 2009 5:28 AM
To: cf-talk
Subject: RE: Detect data change in cfform


Maybe I wasn't clear. Sometimes users would make some changes and then click
the cancel button by mistake and find out they lose the changes. I need a
routine that detects if data have been altered.

Nathan

-Original Message-
From: Dave Watts [mailto:dwa...@figleaf.com]
Sent: Friday, June 26, 2009 11:09 AM
To: cf-talk
Subject: Re: Detect data change in cfform


 I am building a form that allows users to edit data retrieved from
 multiple tables. There are many fields in the form. If the users don't
 change anything and hit the cancel button, then I don't need to do the
 update, otherwise several sql update statements will be executed. Is
 there an easy way to detect if users have made changes to the data in
 cfform rather than comparing each field to the original data?

Not really, but why would your cancel button submit the form? Simply
have it do something else, like redirect the user to the previous
screen.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!





~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324036
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Detect data change in cfform

2009-06-26 Thread Nathan Chen

Hi, All:

 

I am building a form that allows users to edit data retrieved from
multiple tables. There are many fields in the form. If the users don't
change anything and hit the cancel button, then I don't need to do the
update, otherwise several sql update statements will be executed. Is
there an easy way to detect if users have made changes to the data in
cfform rather than comparing each field to the original data?

 

Nathan



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323984
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Detect data change in cfform

2009-06-26 Thread Dave Watts

 I am building a form that allows users to edit data retrieved from
 multiple tables. There are many fields in the form. If the users don't
 change anything and hit the cancel button, then I don't need to do the
 update, otherwise several sql update statements will be executed. Is
 there an easy way to detect if users have made changes to the data in
 cfform rather than comparing each field to the original data?

Not really, but why would your cancel button submit the form? Simply
have it do something else, like redirect the user to the previous
screen.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323985
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Detect data change in cfform

2009-06-26 Thread Gerald Guido

If I understand the question correctly. Off the top of my head  I would
save a copy of the data that you used to populate the form as a struct in
the session scope and when the form is submitted you can compare the form to
the saved struct using the structCompare() from cflib.org

http://www.cflib.org/udf/structCompare

HTH
G


On Fri, Jun 26, 2009 at 12:56 PM, Nathan Chen nathan.c...@cu.edu wrote:


 Hi, All:



 I am building a form that allows users to edit data retrieved from
 multiple tables. There are many fields in the form. If the users don't
 change anything and hit the cancel button, then I don't need to do the
 update, otherwise several sql update statements will be executed. Is
 there an easy way to detect if users have made changes to the data in
 cfform rather than comparing each field to the original data?



 Nathan



 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323988
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Detect data change in cfform

2009-06-26 Thread Nathan Chen

Maybe I wasn't clear. Sometimes users would make some changes and then
click the cancel button by mistake and find out they lose the changes. I
need a routine that detects if data have been altered.

Nathan

-Original Message-
From: Dave Watts [mailto:dwa...@figleaf.com] 
Sent: Friday, June 26, 2009 11:09 AM
To: cf-talk
Subject: Re: Detect data change in cfform


 I am building a form that allows users to edit data retrieved from
 multiple tables. There are many fields in the form. If the users don't
 change anything and hit the cancel button, then I don't need to do the
 update, otherwise several sql update statements will be executed. Is
 there an easy way to detect if users have made changes to the data in
 cfform rather than comparing each field to the original data?

Not really, but why would your cancel button submit the form? Simply
have it do something else, like redirect the user to the previous
screen.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:324003
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4