grails - Accessing model variable from gsp -


i have table employee in db columns emp id, emp name , emp address , emp phone number(this field can more 1 , unique id) , according no. of phone number's provided , no. of row's emp id can increase well. table below:

emp id  emp name    emp address     emp phone 10001   jack        abc             70102938 10001   jack        abc             39876538 10002   jim         xyz             23492020 

i have gsp in display particular panel if emp phone present or else should hidden completely,

<div class="subbody  ${somebean?.acondition ? 'shownitem':'hiddenitem'}"> 

with css

.shownitem{         display: block;     }     .hiddenitem{         display: none;     } 

what not getting how write condition in gsp ${somebean?.acondition ?

you use <g:if> instead:

<g:if test="${somebean?.acondition}">      whatever want display </g:if> 

http://grails.github.io/grails-doc/3.0.x/ref/tags/if.html


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -