We want an interactive web application that consists of a single page
divided up into multiple panels. Based on user actions and status
changes contents of the individual panels may get updated and/or whole
panels would be replaced by other panels.
Changing out whole panels was straightforward in GWT and only slightly
more complicated in RichFaces/JSF. It isn't quite clear to me how to
do something like this in Lift. Skimming through the Lift book, I can
see pieces that look like they could be used for something like this
but it's very fuzzy as to how they would fit together. I would greatly
appreciate an outline for how something like this would work.
Also, why is it so hard to navigate the ScalaDoc? Having things broken
up into small sections isn't very helpful when looking for a specific
class (I never did find NodeSeq).
Any help is greatly appreciated.
Donald
So, this example (including the Comet chat component that lives in one of the quadrants), is < 200 lines of code. How many lines of code were the other prototypes you built?object Quad {// the legal values and state for each of the quadrantsval upperLeft = List("a", "b", "c")object upperLeftValue extends SessionVar(upperLeft.head) // default to "a"val upperRight = List("b", "z", "q")object upperRightValue extends SessionVar(upperRight.head)val lowerLeft = List("c", "n", "a")object lowerLeftValue extends SessionVar(lowerLeft.head)val quads = Map("UL" -> (upperLeft -> upperLeftValue),"UR" -> (upperRight -> upperRightValue),"LL" -> (lowerLeft -> lowerLeftValue))// define the transformation of the incoming XHTML// to the outgoing XHTML. In this case, we're// going to substitute snippet's rather than transforming// the input to the output. For an example of transformation,// see Chat.scaladef render(in: NodeSeq): NodeSeq = {val myQuad =S.attr("for"). // get the "for" attributemap(_.toUpperCase.trim). // convert it to upper casefilter(quads.contains _). // make sure it's validopenOr("UL") // if it's not valid, assume the upper left// take a snapshot of the valid set of options// and the holder of the current selectionval (set, current) = quads(myQuad)// render the output... the thing to put into// the quadrant. It's a snippet that will// then be expanded into a new template// plus an ajax selector for changing the// template the quadrant displaysdef renderOutput(): NodeSeq =<lift:embed what={"/template-"+current}/> ++SHtml.ajaxSelectObj(set.map(s => s -> s), // this is necessary because// this parameter is actually// the name and the value, but// in this case they're the sameFull(current.is), // the current valueupdateSpan _) // what to do when the select is changed// update the spandef updateSpan(value: String): JsCmd = {current.set(value) // set the current value. Note that the value// of current is the scope in which this method// was created, so it captures the correct// reference for currentSetHtml(myQuad, renderOutput()) // set the span to the newly calculated// output}renderOutput()}}
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
GWT is pretty slick, I have to say.
Thank you,
Donald
Thank you, David for the example. Unfortunately, I can't get it to
work in my environment. I'm getting an exception and I have no idea
what the cause is or how to solve it:
23 Jun 2010 11:28:36,196 - ERROR
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/liftdemo].[default]
- Servlet.service() for
servlet default threw exception
java.lang.NullPointerException
at net.liftweb.http.provider.HTTPProvider$$anonfun$service$3.apply(HTTPProvider.scala:61)
at net.liftweb.http.provider.HTTPProvider$$anonfun$service$3.apply(HTTPProvider.scala:61)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.URLRewriter$.doWith(Req.scala:618)
at net.liftweb.http.provider.HTTPProvider$class.service(HTTPProvider.scala:60)
at net.liftweb.http.LiftFilter.service(LiftServlet.scala:586)
at net.liftweb.http.provider.servlet.ServletFilterProvider$class.protected$service(ServletFilterProvider.scala:67)
at net.liftweb.http.LiftFilter.protected$service(LiftServlet.scala:586)
at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun$doFilter$1$$anonfun$apply$1.apply(ServletFilterProvider.scala:67)
at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun$doFilter$1$$anonfun$apply$1.apply(ServletFilterProvider.scala:62)
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun$apply$10$$anonfun$apply$11$$anonfun$apply$12.apply(Vars.scala:335
)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun$apply$10$$anonfun$apply$11.apply(Vars.scala:334)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun$apply$10.apply(Vars.scala:333)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9.apply(Vars.scala:332)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.CoreRequestVarHandler$class.apply(Vars.scala:331)
at net.liftweb.http.RequestVarHandler$.apply(Vars.scala:250)
at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun$doFilter$1.apply(ServletFilterProvider.scala:61)
at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun$doFilter$1.apply(ServletFilterProvider.scala:61)
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun$apply$10$$anonfun$apply$11$$anonfun$apply$12.apply(Vars.scala:335
)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun$apply$10$$anonfun$apply$11.apply(Vars.scala:334)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun$apply$10.apply(Vars.scala:333)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9.apply(Vars.scala:332)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.CoreRequestVarHandler$class.apply(Vars.scala:331)
at net.liftweb.http.TransientRequestVarHandler$.apply(Vars.scala:254)
at net.liftweb.http.provider.servlet.ServletFilterProvider$class.doFilter(ServletFilterProvider.scala:60)
at net.liftweb.http.LiftFilter.doFilter(LiftServlet.scala:586)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
I have contacted my IT folks to see if I can get Tomcat 6.0.26 installed.
According to the Tomcat manager app:
Tomcat version: Apache Tomcat/6.0.20
JVM version: 1.6.0_15-b03
JVM vendor: Sun Microsystems Inc.
OS: Linux
OS version: 2.6.18-53.1.14.el5
OS architecture: amd64
Bingo!
There was a problem with my build - lift-json.jar was missing and I
got a ClassNotFound exception. All working now.
Thank you.
Donald