FormBuilderLocator and generic types

21 views
Skip to first unread message

Peter Brant

unread,
Apr 15, 2011, 6:40:49 PM4/15/11
to lif...@googlegroups.com
Hi all,

I'm trying to register a custom FormBuilderLocator for a generic type.

Boot.scala has this

LiftRules.prependGlobalFormBuilder(FormBuilderLocator[FormValue[CaseNo]]((value,
setter) =>
SHtml.text(value.asString, s => setter(new FormValue[CaseNo](s)))))

My screen object has this

val caseNo = field("Case No", new FormValue[CaseNo], valConversion)

The part that I don't understand is that the FormBuilderLocator is
registered under the string key

gov.wicourts.jdash2.form.FormValue[gov.wicourts.jdash2.lib.CaseNo]

but vendForm() is looking for a FormBuilderLocator under the string key

gov.wicourts.jdash2.form.FormValue[_ <: gov.wicourts.jdash2.lib.CaseNo]

The other odd thing is that FormValue[String] works fine. I thought
maybe this was because String is final, but that doesn't seem to
matter.

Does anybody have any ideas how to make this work?

Thanks much,

Pete

David Pollak

unread,
Apr 15, 2011, 7:05:22 PM4/15/11
to lif...@googlegroups.com
On Fri, Apr 15, 2011 at 3:40 PM, Peter Brant <peter...@gmail.com> wrote:
Hi all,

I'm trying to register a custom FormBuilderLocator for a generic type.

Boot.scala has this

   LiftRules.prependGlobalFormBuilder(FormBuilderLocator[FormValue[CaseNo]]((value,
setter) =>
     SHtml.text(value.asString, s => setter(new FormValue[CaseNo](s)))))

My screen object has this

   val caseNo = field("Case No", new FormValue[CaseNo], valConversion)

The part that I don't understand is that the FormBuilderLocator is
registered under the string key

I don't understand it either. :-(

just for kicks try:

val caseNo = field[FormValue[CaseNo]](....)

If that works, woo hoo.  If it doesn't let's do some more digging.

Also, if you can put together a small example of the issue (see Posting example code | Lift Space | Assembla ), please open a ticket on the issue (http://ticket.liftweb.net you must be a watcher of the LiftWeb space on Assembla) and we'll make it easier for the next person.
 

gov.wicourts.jdash2.form.FormValue[gov.wicourts.jdash2.lib.CaseNo]

but vendForm() is looking for a FormBuilderLocator under the string key

gov.wicourts.jdash2.form.FormValue[_ <: gov.wicourts.jdash2.lib.CaseNo]

The other odd thing is that FormValue[String] works fine.  I thought
maybe this was because String is final, but that doesn't seem to
matter.

Does anybody have any ideas how to make this work?

Thanks much,

Pete

--
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

Peter Brant

unread,
Apr 15, 2011, 7:08:00 PM4/15/11
to lif...@googlegroups.com
A woo hoo it is. Thanks much.

Pete

Peter Brant

unread,
Apr 15, 2011, 7:17:17 PM4/15/11
to lif...@googlegroups.com
Oh, do you still want a sample project and issue for this (which I'm
happy to provide if you want)?

Pete

David Pollak

unread,
Apr 15, 2011, 7:24:13 PM4/15/11
to lif...@googlegroups.com
On Fri, Apr 15, 2011 at 4:17 PM, Peter Brant <peter...@gmail.com> wrote:
Oh, do you still want a sample project and issue for this (which I'm
happy to provide if you want)?

It would be helpful to have the example and a ticket.  The Lift for Scala 2.7.7 code has to use String because Manifest was not comparable.  Scala 2.8.0+ supports comparable manifests and I'd like to switch over to that mechanism and also make things much more sane for folks using Screen/Wizard.

Thanks!

David

PS -- Isn't it beer time in Wisconsin?
 

Peter Brant

unread,
Apr 15, 2011, 7:50:45 PM4/15/11
to lif...@googlegroups.com
Well, maybe it is. :-) I'll add the ticket tomorrow.

Pete

On Fri, Apr 15, 2011 at 6:24 PM, David Pollak

Peter Brant

unread,
Apr 16, 2011, 8:40:02 AM4/16/11
to Lift
Ticket here

https://www.assembla.com/spaces/liftweb/tickets/977-formbuilderlocator-with-generic-type-can-t-always-be-found

Pete

On Apr 15, 6:50 pm, Peter Brant <peter.br...@gmail.com> wrote:
> Well, maybe it is. :-)  I'll add the ticket tomorrow.
>
> Pete
>
> On Fri, Apr 15, 2011 at 6:24 PM, David Pollak
>
>
>
>
>
>
>
> <feeder.of.the.be...@gmail.com> wrote:
>
> > On Fri, Apr 15, 2011 at 4:17 PM, Peter Brant <peter.br...@gmail.com> wrote:
>
> >> Oh, do you still want a sample project and issue for this (which I'm
> >> happy to provide if you want)?
>
> > It would be helpful to have the example and a ticket.  The Lift for Scala
> > 2.7.7 code has to use String because Manifest was not comparable.  Scala
> > 2.8.0+ supports comparable manifests and I'd like to switch over to that
> > mechanism and also make things much more sane for folks using Screen/Wizard.
>
> > Thanks!
>
> > David
>
> > PS -- Isn't it beer time in Wisconsin?
>
> >> Pete
>
> >> On Fri, Apr 15, 2011 at 6:08 PM, Peter Brant <peter.br...@gmail.com>
> >> wrote:
> >> > A woo hoo it is.  Thanks much.
>
> >> > Pete
>
> >> > On Fri, Apr 15, 2011 at 6:05 PM, David Pollak
> >> > <feeder.of.the.be...@gmail.com> wrote:
>
> >> >> On Fri, Apr 15, 2011 at 3:40 PM, Peter Brant <peter.br...@gmail.com>
> >> >> wrote:
>
> >> >>> Hi all,
>
> >> >>> I'm trying to register a custom FormBuilderLocator for a generic type.
>
> >> >>> Boot.scala has this
>
> >> >>>  LiftRules.prependGlobalFormBuilder(FormBuilderLocator[FormValue[CaseNo]]((v alue,
> >> >>> setter) =>
> >> >>>      SHtml.text(value.asString, s => setter(new
> >> >>> FormValue[CaseNo](s)))))
>
> >> >>> My screen object has this
>
> >> >>>    val caseNo = field("Case No", new FormValue[CaseNo], valConversion)
>
> >> >>> The part that I don't understand is that the FormBuilderLocator is
> >> >>> registered under the string key
>
> >> >> I don't understand it either. :-(
>
> >> >> just for kicks try:
>
> >> >> val caseNo = field[FormValue[CaseNo]](....)
>
> >> >> If that works, woo hoo.  If it doesn't let's do some more digging.
>
> >> >> Also, if you can put together a small example of the issue (see Posting
> >> >> example code | Lift Space | Assembla ), please open a ticket on the
> >> >> issue
> >> >> (http://ticket.liftweb.netyou must be a watcher of the LiftWeb space
> >> >> Beginning Scalahttp://www.apress.com/book/view/1430219890
> >> >> Follow me:http://twitter.com/dpp
> >> >> Blog:http://goodstuff.im
>
> >> >> --
> >> >> 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.
>
> >> --
> >> 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 frameworkhttp://liftweb.net
> > Simply Lifthttp://simply.liftweb.net
> > Beginning Scalahttp://www.apress.com/book/view/1430219890

Peter Brant

unread,
Apr 16, 2011, 10:02:49 AM4/16/11
to lif...@googlegroups.com
Hmm... sorry if this comes through twice, but I would have expected
this to have shown up by now.

In any case, ticket is here

https://www.assembla.com/spaces/liftweb/tickets/977-formbuilderlocator-with-generic-type-can-t-always-be-found

Pete

David Pollak

unread,
Apr 16, 2011, 1:07:10 PM4/16/11
to lif...@googlegroups.com
On Sat, Apr 16, 2011 at 7:02 AM, Peter Brant <peter...@gmail.com> wrote:
Hmm... sorry if this comes through twice, but I would have expected
this to have shown up by now.

Thanks for the ticket.  New posters are moderated... mainly to avoid spam/porn on the list and it happens that moderators are not always moderating 24/7. ;-)
 
Reply all
Reply to author
Forward
0 new messages