On Wed, Nov 11, 2009 at 12:35 AM, aw <anth...@whitford.com> wrote: > > I need to create a snippet sequence that looks something like this: > > <a href="next"> > <span class="name">name</span> > <span class="comment">description</span> > <span class="arrow"/> > </a> > > The anchor needs to be generated using SHtml.link, and name & > description need to be bound. As a result, I end up with a template > sequence like this: > > <b1:link> > <span class="name"><b2:name/></span> > <span class="comment"><b2:description/></span> > <span class="arrow"/> > </b1:link> > > Then, I need snippet code that does something like: > > bind("b1", xhtml, > "link" -> SHtml.link(S.contextPath, () => clicked(b), bind("b2", > chooseTemplate("b1", "link", xhtml), "name" -> Text(b.name), > "description" -> Text(b.description) )) >
Why are you using S.contextPath? But: bind("b1", xhtml", "link" -> kids => SHtml.link("/", () => clicked(b), bind("b2", kids, "name" -> b.name.is, "description" -> b.description.is ))) > > Yuk... I'm just not happy with this. Sure, I could make it a little > more readable, but this still seems unnecessarily complex and > verbose. I also really don't like how the view logic is dictating my > binding logic. In other words, if I wanted to change my view > organization, there is a high chance that I also need to change my > binding logic -- and that just isn't right... > > Is there a better strategy? > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---