Skip to content

Commit

Permalink
Create next ID right away
Browse files Browse the repository at this point in the history
Create next ID right away so it can be referenced before the screen is
rendered.
  • Loading branch information
pbrant committed Feb 24, 2012
1 parent e272f5f commit 133198c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Expand Up @@ -32,10 +32,6 @@ trait CssBoundLiftScreen extends LiftScreen with CssBoundScreen {
override lazy val __nameSalt = Helpers.nextFuncName
}

protected object NextId extends TransientRequestVar[String]("") {
override lazy val __nameSalt = Helpers.nextFuncName
}

protected object PrevId extends TransientRequestVar[Box[String]](Empty) {
override lazy val __nameSalt = Helpers.nextFuncName
}
Expand Down
Expand Up @@ -39,7 +39,8 @@ trait CssBoundScreen extends ScreenWizardRendered {

protected val LocalAction: AnyVar[String, _] = vendAVar[String]("")

protected val NextId: AnyVar[String, _]
val NextId: AnyVar[String, _]

protected val PrevId: AnyVar[Box[String], _]
protected val CancelId: AnyVar[String, _]

Expand Down
6 changes: 5 additions & 1 deletion web/webkit/src/main/scala/net/liftweb/http/LiftScreen.scala
Expand Up @@ -1358,6 +1358,10 @@ trait LiftScreen extends AbstractScreen with StatefulSnippet with ScreenWizardRe
override lazy val __nameSalt = Helpers.nextFuncName
}

object NextId extends TransientRequestVar[String](Helpers.nextFuncName) {
override lazy val __nameSalt = Helpers.nextFuncName
}

/**
* What to do when the Screen is done. By default, will
* do a redirect back to Whence, but you can change this behavior,
Expand Down Expand Up @@ -1467,7 +1471,7 @@ trait LiftScreen extends AbstractScreen with StatefulSnippet with ScreenWizardRe
}

protected def renderHtml(): NodeSeq = {
val finishId = Helpers.nextFuncName
val finishId = NextId.get
val cancelId = Helpers.nextFuncName

val theScreen = this
Expand Down

0 comments on commit 133198c

Please sign in to comment.