[Lift] Re: Problem with FocusOnLoad and passing attributes through bind

2010-03-06 Thread Luke Nezda
Thanks for responding Marius. You're right, my doSearch method doesn't need the msg parameter -- that was just an artifact of transforming an example (removed now). As far as my specific issue, I guess you're saying the best solution is for the framework to add overload def -%(in: NodeSeq =

[Lift] Re: Problem with FocusOnLoad and passing attributes through bind

2010-03-06 Thread Luke Nezda
Thanks for responding Marius. You're right, my doSearch method doesn't need the msg parameter -- that was just an artifact of transforming an example (removed now). As far as my specific issue, I guess you're saying the best solution is for the framework to add overload def -%(in: NodeSeq =

[Lift] Re: Problem with FocusOnLoad and passing attributes through bind

2010-03-06 Thread Marius
In the short term you would solve it as I suggested: Use in your bind searchBox -% doSearch and define your doSearch as: def doSearch: NodeSeq = { ... do your stuff here } Actually thinking more into it there is a good reason for -% to not have a (NodeSeq) = NodeSeq support. -% means that

[Lift] Re: Problem with FocusOnLoad and passing attributes through bind

2010-03-06 Thread Marius
You could also do it like this: bind(ajax, xhtml, searchBox -% SHtml.ajaxText(, q = SetHtml(resultz, Yawni.query(q)) ) ++ Script(JqOnLoad(SetValueAndFocus(myfield, ))) SetValueAndFocus is already in JqJsCmds but it really should in in JsCmds as it does not depend on JQuery.

[Lift] Re: Problem with FocusOnLoad and passing attributes through bind

2010-03-06 Thread Luke Nezda
Hi, Marius - Ok, I think I catch the drift of your solution. You said: bind(ajax, xhtml, searchBox -% SHtml.ajaxText(, q = SetHtml(resultz, Yawni.query(q)) ) ++ Script(JqOnLoad(SetValueAndFocus(myfield, ))) which is missing a paren -- I think you meant:

[Lift] Re: Problem with FocusOnLoad and passing attributes through bind

2010-03-06 Thread Marius
Yes you understanding is correct. FocusOnLoad is not an appropriate solution for your particular problem as -% and FocusOnLoad operate on two different types which are not interchangeable due to attributes preservation as you well noticed. Besides the solution I posted above is similar with what

[Lift] Re: Problem with FocusOnLoad and passing attributes through bind

2010-03-06 Thread cody koeninger
On Mar 6, 10:57 am, Marius marius.dan...@gmail.com wrote: Actually thinking more into it there is a good reason for -% to not have a (NodeSeq) = NodeSeq support. -% means that it preserves the attributes specified in the template to the resulting node.But having a bunch of attributes we

Re: [Lift] Re: Problem with FocusOnLoad and passing attributes through bind

2010-03-06 Thread Naftoli Gugenheim
The fundamental problem is that at the top bind level you want to use FocusOnLoad which returns a NodeSeq, but you also want bind to pass along the attributes, which has to operate at a lower level. So you can use bind twice, nested. Try this pattern: bind(pre, xhtml, label - {ns: NodeSeq =

[Lift] Re: Problem with FocusOnLoad and passing attributes through bind

2010-03-05 Thread Luke Nezda
Hello, Bumping my own post since I hadn't received any feedback on this in a few weeks. Maybe I didn't describe my issue well ? Thanks in advance, - Luke On Feb 21, 8:12 pm, Luke Nezda lne...@gmail.com wrote: Hello, I am new to Scala and Lift.  I am having a problem using 2 features

[Lift] Re: Problem with FocusOnLoad and passing attributes through bind

2010-03-05 Thread Marius
On 22 feb., 04:12, Luke Nezda lne...@gmail.com wrote: Hello, I am new to Scala and Lift.  I am having a problem using 2 features together which seem to work fine individually.  Here's a simplified piece of the code: class Ajax {   def someResult(q:String) = spansome results for query