FAQ Database Discussion Community

my checkbox pass value even unchecked - Grails

I have lots of checkbox element on my Grails form, one is this: <g:checkBox id="consolidate" name="consolidate" value="${true}" checked="${false}" /> Then on the receiving controller, I verify the value of the checkbox using this code: println params?.consolidate And it displays: on Regardless whether I've tick my checkbox or not. In other...

Creating a back link using Grails

I need to do "back" link in gsp page. How to realize it without using controllers and actions? For example via history-stack.

Calling custom tagLib inside another custom tagLib dynamically

I have made two custom tagLibs, namely tabContainer and tab. def tabContainer = { attrs, body -> println("body: "+body()) out << '<div class="tab-content">' << body() << '</div>' } and def tab = { attrs, body -> out << '<div class="tab-pane '+${attrs.active == "true" ? "active" : ""}+'" id="'+attrs.id+'">' << body()...

Execute controller function in Grails via Ajax

I am a novice with ajax in Grails. I want to try to execute a controller method from gsp-code from ajax. This is part of my gsp-code: <g:select optionKey="id" name="region.id" id="region" from="${region}" noSelection="[null:' ']" onchange="categoryChanged(this.value);" ></g:select> <div> <b>Sub-Category: </b> <span id="subContainer"></span> </div> <script> function categoryChanged(regionId) { $.ajax({type:'POST',data:'regionId='+regionId,...

showing null point exception when findAllBy - for session object

I have already checked that session.parent_id and session.id_of_project is not null in the below code in gsp <g:if test="$session.parent_id"> <g:set var="permission" value="${Project_permission.findAllById_of_projectAndParent_id(session.id_of_project, session.parent_id)}"/> <g:each var="emp" in="${permission}"> <g:set var="employee2" value="${Employee.findById(emp.id_of_employee)}"/> <li class="parent_li"> <span class="badge red" title="Collapse this branch"> <i class="fa fa-minus-sign">...

GSP in plain Spring MVC - AST Transformation is not applied to taglib

I am trying to run GSP views in simple Spring MVC application (without Spring Boot). I am trying to duplicate the example located here: https://github.com/grails/grails-boot/tree/master/sample-apps/gsp but I am trying to run it in plain Spring MVC environment. I have successfully reached the phase when GSP pages are rendered, some g:...

GSP Template fails to retrieve passed template from another template

I'm working on a Grails 2.4.4 project. I have the following code on my gsp page (not a template) that calls a sub template that calls another template: main gsp page > gsp template > yet another gsp template: main.gsp ... <g:render template="/details" model="[param_one:'param_one', param_two:'param_two']" /> ... _details.gsp ... <p>On...

g:set tag inside template body in grails

I using <g:set> tag inside g:render template body <g:render template="/template/panelContainer"> <g:set var="tomorrow" value="${new Date() + 1}"/> ${tomorrow} </g:render> _panelContainer.gsp: <div class="panel panel-default"> ${raw(body())} </div> However tomorrow variable is not set. How do I need to implement template to properly execute g:set tag? ...

MissingMethodException in retrieving passed data through model attribute when rendering template gsp

I just recently started a Grails project in Netbeans. At some point, I need to pass parameters when rendering templates. I've searched here in stackoverflow on how to do that and the result is this code: <g:render template="/omm/placeOrders/buySellOrders/details/accountDetails" model="[show_sub_fieldset:'false']" /> And on that _accountDetails.gsp file, to fetch that passed value...

How to display value of map which is also a map in or