質問

I just started using Lift's Wizard/LiftScreen classes and need to add placeholder text to my text fields. I found the FieldTransform class as a solution to this here https://groups.google.com/forum/#!topic/liftweb/x_t9rvvZ8jk and here http://comments.gmane.org/gmane.comp.web.lift/59985

But now I'm trying to use that information, but can't for the life of me figure out what import statement is needed (where the class is, in the libraries).

Lift 2.5-M3 talks about the API changing liftweb.net/25_m3, but nowhere do I find the class actually listed in the API (liftweb.net/api/25/api/#package).

What's the import I need? How should I be looking this up; I'd like to know how to find a class quickly next time.

EDIT: To be a good Stackoverflow citizen, here's some code.. :-)

object WizardExample extends Wizard {
  val screen1BrandInfo = new Screen {
    val brandName = field("Name", "Mike")
  }
}

I'm trying to add HTML5 placeholder text to the "Name" field so the user sees sample text when they view the page.

RESOLUTION:

Wow, that was my first StackOverflow. I'm blown away by what I've learned from you guys in a few hours!

@jcern: thanks for all your help. I'm working in Lift 2.4, so initially I didn't find FieldTransform in Wizard$Screen, then I clicked on the link you provided (2.5) and saw it. What a jungle to navigate! Thanks for all your help. I now see how to navigate all this. And thanks again so much for the "All" view hint. That was critical!

@Vasya Novikov: Thanks so much for this answer. This is what I'll have to do since I'm working in 2.4 and don't have access to FieldTransform.

役に立ちましたか?

解決

The two best places to find classes in Lift are either in the API:

http://liftweb.net/api/25/api/#package

Or, directly in GitHub (where you can search for classes and for text/definitions within them):

https://github.com/lift/framework

As for the FieldTransform class, that should be available to any class that extends LiftScreen. See the API here -- you may need to toggle the visibility to All to see FieldTransform as it is a protected class.

You can import LiftScreen with:

import net.liftweb.http.LiftScreen
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top