Note that there are some explanatory texts on larger screens.

plurals
  1. POPlay framework - illegal start of simple expression
    text
    copied!<p>I am trying to implement a filter functionality that will display businesses by their type. This is the "search form" where the user can select what type of business they want to display </p> <pre><code>@(businessList: List[Business], formSearch: Form[Business]) @import helper._ @main("All businesses"){ @form(action=routes.Application.displayAllBusinesses("")){ @select(formSearch("type"),options(Seq("Dining","Accomodation","Manufacturing","Retail", "Services")),'_label -&gt;"Business Type",'_default-&gt;"--Select a business type--") &lt;input type="submit" class="btn btn-success" value="Search by type"&gt; &lt;a class="btn" href="@routes.Application.displayAllBusinesses()"&gt;Show all businesses&lt;/a&gt; &lt;a class="btn" href="/registerBusiness"&gt;Register a business&lt;/a&gt; } </code></pre> <p>Then I have a for loop to display all the businesses:</p> <pre><code>&lt;ul&gt; @for(business &lt;- businessList) { &lt;li&gt; &lt;p&gt;Business Name: @business.getName()&lt;/p&gt; &lt;p&gt;Business Type: @business.getType()&lt;/p&gt; &lt;p&gt;Business Email: @business.getEmail()&lt;/p&gt; &lt;p&gt;Business Location: @business.getLocation()&lt;/p&gt; &lt;p&gt;Business Description: @business.getDescription()&lt;/p&gt; &lt;p&gt;Id is: @business.id &lt;/p&gt; &lt;a class="btn" href="@routes.Application.displayUpdateBusiness(business.id)"&gt;Update&lt;/a&gt; @form(routes.Application.deleteBusiness(business.id)) { &lt;input class="btn" type="submit" value="Delete"&gt; } &lt;/li&gt; } &lt;/ul&gt; </code></pre> <p>When the user submits their form the displayAllbusinesses route looks like (This is where the error comes up):</p> <pre><code>GET /listBusinesses controllers.Application.displayAllBusinesses(type: String ?= "all") </code></pre> <p>The displayAllbusinesses method in app/Application.java is:</p> <pre><code>public static Result displayAllBusinesses(String type){ List&lt;Business&gt; businesses; if(type=="all"){ businesses = allBusinesses; } else { businesses = Business.find.where().like("type", type).findList(); //TRACE System.out.println(businesses); } return ok(listBusinesses.render(businesses, businessForm)); } </code></pre> <p>When I run this code I get a "illegal start of simple expression" for the /listBusinesses route. What does this mean?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload