Permalink
Browse files

Minor fixes

Minor fixes:
  - throw exception if local action can't be found
  - make form ID stable across screen instance (useful for referring to
    form before it's been rendered from client-side JS)
  • Loading branch information...
1 parent a9fdf3d commit 3aa7b73195781c524414e7e33053d052e2d04f20 @pbrant committed Mar 15, 2012
@@ -54,8 +54,9 @@ trait CssBoundLiftScreen extends LiftScreen with CssBoundScreen {
override protected def doFinish(): JsCmd= {
val fMap: Map[String, () => JsCmd] = LocalActions.get
- if (! LocalAction.is.isEmpty && fMap.contains(LocalAction.is))
- fMap(LocalAction.is)()
+ if (! LocalAction.get.isEmpty)
+ fMap.get(LocalAction.get) map (_()) getOrElse (
+ throw new IllegalArgumentException("No local action available with that binding"))
else {
validate match {
case Nil =>
@@ -1358,7 +1358,7 @@ trait LiftScreen extends AbstractScreen with StatefulSnippet with ScreenWizardRe
override lazy val __nameSalt = Helpers.nextFuncName
}
- object NextId extends TransientRequestVar[String](Helpers.nextFuncName) {
+ object NextId extends ScreenVar[String](Helpers.nextFuncName) {
override lazy val __nameSalt = Helpers.nextFuncName
}
@@ -1449,6 +1449,7 @@ trait LiftScreen extends AbstractScreen with StatefulSnippet with ScreenWizardRe
Referer.get // touch to capture the referer
Ajax_?.get // capture the ajaxiness of these forms
FormGUID.get
+ NextId.get
if (FirstTime) {
FirstTime.set(false)

0 comments on commit 3aa7b73

Please sign in to comment.