confirmScreen_? should display all fields in wizard
As per discussion in http://groups.google.com/group/liftweb/browse_thread/thread/9636ba87669000b7#
When overriding confimScreen_? in a Wizard, the page should display all visible fields used in all screens of the wizard.
Currently my screen displays nothing when using this.
Code:
When overriding confimScreen_? in a Wizard, the page should display all visible fields used in all screens of the wizard.
Currently my screen displays nothing when using this.
Code:
object MyWizard 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)
}
}
Leave a comment
file:bIT-j4gsyr4iryeJe5cbLr: diff with master_2.7
simple field list on confirmation page
screen-info-aware field list on confirmation page
on 2011-01-05 18:49 *
By Ryszard Perkowski
Hi, please take a look whether this solution will fit the need. I've added to this issue a diff against master-2.7 with a implementation of possible confirmation page.
There are also two screenshots of the example wizard with confirmation page added.
Below some implementation details
Calculating fields on confirmation page
Using snapshots to get the screen path that the user has taken. User can override the Wizard.screenPath method to override the default behavior and i.e. show all the fields
Wizard confirmation rendering
One can display just the individual fields of the screens visited by the user or he can also reuse on the confirmation page the screen info (screen top, screen name, etc.). The attached image suggests the usage
Field visibility
using builder you can control where you want to show your field. I.e. you can display an artificial field that will be just displayed on the confirmation page or can say that a field will be displayed on it's screen but it will not be displayed on the confirmation page
Possible additions
• making confirm page editable. One would need to wrap the whole wizard in a form, still I was not sure whether that was required for this ticket so I stopped on the read only part (still editable version is also possible)
There are also two screenshots of the example wizard with confirmation page added.
Below some implementation details
Calculating fields on confirmation page
Using snapshots to get the screen path that the user has taken. User can override the Wizard.screenPath method to override the default behavior and i.e. show all the fields
Wizard confirmation rendering
One can display just the individual fields of the screens visited by the user or he can also reuse on the confirmation page the screen info (screen top, screen name, etc.). The attached image suggests the usage
Field visibility
using builder you can control where you want to show your field. I.e. you can display an artificial field that will be just displayed on the confirmation page or can say that a field will be displayed on it's screen but it will not be displayed on the confirmation page
Possible additions
• making confirm page editable. One would need to wrap the whole wizard in a form, still I was not sure whether that was required for this ticket so I stopped on the read only part (still editable version is also possible)
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 :)
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 :)