Hi,

On Mon, Apr 13, 2009 at 1:03 PM, sailormoo...@gmail.com
<sailormoo...@gmail.com> wrote:

> <table>
>  <% for (int i = 0; i < data.size(); i++) { %>
>    <tr><td><%= data.name %></td></tr>
>  <% } %>
> </table>
>
>  I cannot find an example like this, and I don't know if it should be
> done by a single snippet with all the rows, or some list/array to
> iterate in the view.

How about the followings?

$ scala
Welcome to Scala version 2.7.3.final (Java HotSpot(TM) Client VM, Java
1.6.0_06).
Type in expressions to have them evaluated.
Type :help for more information.

scala> List(1,2,3)
res0: List[Int] = List(1, 2, 3)

scala> <table>{for(d<-res0) yield <tr><td>{d}</td></tr>}</table>
res1: scala.xml.Elem =
<table><tr><td>1</td></tr><tr><td>2</td></tr><tr><td>3</td></tr></table>

or

scala> <table>{res0.flatMap{case d => <tr><td>{d}</td></tr>}}</table>
res2: scala.xml.Elem =
<table><tr><td>1</td></tr><tr><td>2</td></tr><tr><td>3</td></tr></table>


Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
    +1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to