Thank you - all works if I replace

"image" -> <img src={p.imageUrl.is}/>

with

"image" -%> <img src={p.imageUrl.is}/>

which results in the expected

<img src="http://clients.vc-ltd.co.uk/burnham2/photos/rose.jpg";
height="100" width="75" style="border:3px solid #CCCCCC" />

-- Ewan

On Sep 16, 2:40 pm, Naftoli Gugenheim <naftoli...@gmail.com> wrote:
> Tim is right that it worked that way, but apparently that code was committed 
> before the review board was in place :) because DPP wasn't happy with it and 
> took it out. Instead you can use -%> to bind and preserve all attributes.
>
> -------------------------------------
>
> Ewan<ehar...@gmail.com> wrote:
>
> Thanks but I still have no joy.  My snippet binding is as follows:
>
> property.map ({ p =>
>         bind("property", html,
>              "id" -> p.id,
>              "name" -> p.name,
>              "image" -> <img src={p.imageUrl.is}/>)
>     }) openOr notFound
>
> with the following xhtml:
>
>         <lift:Property.view form="POST">
>                 ....
>                 <property:image property:style="border:3px solid #CCCCCC"
> property:width="75" property:height="100" />
>                 ....
>         </lift:Property.view>
>
> and the result is always the img tag with the src attrib that I
> supplied in the binding i.e. the style, width and height are not
> merged.  Code like this in the Lift book (pops a timestamp in a div)
> does not work (merge attribs) either.
>
> Any ideas what I am doing wrong?
>
> -- Ewan
>
> On Sep 16, 11:56?am, Timothy Perrett <timo...@getintheloop.eu> wrote:
>
> > I think id do:
>
> > <lift:MySnippet.example>
> > ? <whatever:demo whatever:src="something.jpg" whatever:style="border:
> > black" />
> > </lift:MySnippet.example>
>
> > then in the scala:
>
> > class MySnippet {
> > ? def example(xhtml: NodeSeq):NodeSeq = bind("whatever", xhtml,
> > ? ? "demo" -> <img />
>
> > }
>
> > Basically, when attributes are name-spaced correctly, they are merged
> > into the node attributes. This is all from memory so might need a
> > slight change to compile properly.
>
> > Cheers, Tim
>
> > On Sep 16, 11:49?am, Viktor Klang <viktor.kl...@gmail.com> wrote:
>
> > > On Wed, Sep 16, 2009 at 12:37 PM, Ewan <ehar...@gmail.com> wrote:
>
> > > > I'd like to pop the bound value from a snippet into some standard
> > > > xhtml tags but it does not parse. ?In the case below I want the url to
> > > > be put into the img tag where <property:imageUrl/> is bound to ta
> > > > snippet.
>
> > > > <img src=<property:imageUrl/> ?style="border:3px solid #CCCCCC"
> > > > width="75" height="100"/>
>
> > > Have a snippet that simply adds the src attribute to the supplied markup
>
> > > <lift:img src="imageUrl">
> > > ? ?<img style="fooo" width="75" height="100/>
> > > </lift:img>
>
> > > > I am unable to do this so as a work around I get the snippet to create
> > > > the xhtml img tag but is there a way to achieve the above as I don't
> > > > want to change scala src for every minor ui change.
>
> > > > -- Ewan
>
> > > --
> > > Viktor Klang
>
> > > Blog: klangism.blogspot.com
> > > Twttr: viktorklang
>
> > > Lift Committer - liftweb.com
> > > AKKA Committer - akkasource.org
> > > Cassidy - github.com/viktorklang/Cassidy.git
> > > SoftPub founder:http://groups.google.com/group/softpub
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@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