Reputation: 86
I'm working on a little project using Play 2.0 and scala and having a bit struggle in display logic. I would like to check if my passed parameter is empty in my view engine.
I tried:
@if(pmem.isEmpty()) {
there are no past members who won in this branch
} else {
<table>
etcc...
<table>
}
but it didn't work and gave me a
Boolean does not take parameters error
i also tried
@if(pmem == null) {
there are no past members who won in this branch
} else {
} else {
<table>
etcc...
<table>
}
and it didn't work, maybe I'm missing something? Or I could be doing it all wrong. I'm using Scala/Play 2.0 framework.
Upvotes: 1
Views: 3057
Reputation: 86
@if(pmem.isEmpty) {
there are no past members who won in this branch
} else {
<table>
etcc...
<table>
}
tried and gave me the answer :)
Upvotes: 3