I’m trying to follow this tutorial. I’ve got a non empty db. But the table does not get propagated. I tried debugging it: correct records are returned by the toShow method, on each iteration of the flatMap it has a correct, non-empty instance of the item, but the result, this method returns is this: List(\n{16 spaces here},\n{16 spaces here}). And the table does not get propagated.
My updated code is as follows:
ListCar snippet:
class ListCar {
def list(xhtml: NodeSeq) : NodeSeq = {
toShow.flatMap(car =>
bind("car", xhtml,
"name" -> car.name.is,
"owner" -> car.owner.name
)
)
}
private def toShow = {
Car.findAll();
}
}
list.xhtml:
<table>
<thead>
<tr>
<th>Name</th>
<th>Owner</th>
</tr>
</thead>
<tbody>
<lift:list_car.list>
<tr>
<td>
<car:name/>
</td>
<td>
<car:owner/>
</td>
</tr>
</lift:list_car.list>
</tbody>
</table>
What could be the problem here?
I resolved this one by editing the html file:
instead of wrapping
<tr>in<lift:list_car.list>, I changed it to<tr class="lift:listCar.list">, and it worked.