Hi Rahul,
I'm not sure that the setBean() method automatically populates lists, so
you'll need to do that manually. Keep in mind that classes can have
properties with the same names, so using the setBean() method which
accepts a prefix is a good idea.
-[Bean outlines]--------------------------------
public class Hotel {
public String getName() ...
public void setName(String name) ...
public List<Room> getRooms() ...
public void setRooms(List<Room> rooms) ...
}
public class Room {
public int getNumber() ...
public void setNumber(int number) ...
}
-[Sample template]-----------------------------
<r:v name="hotels"/>
<r:b name="hotel">
Hotel Name: <r:v name="HOTEL:name" /><br />
<r:v name="rooms" />
</r:b>
<r:b name="room">
Room Number: <r:v name="ROOM:number" /><br />
</r:b>
-[Sample element snippet]----------------------
...
for( Hotel hotel : hotels ) {
template.setBean(hotel, "HOTEL:");
template.blankValue("rooms");
for( Room room : hotel.getRooms() ) {
template.setBean(room, "ROOM:");
template.appendBlock("rooms", "room");
}
template.appendBlock("hotels", "hotel");
}
...
-----------------------
Josh
--
Joshua Hansen
Up Bear Enterprises
(541) 760-7685