Illustrating a Cool Glass of Beer - PSDTUTS
Illustrating a Cool Glass of Beer - PSDTUTS: "Illustrating a Cool Glass of Beer"
SiTo's news about Technology
Illustrating a Cool Glass of Beer - PSDTUTS: "Illustrating a Cool Glass of Beer"
Publicado por
SiTo
en
8/24/2008 07:55:00 p. m.
0
comentarios
200+ Photoshop Brushes for Light, Sparkles, Glows and Glitter | Vandelay Website Design: "200+ Photoshop Brushes for Light, Sparkles, Glows and Glitter"
Publicado por
SiTo
en
8/24/2008 07:55:00 p. m.
0
comentarios
30+ Nicest Photoshop Photo Effects, Part II: "
30+ Nicest Photoshop Photo Effects, Part II "
Publicado por
SiTo
en
8/24/2008 07:54:00 p. m.
0
comentarios
Webmaster Libre | Mis 10 aplicaciones de desarrollo web hechas en AIR favoritas: "Mis 10 aplicaciones de desarrollo web hechas en AIR favoritas"
Publicado por
SiTo
en
8/24/2008 07:52:00 p. m.
0
comentarios
Publicado por
SiTo
en
8/24/2008 07:32:00 p. m.
0
comentarios
12 frameworks CSS que deberías conocer | aNieto2K: "12 frameworks CSS que deberías conocer"
Publicado por
SiTo
en
8/07/2008 02:39:00 p. m.
0
comentarios
Lotus Domino and Apache Tomcat - Single Sign On (SSO): "Lotus Domino and Apache Tomcat - Single Sign On (SSO)
Last updated on 2007-12-10"
Publicado por
SiTo
en
8/07/2008 11:30:00 a. m.
0
comentarios
Check All Checkboxes Using MooTools Example: "Check All Checkboxes Using MooTools Example"
Publicado por
SiTo
en
8/06/2008 08:43:00 a. m.
0
comentarios
Animated Progress Bars Using MooTools: dwProgressBar: "Animated Progress Bars Using MooTools: dwProgressBar"
Publicado por
SiTo
en
8/06/2008 08:41:00 a. m.
0
comentarios
Photoshop Tutorials you should see… at Paintbits - Life in Colors: "Photoshop Tutorials you should see…"
Publicado por
SiTo
en
8/05/2008 03:18:00 p. m.
0
comentarios
Fun with XMPP and Google Talk, Part 2 - Adarsh R: "Fun with XMPP and Google Talk, Part 2"
Publicado por
SiTo
en
8/01/2008 10:24:00 a. m.
0
comentarios
Messagerie instantanée avec Google Talk et Grails | odelia technologies: "Messagerie instantanée avec Google Talk et Grails"
Publicado por
SiTo
en
7/31/2008 05:03:00 p. m.
0
comentarios
Shorter Grails textField
Making textFields in Grails is a bit verbose, at least if you want error highlighting and returned values on errors. This post shows a quick solution.
Problem
A full textField would be:
view plaincopy to clipboardprint?
1.
Which clearly is very verbose; you have to specify “user” twice, and “name” even three times. This verbosity also makes the view less readable.
Googling for this problem resulted in: Smarter Grails Tags (a proposal). Funny that the writer exactly sees the same problem in it, also uses the “user” domain model, and also knows Stripes where you could just use something like
view plaincopy to clipboardprint?
1.
and specify the bean name in the form. (Stripes has a very good Quick Start Guide, which also shows error highlighting.)
One of the less verbose proposed formats of textField is:
view plaincopy to clipboardprint?
1.
Implemented Solution
I found that implementing a quick version of this is surprisingly easy in Grails, it only takes for a few statements. Here is the code:
view plaincopy to clipboardprint?
1.
import org.codehaus.groovy.grails.plugins.web.taglib.FormTagLib
2.
3.
// file: project/grails-app/taglib/MyTagLib.groovy
4.
class MyTagLib {
5.
// tagname "myTextField" within the "g" namespace
6.
def myTextField = {attrs ->
7.
// If a controller returned the bean, and the field has an error,
8.
// then "errors" will be returned as HTML class, otherwise the class will be empty.
9.
attrs.class = hasErrors(bean:attrs.bean, field:attrs.field, 'errors')
10.
// Retrieves the field value of the given bean to be rendered in the view.
11.
// Note: specify the bean and not the bean name. So "${user}" instead of "user"
12.
attrs.value = fieldValue(bean:attrs.bean, field:attrs.field)
13.
// Required for textField taglib. attrs.name is a keyname of the params map
14.
attrs.name = attrs.field
15.
// renders the HTML tag
16.
out << new FormTagLib().textField(attrs)
17.
}
18.
}
import org.codehaus.groovy.grails.plugins.web.taglib.FormTagLib
// file: project/grails-app/taglib/MyTagLib.groovy
class MyTagLib {
// tagname "myTextField" within the "g" namespace
def myTextField = {attrs ->
// If a controller returned the bean, and the field has an error,
// then "errors" will be returned as HTML class, otherwise the class will be empty.
attrs.class = hasErrors(bean:attrs.bean, field:attrs.field, 'errors')
// Retrieves the field value of the given bean to be rendered in the view.
// Note: specify the bean and not the bean name. So "${user}" instead of "user"
attrs.value = fieldValue(bean:attrs.bean, field:attrs.field)
// Required for textField taglib. attrs.name is a keyname of the params map
attrs.name = attrs.field
// renders the HTML tag
out << new FormTagLib().textField(attrs)
}
}
Usage
view plaincopy to clipboardprint?
1.
And ofcourse some CSS to highlight the error in a color. This can be put in the HTML head (or better, a seperate CSS file) :
view plaincopy to clipboardprint?
1.
Publicado por
SiTo
en
7/31/2008 04:51:00 p. m.
0
comentarios
jan blog: Experience with Act as Taggable Plugin: "Experience with Act as Taggable Plugin"
Publicado por
SiTo
en
7/24/2008 12:38:00 p. m.
0
comentarios
Screensavers - Best Of | Graphics | Smashing Magazine: "Screensavers - Best Of"
Publicado por
SiTo
en
7/23/2008 02:19:00 p. m.
0
comentarios
It provides Windows NT4.0/2000/XP/2003/Vista with full access to Linux Ext2 volumes (read access and write access). This may be useful if you have installed both Windows and Linux as a dual boot environment on your computer.
The 'Ext2 Installable File System for Windows' software is freeware.
Publicado por
SiTo
en
7/23/2008 02:17:00 p. m.
0
comentarios
PosteRazor - Make your own poster!: "PosteRazor"
Publicado por
SiTo
en
7/23/2008 01:53:00 p. m.
0
comentarios
Use your laptop as an Xbox/Xbox 360 "Wireless Adapter" on Windows XP/Vista, and Mac OSX - Instructables - DIY, How To, tech: "Use your laptop as an Xbox/Xbox 360 'Wireless Adapter' on Windows XP/Vista, and Mac OSX"
Publicado por
SiTo
en
7/23/2008 01:53:00 p. m.
0
comentarios
rain city digest: Groovy DateTime Comparisons
Groovy Temporal Support Classes
Groovy Temporal Support Continued
Converting MS Active Directory time in human readable format with Groovy
TagLibs en Grails
IBM
developerWorks Technical library view (mastering grails)
Publicado por
SiTo
en
7/16/2008 03:32:00 p. m.
0
comentarios
JAVA Excel Designner: "Java Excel Designer"
Publicado por
SiTo
en
7/16/2008 08:53:00 a. m.
0
comentarios
Jorge on Programming: grails: "Friday, July 4, 2008"
Publicado por
SiTo
en
7/15/2008 06:50:00 p. m.
0
comentarios
Top 10 CSS buttons tutorial list: "Top 10 CSS buttons tutorial list"
Publicado por
SiTo
en
7/14/2008 11:26:00 a. m.
0
comentarios
Animated Progress Bars Using MooTools: dwProgressBar: "Form completion tracking"
Publicado por
SiTo
en
7/09/2008 08:29:00 a. m.
0
comentarios
One pixel notched corners as used by Google Analytics (Ask the CSS Guy): "One pixel notched corners as used by Google Analytics"
Publicado por
SiTo
en
7/01/2008 05:53:00 p. m.
0
comentarios
woork: Clean and pure CSS FORM design: "Clean and pure CSS FORM design"
Publicado por
SiTo
en
7/01/2008 05:53:00 p. m.
0
comentarios
Decoding raw digital photos in Linux: "Decoding raw digital photos in Linux"
Publicado por
SiTo
en
7/01/2008 09:53:00 a. m.
0
comentarios
mootools.kassens.net: "mootools.kassens.net"
Publicado por
SiTo
en
6/30/2008 03:01:00 p. m.
0
comentarios
Live Search with Quicksilver Style // Ordered List // We Make The Web Beautifully Simple: "Live search? C’mon guys, this has been done plenty of times before, you say. Yes, it has but I promise you we’ve added a bit of a twist to it."
Publicado por
SiTo
en
6/27/2008 01:41:00 p. m.
0
comentarios
Jackbrabbit OCM and Spring at My thoughts: "Jackbrabbit OCM and Spring"
Publicado por
SiTo
en
6/25/2008 05:59:00 p. m.
0
comentarios
Publicado por
SiTo
en
6/19/2008 12:09:00 p. m.
0
comentarios
UrlRewriteFilter - Rewrite URL's in Java Web Application Servers: "
Url Rewrite Filter"
Publicado por
SiTo
en
6/04/2008 04:58:00 p. m.
0
comentarios
pdf-renderer: PDFRenderer Home Page: "PDF Renderer"
Publicado por
SiTo
en
5/30/2008 02:06:00 p. m.
0
comentarios
Securing Struts Applications: "Securing Struts Applications"
Publicado por
SiTo
en
5/19/2008 05:50:00 p. m.
0
comentarios
Getting Started with JCR (Content Repository for Java, JSR-170): "Getting Started with JCR (Content Repository for Java, JSR-170)
Page: 1"
Publicado por
SiTo
en
5/16/2008 02:06:00 p. m.
0
comentarios
MySQL Performance Blog: "MySQL Performance Blog"
Publicado por
SiTo
en
5/16/2008 09:03:00 a. m.
0
comentarios
Tech Facts at Your Fingertips | Refcardz: "FREE Cheatsheets for Developers"
Publicado por
SiTo
en
5/16/2008 08:33:00 a. m.
0
comentarios
woork: CSS Message Box collection: "CSS Message Box collection"
reducir-ficheros-javascript-con-php
Publicado por
SiTo
en
5/13/2008 02:36:00 p. m.
0
comentarios
Kynetia - Enterprise 2.0: "Enterprise 2.0"
Publicado por
SiTo
en
4/22/2008 06:47:00 p. m.
0
comentarios
http://www.baquia.com/noticias.php?id=13547: "Las empresas invertirán en la Web 2.0"
Publicado por
SiTo
en
4/22/2008 06:28:00 p. m.
0
comentarios
Stephan February: Grails Ajax File Upload ProgressBar: "ard, and should be self-explanatory based on the supplied source code (js/application.js and views/home/index.gsp respectively) (see Resources section).
Resources:
You can download the full project demonstrating the above from HERE.
References:
File Uploading section from the Grails User Guide.
Apache Commons File Upload website"
Publicado por
SiTo
en
4/15/2008 03:04:00 p. m.
0
comentarios
CodeGuru: AJAX File Upload Progress for Java: "AJAX File Upload Progress for Java"
Publicado por
SiTo
en
4/15/2008 11:46:00 a. m.
0
comentarios
Hibernate Events Plugin para Grails - groovy.org.es -: "Hibernate Events Plugin para Grails"
Publicado por
SiTo
en
4/11/2008 02:46:00 p. m.
0
comentarios
Grails WebAlbum: "Grails WebAlbum"
Publicado por
SiTo
en
4/10/2008 10:02:00 p. m.
0
comentarios
SCRUM: metodología “ágil” para tus proyectos PymeCrunch »: "SCRUM: metodología “ágil” para tus proyectos"
Publicado por
SiTo
en
4/09/2008 04:22:00 p. m.
0
comentarios
Cheese
Cheese is an program for the Gnome Desktop which allows you to take photos, videos, and anything else you can think of with your webcam.
Just start it up and shoot! Gather all of your friends around, have some fun! Share your taken photos and videos with 'em!
Publicado por
SiTo
en
4/02/2008 04:45:00 p. m.
0
comentarios
Spring 2.0 with Hibernate at darcia.org - Think Creative: "Spring 2.0 with Hibernate"
Publicado por
SiTo
en
3/31/2008 05:42:00 p. m.
0
comentarios
Clustering Quartz Jobs in Spring | REVERT TO CONSOLE * coupling afferently since 2006: "Clustering Quartz Jobs in Spring"
Publicado por
SiTo
en
3/31/2008 11:13:00 a. m.
0
comentarios
Top 50: blogs de diseño en español « el50: "Top 50: blogs de diseño en español"
Publicado por
SiTo
en
3/28/2008 02:10:00 p. m.
1 comentarios
(Really) Stunning Desktop Wallpapers | Graphics | Smashing Magazine: "(Really) Stunning Desktop Wallpapers"
Publicado por
SiTo
en
3/28/2008 02:10:00 p. m.
0
comentarios
80 Beautiful Typefaces For Professional Design | Fonts | Smashing Magazine: "80 Beautiful Typefaces For Professional Design"
Publicado por
SiTo
en
3/28/2008 02:07:00 p. m.
0
comentarios
Grid-Based Design: Six Creative Column Techniques | How-To | Smashing Magazine: "Grid-Based Design: Six Creative Column Techniques"
Publicado por
SiTo
en
3/28/2008 02:06:00 p. m.
0
comentarios
Salmon Run: Charting JVM Garbage Collection: "actualTime = baseTS - gcStartTS + tsoffset"
Publicado por
SiTo
en
3/26/2008 06:08:00 p. m.
0
comentarios
jabber client with ext - Ext JS Forums: "jabber client with ext"
Publicado por
SiTo
en
3/25/2008 09:40:00 a. m.
0
comentarios
Blog O’ Matty » Blog Archive » Monitoring Java garbage collection with jstat: "Monitoring Java garbage collection with jstat"
Publicado por
SiTo
en
3/24/2008 03:33:00 p. m.
0
comentarios
ONJava.com -- Scheduling Jobs in a Java Web Application: "Scheduling Jobs in a Java Web Application"
Publicado por
SiTo
en
3/19/2008 01:46:00 p. m.
0
comentarios
performancewiki.com - ibm websphere tuning tips: "WebSphere Tuning Tips"
Publicado por
SiTo
en
3/19/2008 01:43:00 p. m.
0
comentarios
Agile Ajax: Asynchronous Processing: "Asynchronous Update in Echo2"
Publicado por
SiTo
en
3/19/2008 01:41:00 p. m.
0
comentarios
Resin : Tutorials : PeriodicTask Tutorial: "periodictask tutorial
injection
ioc appconfig
This tutorial demonstrates the creation of a PeriodicTask that performs a task at intervals and collects statistics on it's performance. An administration interface to the task is provided, and while the task is active the user is shown a 'temporarily unavailable' page.
The code for this tutorial provides a full featured example that can be used as a cut-and-paste source for solving real problems. The PeriodicTask keeps detailed statistics, an administration interface is provided with a servlet, and the task can be executed either manually or automatically at timed intervals."
Publicado por
SiTo
en
3/19/2008 01:39:00 p. m.
0
comentarios
Java Ramblings: Parallel Processing in Java EE 5: "Parallel Processing in Java EE 5"
Publicado por
SiTo
en
3/19/2008 10:38:00 a. m.
0
comentarios
So Limited: Apache Jackrabbit 101: "Apache Jackrabbit 101"
Publicado por
SiTo
en
3/16/2008 08:08:00 p. m.
0
comentarios
Rob Cherny.Com: JavaScript Event Delegation and Event Handlers: Web Development and other stuff: "JavaScript Event Delegation and Event Handlers"
http://icant.co.uk/sandbox/eventdelegation
Event delegation Element Extension Mootools based
Element.implement({
delegate: function(eventType,rules,prevent){
return this.addEvent(eventType, function(event) {
var target = $(event.target);
var prevent = prevent || true;
for (var selector in rules) {
if (target.match(selector)) {
if (prevent) { event.preventDefault(); }
return rules[selector].apply(this, $A(arguments));
}
}
});
}
});
Publicado por
SiTo
en
3/16/2008 07:14:00 p. m.
0
comentarios
ONJava.com -- Session Replication in Tomcat 5 Clusters, Part 1: "Session Replication in Tomcat 5 Clusters, Part 1"
Publicado por
SiTo
en
3/13/2008 05:58:00 p. m.
0
comentarios
Spring Tips: Prototypes, Lookup Methods and Java Config With Spring...: "Prototypes, Lookup Methods and Java Config With Spring..."
Publicado por
SiTo
en
3/12/2008 09:44:00 a. m.
0
comentarios
Blog de Iván López: Usando el API de Google Calendar: Alarmas por SMS: "Usando el API de Google Calendar: Alarmas por SMS"
Publicado por
SiTo
en
3/09/2008 04:48:00 p. m.
0
comentarios
InfoQ: Securing a Grails Application with Acegi Security: "Securing a Grails Application with Acegi Security"
Publicado por
SiTo
en
3/04/2008 12:43:00 p. m.
0
comentarios
InfoQ: Securing a Grails Application with Acegi Security: "Securing a Grails Application with Acegi Security"
Publicado por
SiTo
en
3/02/2008 05:50:00 p. m.
0
comentarios