Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Form not saved when nothing is changed
Form not saved when nothing is changed [message #1065109] Mon, 24 June 2013 12:10 Go to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 310
Registered: August 2011
Senior Member
Hi,

I have a form. In the prepareCreate method of the corresponding service we fill the formadata. Sometimes this is exactly what the user wants so he just has to press the OK button. But nothing is saved then because nothing is changed by the user. Can I mark the data unsaved to force the data being saved?

Regards Bertin
Re: Form not saved when nothing is changed [message #1065110 is a reply to message #1065109] Mon, 24 June 2013 12:13 Go to previous messageGo to next message
Matthias Otterbach is currently offline Matthias OtterbachFriend
Messages: 9
Registered: June 2013
Junior Member
You could use the org.eclipse.scout.rt.client.ui.form.IForm.touch() method, it will "touch" the form so that a save is needed.
Re: Form not saved when nothing is changed [message #1065112 is a reply to message #1065109] Mon, 24 June 2013 12:16 Go to previous messageGo to next message
Ivan Motsch is currently offline Ivan MotschFriend
Messages: 100
Registered: March 2010
Senior Member
I assume you call the Service from
AbstractFormHandler.execLoad

Scout calls markSaveNeeded(false) on all fields after the execLoad phase.

In your case (as in almost all prepareCreate cases)
make the Service call from within
AbstractFormHandler.execPostLoad


verify with the javadoc of these methods that this is what you need.

Does this solve your issue?
Re: Form not saved when nothing is changed [message #1065114 is a reply to message #1065112] Mon, 24 June 2013 12:17 Go to previous messageGo to next message
Ivan Motsch is currently offline Ivan MotschFriend
Messages: 100
Registered: March 2010
Senior Member
Also consider using
IFormField.touch
in case you have mixed and very complex gui logic.
Re: Form not saved when nothing is changed [message #1065330 is a reply to message #1065114] Tue, 25 June 2013 10:56 Go to previous message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 310
Registered: August 2011
Senior Member
Using IFormField.touch inside the AbstractFormHandler.execPostLoad method worked for me,

thanks.
Previous Topic:Minimize SearchForms
Next Topic:Spinner field
Goto Forum:
  


Current Time: Sat Dec 20 22:16:24 GMT 2014

Powered by FUDForum. Page generated in 0.02025 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software