This is little bit but it is very useful. This is input type equalto text when when cursor come in input then change type equalto password. Embed in html [java] <input type="text" onblur="javascript:if(this.value==”){this.value=’password’,this.type=’text’} else {this.type=’password’}" onfocus="javascript:if(this.value==’password’){this.value=”} {this.type=’password’}" value="password" tabindex="1" size="30" id="txtEmail" name="txtEmail"> [/java] This is Demo Support browser IE Firefox Safari Chrome Opera 6.0+ 3.5+ […]
Some times in our applications, while saving a domain object we may desire to have a save or update behavior on the basis of certain fieldSupp Suppose we have a domain class Personwith following definition: [java]class Person{ String name String source String description def static saveOrUpdateBy = [‘name’, ‘source’] } [/java] Details of a person […]
Hi, In my recent grails project, i needed to return back to the application after processing payment at the paypal website. I searched a lot about it. Then i found the solution to do so and thought it worth sharing. Here are the steps i followed:- 1. The Paypal button:- This is the code for […]
All communication between Hibernate and the database runs within the context of a database transaction but the Session itself is lazy in that it only ever initiates a database transaction at the last possible moment.Given that there is a transaction, you would think that if something went wrong, any problems would be rolled back. However, […]
Hi Friends, I have released the version 0.2.5 of Remote-Pagination, which now provides the support for all the events as supported by grails tags like remote-link. Events supported are listed below : onSuccess – The javascript function to call if successful onFailure – The javascript function to call if the call failed on_ERROR_CODE – The […]
Hi , this is a very simple but yet useful tag to provide links to important words in the content given in between the starting and end inLink tag. Taking an Example of contents :- “No One Killed Jessica is a 2011 Hindi film starring Vidya Balan and Rani Mukherjee , produced by UTV Spotboy and […]
Well my second month into work and I have started discovering things that are very trivial, but can save you a whole lot of time .. if you could get to know them better . One of those things was with jQuery. Now working with a normal submit form, a jQuery Validate Plugin works superbly. […]
Recently in my project I needed to sort an object list on the basis of object name. For the same purpose I created the following function [java] function sortList(objList) { objList.sort(sortByName); } function sortByName(a, b) { var x = a.name; var y = b.name; return ((x < y) ? -1 : ((x > y) ? […]
Hello world.. In a pretty recent project, I was a given a task to implement “read more” custom tag to implement “read more” functionality (a block of text followed by a read more link. Block of text expands and collapses on clicking of a link). I will be honest over here.I did a pretty bad […]
The CodeNarc plugin provides static code analysis using CodeNarc library. CodeNarc analyzes Groovy code for defects, bad practices, inconsistencies, style issues etc. CodeNarc provides a Groovy DSL for defining RuleSets. Install CodeNarc plugin into you grails project. Now create one groovy file say CustomRules.groovy and add following code into it. [java] ruleset { Println SystemOutPrint […]
This post is for people who are already familiar with Git and work on multiple branches (esp. feature branches). By practice, feature branches are the branches created from a root branch (master or any other as per your branching model) and once feature is complete/tested – they are merged back into the same root branch. […]
In one of my project we were reading the cookies so that we could do the processing accordingly. Now reading the cookie is easy but writing a unit test case for that action was little bit tricky for me because I wanted to test the behavior in case of when I find the cookie and […]