Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

SmartGWT call-back BUG

 
Greenhorn
Posts: 8
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

One of the GWT Bug(Sorry, as I think It's a Bud) ate my valuable development time recently.
I was saving my 4 DynamicForm's data by using
addData(Record record, DSCallback callback) method of a DataSource.
Saving back-end method had a business validation which return RunTimeException with validation error message.
If due to validation, saving get interrupted, i didn't want to run code inside execute(DSResponse response, Object rawData, DSRequest request)

But the issue was, neglecting there's a RunTime validation exception or not, lines inside "execute" got called which was not supposed to call when RunTime validation exception thrown.

After so many testing, wasting time, I found that the solution as using a DynamicForm object to save data with call-back would work.
That's calling
saveData(DSCallback callback) with execute(DSResponse response, Object rawData, DSRequest request) of DynamicForm.
If I use this way, when RunTime validation exception thrown when save data, lines inside "execute()" not get called.

So the lesson is,
DataSource.addData method with call-back will execute lines inside "execute()" method when RunTimeException is returned or not. (In Both time)
DynamicForm.saveData method will call-back will not execute lines inside "execute()" when RunTimeException is returned. call otherwise.

Can you experts elaborate on this. Is this a really GWT issue or is that something GWT developer purposely done.

Thanks in advance,
Uditha
 
Not so fast naughty spawn! I want you to know about
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!