Hi Marius, Thanks for your response. I'm sorry for mis-communicating my problem earlier. As you pointed out the problem doesn't occur when the call to the function is made from a CometActor. In my case too, it was not a CometActor. Rather, it was the LiftActor. (Sometime back we had different CometActors for different feature threads, now we have 1 single CometActor which takes care of the display and different LiftActor threads which do the feature related stuff. Hence the confusion on my part).
Anyways, here's the relevant code: ------------------------------------- object TheVideoPlayerThread extends LiftActor { val threadName = "FileManager" def listFilesInDir(dirName:String): NodeSeq = { Log.info("Recursing for: " + dirName) val files = (new java.io.File(dirName)).listFiles def showFile1() = "AAA" <li class="fileElem" id="dir">{dirName}</li> <ul> {files.flatMap(f => { if (f.isDirectory()) { Log.info("Directory: " + f.toString) listFilesInDir(f.toString) } else { Log.info("Regular file: " + f.getName) <li class="fileElem" id="regfile"> {SHtml.link("", () => showFile1, Text(f.getName)) } //This is the line causing the issue </li> } } )} </ul> } protected def messageHandler = { case FileManagerMsg(someMsg) => { var fileList = listFilesInDir("/Users/soumik/Movies/") Log.info("OUTPUT: " + fileList) } } ------------------------------------- (I've omitted some of code in this thread which are not related to the file listing functionality.) The problem I see is as soon as I encounter the first file in the directory specified, it prints - "Regular file: <filename>", but after that I don't see the log - "OUTPUT - ...". The function never returns. Same function works perfectly in a CometActor and I see the nodeseq of files in <li> tags to be rendered. Also in the same method in my LiftActor object, if I replace the line: {SHtml.link("", () => showFile1, Text(f.getName)) } with just {f.getName} I see the function return and print the log "OUTPUT - .." with the list of all the files as <li> entries. I'm sorry I couldn't give a more concrete example which you could run and reproduce the issue. I'll appreciate if you could just give this function a try from any LiftActor object and check the output on console. Also, I'm still on 1.1-SNAPSHOT. I've a fairly big codebase, so not sure if migrating to 2.0-SNAPSHOT will cause any other issues, particularly with jquery(i'm using lot of jquery plugins dependent on 1.3.2, not sure if all of them works nicely with 1.4). Thanks, Soumik On Feb 15, 11:22 pm, Marius <marius.dan...@gmail.com> wrote: > I don't think the cause is in SHtml. I tried your code from a snippet > and from a Comet actor and there was no lock whatsoever. But I did use > lift 2.0-SNAPSHOT. can you try with 2.0-SNAPSHOT ? > > Br's, > Marius > > On 15 feb., 15:20, soumik <soum...@gmail.com> wrote: > > > Hi, > > I'm using 1.1-SNAPSHOT lift release and am experiencing strange > > behaviour when trying to output a NodeSeq formed from nested NodeSeq & > > Scala code. > > > To highlight the problem let me show you the code I'm trying to > > execute: > > ----------------------------------- > > def listFilesInDir(dirName:String): NodeSeq = > > { > > Log.info("Recursing for: " + dirName) > > val files = (new java.io.File(dirName)).listFiles > > > def playFile1() = "AAA" > > > <li class="fileElem" id="dir">{dirName}</li> > > <ul> > > {files.flatMap(f => { > > if (f.isDirectory()) > > { > > Log.info("Directory: " + f.toString) > > listFilesInDir(f.toString) > > <span></span> > > } > > else > > { > > Log.info("Regular file: " + f.getName) > > <li class="fileElem" id="regfile"> > > {SHtml.link("", () => playFile1, > > Text("Something")) } /* Problem in this line */ > > </li> > > } > > } > > )} > > </ul> > > ----------------------------------- > > I'm trying to render the output of the above function in a comet > > actor. The problem i see is with the highlighted line of code. When > > the execution reaches this line of code, it gets stuck; the function > > doesn't return and i don't get a NodeSeq to render. > > However, for some reason if I change the highlighted line of code to > > say: > > {f.getName} > > I get the proper NodeSeq which lists all the files in the directory. > > > Seems to me that the SHtml class functions are encountering an error > > scenario(frm which its unable to recover). I've tried a couple of > > SHtml functions(a, text, link, submit etc.) all of them show the same > > problem, but if I use some other scala code it executes properly. > > > Could anyone look into this and verify whether this is indeed a bug > > with the SHtml functions? > > > Thanks, > > Soumik -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to lift...@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.