On Mon, Feb 15, 2010 at 5:20 AM, soumik <[email protected]> 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.
>

This is very strange.  All the SHtml stuff works just fine within
CometActors (if they didn't CometActors wouldn't work... and they do).

If you can create a reproducable example (preferably as a GitHub project),
please open a ticket https://liftweb.assembla.com/spaces/liftweb/tickets


> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected]<liftweb%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>


-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to