question on PlaceChangeEvent

12 views
Skip to first unread message

sri

unread,
Jan 16, 2012, 10:56:52 AM1/16/12
to Google Web Toolkit
Hello,
We have a situation where, making a Menu selection( say startOrder )
takes us to a OrderPlace and fires a placeChangeEvent. When this
happens, the activity associated with this place is started and the
user can enter a New order and save etc. But once I'm in the
OrderPlace and I have saved my current order and I want to start a New
Order and click on the same Menu selection( startOrder ), since I'm
already in the OrderPlace, I don't get a new PlaceChangeEvent, to stop
and start the NewOrder Activity. Is there a easy( correct ) way of
solving a situation like this?

Thanks in advance..

-sri

Thomas Broyer

unread,
Jan 16, 2012, 2:57:07 PM1/16/12
to google-we...@googlegroups.com
You should either:
  • clear the form once you saved (so you're implicitly already back in the "start new order" state)
  • make a NewOrderPlace compare different to every other NewOrderPlace instance (default behavior when you don't override equals()); and of course do not use a singleton NewOrderPlace instance.
  • goTo the OrderPlace with the ID of the saved order, once saved (so that going to newOrder will indeed go to a different place)
FYI, GMail uses some kind of "replace place" as soon as your mail is (automatically) saved as draft. There's no such thing in GWT though (yet!)

Reply all
Reply to author
Forward
0 new messages