Skip to content

When trying to learn lift

28 March 2011

use a goooood editor.

Today I was trying to get a really simple form working in lift, using the designer friendly approach. I kept on stumbling on the same kind of error:
error: value #> is not a member of java.lang.String
"#name" #> SHtml.text(name, name = _) &

and I could not figure out what was wrong with the code that I had practically copied from the simply lift web site. I kept trimming statements from my code till I had practically nothing left but a simple statement.

And then finally lightening struck. The error was telling me all the time what the problem was, I was just too daft to understand it. The code looked like:
def render = {
"#name" #> SHtml.text(name, name = _) &
"#description" #> SHtml.text(description, description = _) &
"type=submit" #> SHtml.onSubmitUnit(process)

as I said, just like the lift web site. However what I failed to see in the error message was the part that #> is not a part of the string. So I had forgotten to import the class that could make sense of the #>;

So adding the right import statement (import net.liftweb.util.Helpers._) fixed the issue I had. If only I had used a more up to date editor, then I might have picked this up sooner.


From → lift, scala

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: