gwt - How meaningfull is Activity.mayStop()? -


i wondering if there non trivial use case com.google.gwt.activity.shared.activity#maystop method.

  1. the com.google.gwt.place.shared.placecontroller.delegate#confirm blocking one, cannot use different delegate, using callbacks. not know why implemented in blocking manner because gwt guys user interactions should handled asynchronously.
  2. the maystop method called. if activitymanager return same activity , ui not change. activity has check instance if user has unsaved changes , if place change whould result in discarding unsaved data. think check done more before calling placecontroller.goto(new place()).

what think?

  1. see http://code.google.com/p/google-web-toolkit/issues/detail?id=6228#c1 tl;dr: asynchronous handling opens door many edge cases, bugs, confusion, , differing needs/wishes how should work.

  2. the activity goto not 1 needs checks in maystop. in case is, if check before doing goto (and transit state maystop return null), in case there activity unsaved changes, result in 2 confirmations being asked user.
    it's possible listen placechangerequestevents , conditionally call setwarning, instead of doing check in maystop. way have access place you're navigating to; couples activity places , mapping activities (e.g. list activity might displayed on details place on desktop, not on mobile); that's responsibility of activitymappers.
    also, don't forget navigation can triggered browser (user navigating in browser's history). thing is: on web, user in control.
    in all, it's better (and simpler) gotos , rely on maystop ask confirmation. (the activity disable buttons/links triggering goto in case there unsaved changes, navigation triggered other activities).


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -