Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD

## org.codehaus.groovy.grails.plugins.web.taglib
[Groovy] Class CountryTagLib

    java.lang.Object
      org.codehaus.groovy.grails.plugins.web.taglib.CountryTagLib

    @Artefact("TagLibrary")
    class CountryTagLib
    extends java.lang.Object

Tags for rendering country selection / display of country names.

todo:
  add ISO language codes too

Authors:
  Marc Palmer (marc@anyware.co.uk)

Property Summary
`static java.lang.Object` | `COUNTRY_CODES_BY_NAME`
`static java.lang.Object` | `COUNTRY_CODES_BY_NAME_ORDER`
`static java.lang.Object` | `ISO3166_3`
`groovy.lang.Closure` | `country` Take a country code and output the country name, from the internal data.
`groovy.lang.Closure` | `countrySelect` Display a country selection combo box.

Method Summary

Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Property Detail

### COUNTRY_CODES_BY_NAME

    static final java.lang.Object COUNTRY_CODES_BY_NAME

### COUNTRY_CODES_BY_NAME_ORDER

    static final java.lang.Object COUNTRY_CODES_BY_NAME_ORDER

### ISO3166_3

    static final java.lang.Object ISO3166_3

### country

    groovy.lang.Closure country

  Take a country code and output the country name, from the internal data.
  Note: to use message bundle to resolve name, use g:message tag
  emptyTag:
    @attr code REQUIRED the ISO3166_3 country code

### countrySelect

    groovy.lang.Closure countrySelect

  Display a country selection combo box.
  emptyTag:
    @attr from list of country codes or none for full list. Order is honoured
  attr:
    valueMessagePrefix code prefix to use, if you want names of countries to come from message bundle
  attr:
    value currently selected country code - ISO3166_3 (3 character, lowercase) form
  attr:
    default currently selected country code - if value is null
  attr:
    name the select name
  attr:
    id the DOM element id - uses the name attribute if not specified
  attr:
    keys A list of values to be used for the value attribute of each "option" element.
  attr:
    optionKey By default value attribute of each element will be the result of a "toString()" call on each element. Setting this allows the value to be a bean property of each element in the list.
  attr:
    optionValue By default the body of each <option> element will be the result of a "toString()" call on each element in the "from" attribute list. Setting this allows the value to be a bean property of each element in the list.
  attr:
    multiple boolean value indicating whether the select a multi-select (automatically true if the value is a collection, defaults to false - single-select)
  attr:
    noSelection A single-entry map detailing the key and value to use for the "no selection made" choice in the select box. If there is no current selection this will be shown as it is first in the list, and if submitted with this selected, the key that you provide will be submitted. Typically this will be blank - but you can also use 'null' in the case that you're passing the ID of an object
  attr:
    disabled boolean value indicating whether the select is disabled or enabled (defaults to false - enabled)

Groovy Documentation