I didn't know this earlier, but found a very good feature of GORM - 'bypass' constraints or 'customize' validation while saving a domain-object. I am not sure if there's any name for this feature. But I am naming it as 'bypass constraints'. [groovy] if(domainObject.validate(['field1', 'field2'])){ domainObject.save(validate:false,...
It's common requirement when we work on some portal - we need to provide support for various languages. messages.properties/ResourceBundle is out of the scope of this post. Here I am just mentioning - how to switch to a different language taking an advantage of GRAILS On your view (gsp) page add following - English French ...
This is more towards the best practices and my experiences for developing an application at a faster rate. In my current project, we are using many different APIs (for external services). And usually it takes time to explore, implement and then stabilize the application. Also, it's not over once you stabilize your APIs based code....
This post might help you if you want to display alert messages without using tradition javascript (irritating) alert. To achieve this you need jQuery for your frontend UI. Below is the javascript method (code snapshot) which displays your message for 5 seconds. And then fades out automatically. function displayAlertMessage(message)...
This post might help you if you want to get JSON (JavaScript Object Notation) Object on browser. Grails framework provides you very efficient way to achieve this. For this you need to import grails JSON convertor in your code. import grails.converters.JSON Below is the code snapshot which converts java based lists of Objects to...