domingo, agosto 24, 2008

Illustrating a Cool Glass of Beer - PSDTUTS

Illustrating a Cool Glass of Beer - PSDTUTS: "Illustrating a Cool Glass of Beer"

200+ Photoshop Brushes for Light, Sparkles, Glows and Glitter | Vandelay Website Design

200+ Photoshop Brushes for Light, Sparkles, Glows and Glitter | Vandelay Website Design: "200+ Photoshop Brushes for Light, Sparkles, Glows and Glitter"

30+ Nicest Photoshop Photo Effects, Part II

30+ Nicest Photoshop Photo Effects, Part II: "
30+ Nicest Photoshop Photo Effects, Part II "

ubuntu snippets

ubuntu snippets

AIRpollo.com - share Adobe AIR Applications

AIRpollo.com - share Adobe AIR Applications

Webmaster Libre | Mis 10 aplicaciones de desarrollo web hechas en AIR favoritas

Webmaster Libre | Mis 10 aplicaciones de desarrollo web hechas en AIR favoritas: "Mis 10 aplicaciones de desarrollo web hechas en AIR favoritas"

Doomi. A to do list application.

Doomi. A to do list application.

colorbrowser - Google Code

colorbrowser - Google Code: "colorbrowser"

colorbrowser - Google Code

colorbrowser - Google Code: "colorbrowser"

Woork: 10 Handwritten fonts you can't miss

Woork: 10 Handwritten fonts you can't miss

PatternCooler | Seamless Background Designs for Blogs, Mobile Phone Wallpapers, MySpace, Webdesign Projects

PatternCooler | Seamless Background Designs for Blogs, Mobile Phone Wallpapers, MySpace, Webdesign Projects

iPhone GUI PSD

iPhone GUI PSD

DivIt // Un grid-system que divide el trabajo

DivIt // Un grid-system que divide el trabajo: "DivIt"

pChart | a PHP Charting library

pChart | a PHP Charting library

jueves, agosto 07, 2008

lunes, agosto 04, 2008

jueves, julio 31, 2008

Gravl: Google Talk Notifier - Glen Smith

Gravl: Google Talk Notifier - Glen Smith: "Incoming comment notification via Google Talk"

Messagerie instantanée avec Google Talk et Grails | odelia technologies

Messagerie instantanée avec Google Talk et Grails | odelia technologies: "Messagerie instantanée avec Google Talk et Grails"

JT Dev » Blog Archive » Shorter Grails textField

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.

Oficina de Atención al Usuario de Telecomunicaciones - redondeo_portabilidad

Oficina de Atención al Usuario de Telecomunicaciones - redondeo_portabilidad

miércoles, julio 23, 2008

Screensavers - Best Of | Graphics | Smashing Magazine

Screensavers - Best Of | Graphics | Smashing Magazine: "Screensavers - Best Of"

Ext2 IFS For Windows

Ext2 IFS For Windows: "

What's unique about this software?



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.

"

PosteRazor - Make your own poster!

PosteRazor - Make your own poster!: "PosteRazor"

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 - Instructables - DIY, How To, tech: "Use your laptop as an Xbox/Xbox 360 'Wireless Adapter' on Windows XP/Vista, and Mac OSX"

martes, julio 15, 2008

lunes, julio 14, 2008

lunes, junio 30, 2008

viernes, junio 27, 2008

Live Search with Quicksilver Style // Ordered List // We Make The Web Beautifully Simple

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."

lunes, mayo 19, 2008

martes, abril 15, 2008

Stephan February: Grails Ajax File Upload ProgressBar

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"

CodeGuru: AJAX File Upload Progress for Java

CodeGuru: AJAX File Upload Progress for Java: "AJAX File Upload Progress for Java"

Speckyboy - Wordpress and Design

Speckyboy - Wordpress and Design

jueves, abril 10, 2008

miércoles, abril 02, 2008

Cheese

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!

martes, abril 01, 2008

miércoles, marzo 19, 2008

ONJava.com -- Scheduling Jobs in a Java Web Application

ONJava.com -- Scheduling Jobs in a Java Web Application: "Scheduling Jobs in a Java Web Application"

performancewiki.com - ibm websphere tuning tips

performancewiki.com - ibm websphere tuning tips: "WebSphere Tuning Tips"

Agile Ajax: Asynchronous Processing

Agile Ajax: Asynchronous Processing: "Asynchronous Update in Echo2"

Resin : Tutorials : PeriodicTask Tutorial

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."

Java Ramblings: Parallel Processing in Java EE 5

Java Ramblings: Parallel Processing in Java EE 5: "Parallel Processing in Java EE 5"

domingo, marzo 16, 2008

So Limited: Apache Jackrabbit 101

So Limited: Apache Jackrabbit 101: "Apache Jackrabbit 101"

Event Delegation and Event Handlers: Web Development and other stuff

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));
}
}
});
}
});

viernes, marzo 14, 2008