com.sun.rave.web.ui.faces
Class ResultSetPropertyResolver
java.lang.Object
javax.faces.el.PropertyResolver
com.sun.rave.web.ui.faces.ResultSetPropertyResolver
public class ResultSetPropertyResolver
- extends javax.faces.el.PropertyResolver
This custom Property Resolver handles the special case of resolving ResultSet columns into editable
data values. This also enables binding to a SelectItem array from a ResultSet for filling lists
and dropdowns.
These expressions are supported:
#{...myResultSet.currentRow['COLUMN_NAME']}
--> binds to the 'COLUMN_NAME' column of the current row of the ResultSet
#(...myResultSet.selectItems['COLUMN_NAME'])
#(...myResultSet.selectItems['VALUE_COLUMN_NAME,LABEL_COLUMN_NAME'])
#(...myResultSet.selectItems['VALUE_COLUMN_NAME,LABEL_COLUMN_NAME,DESC_COLUMN_NAME'])
--> binds to an array of SelectItem generated by iterating through the ResultSet
#(...myResultSet.options['COLUMN_NAME'])
#(...myResultSet.options['VALUE_COLUMN_NAME,LABEL_COLUMN_NAME'])
#(...myResultSet.options['VALUE_COLUMN_NAME,LABEL_COLUMN_NAME,DESC_COLUMN_NAME'])
--> binds to an array of Options generated by iterating through the ResultSet
Method Summary |
java.lang.Class |
getType(java.lang.Object base,
int index)
|
java.lang.Class |
getType(java.lang.Object base,
java.lang.Object property)
|
java.lang.Object |
getValue(java.lang.Object base,
int index)
|
java.lang.Object |
getValue(java.lang.Object base,
java.lang.Object property)
|
static void |
initResultSet(java.sql.ResultSet resultSet)
|
boolean |
isReadOnly(java.lang.Object base,
int index)
|
boolean |
isReadOnly(java.lang.Object base,
java.lang.Object property)
|
void |
setValue(java.lang.Object base,
int index,
java.lang.Object value)
|
void |
setValue(java.lang.Object base,
java.lang.Object property,
java.lang.Object value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CURRENT_ROW_KEY
public static final java.lang.String CURRENT_ROW_KEY
- See Also:
- Constant Field Values
SELECT_ITEMS_KEY
public static final java.lang.String SELECT_ITEMS_KEY
- See Also:
- Constant Field Values
OPTIONS_KEY
public static final java.lang.String OPTIONS_KEY
- See Also:
- Constant Field Values
nested
protected javax.faces.el.PropertyResolver nested
ResultSetPropertyResolver
public ResultSetPropertyResolver(javax.faces.el.PropertyResolver nested)
getValue
public java.lang.Object getValue(java.lang.Object base,
java.lang.Object property)
throws javax.faces.el.EvaluationException,
javax.faces.el.PropertyNotFoundException
- Specified by:
getValue
in class javax.faces.el.PropertyResolver
- Throws:
javax.faces.el.EvaluationException
javax.faces.el.PropertyNotFoundException
getValue
public java.lang.Object getValue(java.lang.Object base,
int index)
throws javax.faces.el.EvaluationException,
javax.faces.el.PropertyNotFoundException
- Specified by:
getValue
in class javax.faces.el.PropertyResolver
- Throws:
javax.faces.el.EvaluationException
javax.faces.el.PropertyNotFoundException
setValue
public void setValue(java.lang.Object base,
java.lang.Object property,
java.lang.Object value)
throws javax.faces.el.EvaluationException,
javax.faces.el.PropertyNotFoundException
- Specified by:
setValue
in class javax.faces.el.PropertyResolver
- Throws:
javax.faces.el.EvaluationException
javax.faces.el.PropertyNotFoundException
setValue
public void setValue(java.lang.Object base,
int index,
java.lang.Object value)
throws javax.faces.el.EvaluationException,
javax.faces.el.PropertyNotFoundException
- Specified by:
setValue
in class javax.faces.el.PropertyResolver
- Throws:
javax.faces.el.EvaluationException
javax.faces.el.PropertyNotFoundException
isReadOnly
public boolean isReadOnly(java.lang.Object base,
java.lang.Object property)
throws javax.faces.el.EvaluationException,
javax.faces.el.PropertyNotFoundException
- Specified by:
isReadOnly
in class javax.faces.el.PropertyResolver
- Throws:
javax.faces.el.EvaluationException
javax.faces.el.PropertyNotFoundException
isReadOnly
public boolean isReadOnly(java.lang.Object base,
int index)
throws javax.faces.el.EvaluationException,
javax.faces.el.PropertyNotFoundException
- Specified by:
isReadOnly
in class javax.faces.el.PropertyResolver
- Throws:
javax.faces.el.EvaluationException
javax.faces.el.PropertyNotFoundException
getType
public java.lang.Class getType(java.lang.Object base,
java.lang.Object property)
throws javax.faces.el.EvaluationException,
javax.faces.el.PropertyNotFoundException
- Specified by:
getType
in class javax.faces.el.PropertyResolver
- Throws:
javax.faces.el.EvaluationException
javax.faces.el.PropertyNotFoundException
getType
public java.lang.Class getType(java.lang.Object base,
int index)
throws javax.faces.el.EvaluationException,
javax.faces.el.PropertyNotFoundException
- Specified by:
getType
in class javax.faces.el.PropertyResolver
- Throws:
javax.faces.el.EvaluationException
javax.faces.el.PropertyNotFoundException
initResultSet
public static void initResultSet(java.sql.ResultSet resultSet)