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>
Comments
Post a Comment