I modified the BindHelper in the branch, I am working on some time back to
allow automatic mixin binding by name.
If you have in your html
<input name="favourite:yourName" size="20" maxlength="40"/>,
then it will accept in the snippet
bind("favourite", xhtml, "yourName" -> SHtml.text("show string, s =>
setBio(s))
and output something like
<input name="38833747474#" size="20" maxlength="40" value="show string"/>
if you include attributes in the snippets bind, that are already in the
html, it will substitute them
Is this something like what you are trying to achieve?
On Thu, Jun 18, 2009 at 6:51 AM, David Pollak <[email protected]
> wrote:
> I can see a set of methods that look like:
> textarea(f: String => Unit)(n: NodeSeq) that will slurp the values and
> attributes out of the NodeSeq... so you'd bind like:
>
> "biography" -> textarea(s => setBio(s)) _
>
> On Wed, Jun 17, 2009 at 10:22 AM, Matt Williams <[email protected]>wrote:
>
>>
>> I wholeheartedly agree with the philosophy of separating the display
>> from the program logic, and am currently getting to grips with the
>> generators, but am finding that now I end up with a degree of markup
>> within my code.
>>
>> Can you think of any caveats to infering the node type passed, and
>> dynamically using the relevant generators to construct the returned
>> node.
>>
>> I am thinking something along the lines of:
>>
>> <person:biography>
>> <textarea style="myStyle" cols="20" rows="5">
>> This is a sample of some biography text
>> </textarea>
>> </person:biography>
>>
>> Where it would automatically infer that it is a textarea, pass through
>> the relevant attributes, and insert whatever function, values, etc I
>> have specified in my snippet.
>>
>> What are your thoughts on this?
>>
>> Brgds,
>>
>> Matt
>>
>>
>>
>>
>
>
> --
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---