On Tue, Mar 9, 2010 at 6:17 AM, Francois <[email protected]> wrote:

> Le 09/03/2010 10:12, Francois a écrit :
>
>  Hello guys,
>>
>>
>> I'm often using forms without anything to do persistence and RDBMS
>> related, but I would like to be able to use Fields (StringField,
>> EmailField, my owns, etc), validation, error management, etc. without
>> having everything to manage by hand.
>>
>
>
> After searching more carefully on the mailing list archive, it seems that
> what I'm looking for is something like a mix of one-page wizard with
> Record/Mapper fields integration (or fields that are currently in
> Record/Mapper/Wizard may live in there own package and only manage the
> domain/client part ?)
>

Please look at LiftScreen.  Here's the code from example/..../Wizard.scala:

object PersonScreen extends LiftScreen {
  object person extends ScreenVar(Person.create)


  override def screenTopTextAsHtml = Full(<b>A single screen with some input
validation</b>)

  _register(() => person.is)

  val shouldSave = new Field with BooleanField {
    def name = "Save ?"
  }

  def finish() {
    if (shouldSave.is) {
      person.is.save
    }
  }
}

So, you can define your own fields (e.g. val shouldSave extends new Field
with BooleanField)  You can also register a FieldContainer (by calling
_register in the constructor).  A FieldContainer will return you a list of
BaseField (net.liftweb.util.BaseField).  So, Mapper objects implement
FieldContainer.  So, you can blend in a Mapper objects as well as anything
else that has collections of BaseField with fields that you define.

You can override doSetup() on the LiftScreen.  It will be called when the
Screen is entered.  You have to implement the finish() method which will be
called on successful submission of the Screen.  Each field has its own
validation rules.  If you want to validate across fields, you can overload
the LiftScreen's validate method.

Does this help?  One of my open tickets is to provide documentation and
examples of LiftScreen and Wizard (Wizard is a multi-page collection of
Screens).  If you can give me a idea of a good example for you, I'll work on
it.

Thanks,

David



>
> Relevant threads:
> - http://old.nabble.com/Multipage-wizards-td26504293.html (especially
> Jeppe answer)
> -
> http://old.nabble.com/Lift-Wizard-Fields-incompatible-with-lift-record-fields-tc27230782.html
>
>
> So, I'm going to see how wizards are working,
>
>
> Thanks,
> --
> Francois ARMAND
> http://fanf42.blogspot.com
>
> --
> 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]<liftweb%[email protected]>
> .
> 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
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 [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=en.

Reply via email to