org.chenillekit.tapestry.core.models
Class OgnlSelectModel<T>

java.lang.Object
  extended by org.apache.tapestry5.util.AbstractSelectModel
      extended by org.chenillekit.tapestry.core.models.OgnlSelectModel<T>
All Implemented Interfaces:
SelectModel

public class OgnlSelectModel<T>
extends AbstractSelectModel

Defines the possible options for a <select> [X]HTML element. This select model implementation based on OGNL.

Use Case

your object list contains entities of type User. Each User object contains an object typed Address, and every Address object contains a property name.

If you want to display in the list the value of the name property you should define a labelExpression like address.name

Version:
$Id: OgnlSelectModel.java 670 2010-07-19 09:22:02Z mlusetti $

Constructor Summary
OgnlSelectModel(List<T> objectList, String labelExpression)
          constructs an ognl select model.
OgnlSelectModel(String labelExpression)
          constructs an ognl select model.
 
Method Summary
 List<OptionGroupModel> getOptionGroups()
          The list of groups, returns always null
 List<OptionModel> getOptions()
          The list of ungrouped options, which appear after any grouped options.
 void setObjectList(List<T> objectList)
          set the object list.
 
Methods inherited from class org.apache.tapestry5.util.AbstractSelectModel
visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OgnlSelectModel

public OgnlSelectModel(String labelExpression)
constructs an ognl select model.

Parameters:
labelExpression - the ognl expression converted to label.

OgnlSelectModel

public OgnlSelectModel(List<T> objectList,
                       String labelExpression)
constructs an ognl select model.

Parameters:
objectList - list of objects that should listed by select tag
labelExpression - the ognl expression converted to label.
Method Detail

setObjectList

public void setObjectList(List<T> objectList)
set the object list.

Parameters:
objectList - the object list

getOptionGroups

public List<OptionGroupModel> getOptionGroups()
The list of groups, returns always null

Returns:
always null

getOptions

public List<OptionModel> getOptions()
The list of ungrouped options, which appear after any grouped options.

Returns:
the ungrouped options


Copyright © 2008-2011 ChenilleKit. All Rights Reserved.