net.sf.tacos.ajax.components.palette
Class PaletteColumn

java.lang.Object
  extended by net.sf.tacos.ajax.components.palette.PaletteColumn
All Implemented Interfaces:
org.apache.tapestry.IRender

public class PaletteColumn
extends Object
implements org.apache.tapestry.IRender

One of the two columns in a Palette component: the left column lists available options, the right column lists the selected columns.

Author:
Howard Lewis Ship

Constructor Summary
PaletteColumn(String name, String clientId, int rows)
           
 
Method Summary
 void addOption(PaletteOption option)
          Adds an option
 void render(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IRequestCycle cycle)
          Renders the <select> and <option> tags for this column.
 void sortByLabel()
          Sorts the options by the label visible to the user.
 void sortByValue()
          Sorts the options by value (the hidden value for the option that represents the object value).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PaletteColumn

public PaletteColumn(String name,
                     String clientId,
                     int rows)
Parameters:
name - the name of the column (the name attribute of the <select>)
rows - the number of visible rows (the size attribute of the <select>)
Method Detail

addOption

public void addOption(PaletteOption option)
Adds an option

Parameters:
option -

sortByValue

public void sortByValue()
Sorts the options by value (the hidden value for the option that represents the object value). This should be invoked before rendering this PaletteColumn.


sortByLabel

public void sortByLabel()
Sorts the options by the label visible to the user. This should be invoked before rendering this PaletteColumn.


render

public void render(org.apache.tapestry.IMarkupWriter writer,
                   org.apache.tapestry.IRequestCycle cycle)
Renders the <select> and <option> tags for this column.

Specified by:
render in interface org.apache.tapestry.IRender