I am newbie to play framework. While trying to generate html template with play, I get the error illegal start of simple pattern at the line ticket.getTicketIds. Have been spending sometime trying to resolve the issue but of no good.
<tbody>
@for( ticket <- @obj.getPurchasedTickets() ) {
@for( (key,val) <- @obj.getTicketsCalculation() ) {
@if( key.equals(ticket.getTicketId())) {
<tr>
<td class="desc">@ticket.getTicketName()<br></br>
@if(ticket.getTicketIds() != null && !ticket.getTicketIds().isEmpty()) {
@for( ticketid <- ticket.getTicketIds ){
#@ticketid
}
}
</td>
<td class="unit">@ticket.getPrice()</td>
</tr>
}
}
}
</tbody>
The following POJOs are used to get the necessary values
public class PurchasedTicket {
private String ticketId; // represents the ticket's id
private String ticketName;
private Integer numberOfTickets;
private Double price;
private List<String> ticketIds; // list of tickets bought with this ticket
// setters and getters
}
public class Wrapper{
private Map ticketsCalculation;
private List<PurchasedTicket> purchasedTickets;
// setters and getters
}
The obj represented in the template part is an object of Wrapper class
ticket.getTicketIdsshows a couple of times. Which one? - Rumidticket.getTicketIdsis aList<String>, right? Did you check with debugger? Anyway, you are repeating this method, I think you can define new variable, so it will simplify code and maybe you will see what was wrong: playframework.com/documentation/2.0/… - RumidgetTicketIds(plural) andgetTicketId(singular), right? - Rumid