David Pollak <feeder.of.the.be...@gmail.com> writes:

> null... shudder. :-)

Yeaah, somehow it doesn't look nice anymore :-) Your idea with an Option/Box
for attribute binding seems nice & clean

/Jeppe

>
> On Wed, Dec 2, 2009 at 12:32 AM, Jeppe Nejsum Madsen <je...@ingolfs.dk>wrote:
>
>> Alex Black <a...@alexblack.ca> writes:
>>
>> > Is there a good/reasonable way to conditionally output
>> > checked="checked" or output nothing?
>>
>> If you output null for the attribute value, the attribute is not
>> rendered:
>>
>> scala> bind("stuff", <input type="checkbox" stuff:s=""/>,
>> AttrBindParam("s",Text("checked"),"checked"))
>> res11: scala.xml.NodeSeq = <input type="checkbox"
>> checked="checked"></input>
>>
>> scala> bind("stuff", <input type="checkbox" stuff:s=""/>,
>> AttrBindParam("s",null,"selected"))
>> res12: scala.xml.NodeSeq = <input type="checkbox" ></input>
>>
>> /Jeppe
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> liftweb+unsubscr...@googlegroups.com<liftweb%2bunsubscr...@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 lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.


Reply via email to