How to use confirmScreen_? in a Wizard?

59 views
Skip to first unread message

Trond Marius Øvstetun

unread,
Dec 16, 2010, 6:38:00 AM12/16/10
to lif...@googlegroups.com
Hi.

I am building a wizard and am wondering how to use the confirmScreen_? method on my last screen.
What is supposed to happen when I override this to true? I get an empty screen, i thought I was supposed to get a listing of all fields used in all my (other) screens.

I can't find an example illustrating this, can someone point me in the right direction?

My wizard is looking something like this (and the last screen is empty..):

object ForrisTest extends Wizard {
  val s = new Screen {
    val prosjektnummer = field("Prosjektnummer", 0)
    val ok = radio("Er testen ok?", "Feil", List("OK", "Feil"))

    private object FirstTime extends WizardVar[Boolean](true)
    override def transitionIntoFrom(from: Box[Screen]) {
      if (FirstTime.get) {
        FirstTime.set(false)
      }
    }
  }

  val s2 = new Screen {
    val prosjekt = field("prosjekt", "")
  }

  val conf = new Screen {
    override def confirmScreen_? = true
  } 
  override def finish {
    S.notice("prosjekt" + s.prosjektnummer + s.ok)
  }
}


thanks,
TronD

David Pollak

unread,
Dec 17, 2010, 7:03:46 PM12/17/10
to lif...@googlegroups.com


2010/12/16 Trond Marius Øvstetun <tr...@ovstetun.no>

Hi.

I am building a wizard and am wondering how to use the confirmScreen_? method on my last screen.
What is supposed to happen when I override this to true? I get an empty screen, i thought I was supposed to get a listing of all fields used in all my (other) screens.

You should get what you expect, but there's a bug in Wizard.  Please open a ticket at http://ticket.liftweb.net (you must be a watcher of the Liftweb assembla space to open tickets) and we'll get it fixed.
 

I can't find an example illustrating this, can someone point me in the right direction?

My wizard is looking something like this (and the last screen is empty..):

object ForrisTest extends Wizard {
  val s = new Screen {
    val prosjektnummer = field("Prosjektnummer", 0)
    val ok = radio("Er testen ok?", "Feil", List("OK", "Feil"))

    private object FirstTime extends WizardVar[Boolean](true)
    override def transitionIntoFrom(from: Box[Screen]) {
      if (FirstTime.get) {
        FirstTime.set(false)
      }
    }
  }

  val s2 = new Screen {
    val prosjekt = field("prosjekt", "")
  }

  val conf = new Screen {
    override def confirmScreen_? = true
  } 
  override def finish {
    S.notice("prosjekt" + s.prosjektnummer + s.ok)
  }
}


thanks,
TronD

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

Trond Marius Øvstetun

unread,
Dec 20, 2010, 6:06:21 AM12/20/10
to lif...@googlegroups.com

Ryszard Perkowski

unread,
Jan 9, 2011, 12:57:04 PM1/9/11
to Lift
Hi, answering the question in the ticket http://www.assembla.com/spaces/liftweb/tickets/792
> I think the solution displayed in the images looks good for now. No need (at least in my case) to be able to edit the fields in the confirm screen.

> A question:
> How can you control how a field is displayed on the confirm screen? In my case I have some fields where I have overridden the toForm method (i.e to make a field display as read-only, the value set automatically in the background on screen load), is there some way to do the same for the confirm screen?
>
> Thanks for quick replies and fixes, great work :)


Every SettableField field (having toForm method) is also a
ReadableField field (having asHtml method).. there is a method in the
patched Wizard.scala (confirmScreenField) which uses that asHtml
method to create the confirm screen fields. So in your case if you
just want to have a customized read-only representation of your field
you can override that method (asHtml) too.
If you would like to have one read-only representation of your field
on the normal wizard screen and a completely different one on the
confirm screen, that is also possible but you have to extend the Field
trait in Wizard.scala ( by adding i.e. asConfirmHtml method) and
override couple of methods (Screen.screenFields and
Wizard.confirmScreenFields) that render the confirm screen field.

regards
Rysiek

On Dec 20 2010, 12:06 pm, Trond Marius Øvstetun <tr...@ovstetun.no>
wrote:
> Done, ticket is athttps://www.assembla.com/spaces/liftweb/tickets/792-confirmscreen_--s...
>
> Thanks :)
>
> /trond
>
> On Sat, Dec 18, 2010 at 1:03 AM, David Pollak <feeder.of.the.be...@gmail.com
>
>
>
>
>
>
>
>
>
> > wrote:
>
> > 2010/12/16 Trond Marius Øvstetun <tr...@ovstetun.no>
>
> > Hi.
>
> >> I am building a wizard and am wondering how to use the confirmScreen_?
> >> method on my last screen.
> >> What is supposed to happen when I override this to true? I get an empty
> >> screen, i thought I was supposed to get a listing of all fields used in all
> >> my (other) screens.
>
> > You should get what you expect, but there's a bug in Wizard.  Please open a
> > ticket athttp://ticket.liftweb.net(you must be a watcher of the Liftweb
> >> liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com >
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/liftweb?hl=en.
>
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > Follow me:http://twitter.com/dpp
> > Blog:http://goodstuff.im
> > Surf the harmonics
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Lift" group.
> > To post to this group, send email to lif...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com >
> > .

Trond Marius Øvstetun

unread,
Jan 10, 2011, 6:59:15 AM1/10/11
to lif...@googlegroups.com
Great, thanks for the explanation :)
When will this change be available for testing as a snapshot?

/trondmarius

To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
TronD

Ryszard Perkowski

unread,
Jan 10, 2011, 3:31:53 PM1/10/11
to Lift
The described solution is just a sample implementation for my own
project needs. For a snapshot we'll wait until Lift commiters have
time to investigate this issue and provide implementation that suits
the framework needs.
Rysiek
> > > > ticket athttp://ticket.liftweb.net(youmust be a watcher of the
> > <liftweb%2Bunsu...@googlegroups.com<liftweb%252Bunsubscribe@googlegroup s.com>>
> > > >> .
> > > >> For more options, visit this group at
> > > >>http://groups.google.com/group/liftweb?hl=en.
>
> > > > --
> > > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > > Beginning Scalahttp://www.apress.com/book/view/1430219890
> > > > Follow me:http://twitter.com/dpp
> > > > Blog:http://goodstuff.im
> > > > Surf the harmonics
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Lift" group.
> > > > To post to this group, send email to lif...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com >
> > <liftweb%2Bunsu...@googlegroups.com<liftweb%252Bunsubscribe@googlegroup s.com>>

Trond Marius Øvstetun

unread,
Jan 11, 2011, 9:23:43 AM1/11/11
to lif...@googlegroups.com
Any ack from a committer as to the proposed solution and how this should be handled from here on?

/trondmarius

To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
TronD

David Pollak

unread,
Jan 11, 2011, 9:25:58 AM1/11/11
to lif...@googlegroups.com


2011/1/11 Trond Marius Øvstetun <tr...@ovstetun.no>

Any ack from a committer as to the proposed solution and how this should be handled from here on?

I own the ticket.  I will write the code.  We don't accept patches per our IP policy.  The ticket is scheduled for M1 which will land in early February.  I'm flat out on a project right now.
 



--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Reply all
Reply to author
Forward
0 new messages