Some time ago I discovered a small bug in my webapp.
I use ModelSnippet / ModelView. A submit button called the ModelView's save
method and then invoked another method. I realized that other method wasn't
getting invoked because save was ultimately leading to a redirect (back to
the list page).
So I have a few questions.

   1. Should ModelView.save be declared to return Nothing instead of Unit?
   It either calls onSave of S.error depending on whether saving was
   successful. This would indicate that it doesn't return. However, you can
   change the value of onSave on the ModelSnippet which is what does the actual
   redirect, so it may return.
      - Similarly should onSave have an explicit type annotation? What
      should it be?
   2. When a method is declared to return Nothing, why does the compiler
   allow you to put statements after it if they can't be reached? (Not really a
   Lift question.)
   3. Is there or should there be a way in Lift to trigger a redirect but
   allow code to execute to completion?

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=.


Reply via email to