Hi Tim,
I'm new at Lift myself, so this may not be what you are looking for.
I think though that
maybe what you need to try is the "SHtml.a(...)" method to create a
link, and in that you
can reference a method (that you define) to dynamically update some
component of the
current page via the SetHtml method (maybe via the "embed" directive
on a NodeSeq).
I can't post the entire code, but in one of my projects,
I had a webpage that basically was divided into two parts -- left side
and right side. The left hand side listed
the schools in a county. The right hand side was for editing that
school (e.g. if the school
name changed).
So I had:
--------------
def doBind(in:NodeSeq):NodeSeq = {
val slist = School.findAll(By(School.sysnum,
mySystem),OrderBy(School.schname, Ascending))
slist match {
case schools => {
rows = schools.flatMap(e => {
Helpers.bind("row", chooseTemplate("list","school", in),
"name" -> SHtml.a(updateSchool(e.id.toInt),
Text(e.schname))
)
})
}
}
bind("list", in,
"newsch" -> SHtml.a(updateSchool(-1), Text("Add a new
school")),
"schools" -> rows)
}
-----------
Notice the SHtml.a(...) -- actually there are two of them. Once is
creating
a link for "adding" a new school" (I use "-1" as the param to indicate
to the updateSchool method that this a a new school, so don't try
finding it
in the database), and the other is for editing a school (with the
given id). So
visually, the left hand side of my webpage has a link called "Add A
New School"
followed by a bunch of rows of school names, each clickable so that
when
clicked the right hand side of the page either displays data for an
existing
school for editing, or it creates a blank form on the right hand side
for entering
data about a new school.
The connection is the "updateSchool()" method in the first param of
the SHtml.a
method. It looks like this in my case:
def updateSchool(id:Int) : () => JsCmd = {
() => SetHtml("schedit", <lift:SchoolMgr.schoolEdit
eager_eval="true" sid={id.toString}><lift:embed what="schooledit" /></
lift:SchoolMgr.schoolEdit>)
}
So I have a div called "schedit" (basically the right hand side of the
webpage) that I'm saying needs
to be updated/replaced with the Nodseq that is in the 2nd param.
I realize that this is not using a sitemap menu (at least the way I'm
thinking about it), and probably there is
some other way to do the above. And this was older code, so it
doesn't use the new CSS selector
transforms (see sect 7.10 of David's Simply Lift book). Hope it
helps though.
Rog