Ross Mellgren <dri...@gmail.com> writes:

> Move the bind to an inner function, and call that function  
> recursively, for example:

Aha!  This gets me to:

  def doShowAll(in: NodeSeq): NodeSeq = {
    def doBinding(ns: NodeSeq, i: ImageInfo): NodeSeq =
      bind("showAll", ns, 
           "name" -> i.name.is,
           "link" ->
             {n: NodeSeq => SHtml.link("/viewImage", () => selected(i.id),
                                 doBinding(n, i))},
           "category" -> 
             i.category.obj.open_!.name,  // XXX safe unless key rel is corrupt 
?
           AttrBindParam("imgUrl", i.url, "src")
         )

    ImageInfo.findAll(
        By(ImageInfo.category, category),
        OrderBy(ImageInfo.name, Ascending)
      ).flatMap({i => doBinding(in, i)})
  }

which does exactly what I need!

Thanks much,
-- 
                                Jim Wise
                                jw...@draga.com

Attachment: pgpUZxCXm2kPS.pgp
Description: PGP signature

Reply via email to