On Aug 31, 5:39 pm, David Pollak <feeder.of.the.be...@gmail.com> wrote: > On Mon, Aug 31, 2009 at 2:32 PM, Michel Klijn <michel.kl...@gmail.com>wrote: ... > > Since i had > > JBOSS 4.2.3AG already on my system i tried this, but without succes... > > What's the failure? Does the Lift examples/example app run okay on JBoss? > What happens in Firebug?
The table won't update because JQuery is not loaded My javascript console tells me: >jQuery is not defined >http://localhost:8080/MyGame-1.0-SNAPSHOT/ajax_request/ liftAjax.js >Line 157 and FireBugs net log: > a 304 Not Modified for get jquery.js all works fine in Jetty ... > > 3. The three case classes: NewGame(g: Game),RemoveGame(g: > > Game),UpdateGame(g: Game) all extend GameMsg. In the partial function > > highPriority i have tried to match: NewGame(g), RemoveGame(g) and > > UpdateGame(g) that doesn't seem to work, but why? > > Because you're not matching UpdateGame(g), you're matching (g: Game, > NewGame()) => ... > Yes, because that seemed to work ;). What I meant is: that i was trying it this way before: case NewGame(g) => partialUpdate etc.. case RemoveGame(g) => partialUpdate etc.. case UpdateGame(g) => partialUpdate etc.. In the Game Object the createUpdate method returns one of these three GameMsg types > > > Cheers, > > > Michel > > > class GameList extends CometActor with CometListenee{ > > override def defaultPrefix = Full("entry") > > override def parentTag = <tbody></tbody> > > override def devMode = false > > override def hasOuter = false > > > protected def registerWith = Game > > override def render = new RenderOut( (Game.getGames.flatMap > > (bindGameRow(_))).toSeq ) > > > override def highPriority: PartialFunction[Any,Unit] = { > > case (g:Game, NewGame()) => partialUpdate(PrependHtml > > (this.uniqueId,bindGameRow(g))) > > case (g:Game, RemoveGame()) => partialUpdate(RemoveById > > (""+g.gid)) > > case (g:Game, UpdateGame()) => > > partialUpdate(ReplaceWithById > > (""+g.gid, bindGameRow(g))) > > } > > > private def bindGameRow(g:Game) = > > <tr id={""+g.gid}> > > {bind("id" -> g.gid, > > "name" -> SHtml.link("/game", () => > > CurrentGame(Full(g)), > > Text(g.gname)), > > "players" -> g.playerStatus, > > "owner" -> g.creator, > > "timestamp" -> <b>{g.createdOn.toString}</b>, > > "joinlink" -> SHtml.ajaxButton("Delete game!", > > > {() => Game ! Game.DeleteGame(g);Noop})) > > } > > </tr> > > > } > > > //some javascript stuff > > object RemoveById { > > def apply(uid: String) = new RemoveById(uid) > > } > > > class RemoveById(val uid: String) extends JsCmd { > > def toJsCmd = "try{jQuery("+ ("#"+uid).encJs + ").remove();} catch > > (e) {}" > > } > > > object ReplaceWithById { > > def apply(uid: String, nsq: NodeSeq) = new ReplaceWithById(uid, > > nsq.toString) > > } > > > class ReplaceWithById(val uid: String, val content:String) extends > > JsCmd { > > def toJsCmd = "try{jQuery("+("#"+uid).encJs+").replaceWith($('"+ > > content.encJs +"'));} catch (e) {}" > > } > > -- > Lift, the simply functional web frameworkhttp://liftweb.net > Beginning Scalahttp://www.apress.com/book/view/1430219890 > Follow me:http://twitter.com/dpp > Git some:http://github.com/dpp --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---