You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mb...@apache.org on 2005/07/21 17:49:51 UTC
svn commit: r220118 - in /myfaces: examples/trunk/simple/
tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/
tomahawk/trunk/src/java/org/apache/myfaces/renderkit/html/ext/
tomahawk/trunk/src/java/org/apache/myfaces/taglib/html/ext/ tomahawk...
Author: mbr
Date: Thu Jul 21 08:49:48 2005
New Revision: 220118
URL: http://svn.apache.org/viewcvs?rev=220118&view=rev
Log:
add all remaining row events to x:datatable
Modified:
myfaces/examples/trunk/simple/openDataTable.jsp
myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java
myfaces/tomahawk/trunk/src/java/org/apache/myfaces/renderkit/html/ext/HtmlTableRenderer.java
myfaces/tomahawk/trunk/src/java/org/apache/myfaces/taglib/html/ext/HtmlDataTableTag.java
myfaces/tomahawk/trunk/tld/myfaces_ext.tld
Modified: myfaces/examples/trunk/simple/openDataTable.jsp
URL: http://svn.apache.org/viewcvs/myfaces/examples/trunk/simple/openDataTable.jsp?rev=220118&r1=220117&r2=220118&view=diff
==============================================================================
--- myfaces/examples/trunk/simple/openDataTable.jsp (original)
+++ myfaces/examples/trunk/simple/openDataTable.jsp Thu Jul 21 08:49:48 2005
@@ -44,6 +44,8 @@
columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column"
rowOnMouseOver="this.style.backgroundColor='#A5CBFF'"
rowOnMouseOut="this.style.backgroundColor='#FFFFE0'"
+ rowOnClick="this.style.backgroundColor='#FFE0E0'"
+ rowOnDblClick="this.style.backgroundColor='#E0E0E0'"
var="row"
value="#{openDataList.data}"
preserveDataModel="false"
Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java?rev=220118&r1=220117&r2=220118&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java (original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java Thu Jul 21 08:49:48 2005
@@ -35,711 +35,800 @@
/**
* @author Thomas Spiegl (latest modification by $Author$)
* @author Manfred Geiler
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date: 2005-07-19 12:17:49 +0200 (Di, 19 Jul
+ * 2005) $
*/
-public class HtmlDataTable extends HtmlDataTableHack implements UserRoleAware
+public class HtmlDataTable
+ extends HtmlDataTableHack
+ implements UserRoleAware
{
- private static final Log log = LogFactory.getLog(HtmlDataTable.class);
+ private static final Log log = LogFactory.getLog(HtmlDataTable.class);
- private static final int PROCESS_DECODES = 1;
- private static final int PROCESS_VALIDATORS = 2;
- private static final int PROCESS_UPDATES = 3;
-
- private static final boolean DEFAULT_SORTASCENDING = true;
- private static final Class OBJECT_ARRAY_CLASS = (new Object[0]).getClass();
-
- private _SerializableDataModel _preservedDataModel;
-
- private String _sortColumn = null;
- private Boolean _sortAscending = null;
- private String _rowOnMouseOver = null;
- private String _rowOnMouseOut = null;
- private String _rowOnClick;
- private String _rowOnDblClick;
-
-
- private boolean _isValidChilds = true;
-
- public void setRowIndex(int rowIndex)
- {
- if(rowIndex < -1)
- {
- throw new IllegalArgumentException("rowIndex is less than -1");
- }
-
- String rowIndexVar = getRowIndexVar();
- String rowCountVar = getRowCountVar();
- String previousRowDataVar = getPreviousRowDataVar();
- if (rowIndexVar != null || rowCountVar != null || previousRowDataVar != null)
- {
- Map requestMap = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
-
- if (previousRowDataVar != null && rowIndex >= 0) //we only need to provide the previousRowDataVar for a valid rowIndex
- {
- if (isRowAvailable())
- {
- //previous row is available
- requestMap.put(previousRowDataVar, getRowData());
- }
- else
- {
- //no previous row available
- requestMap.put(previousRowDataVar, null);
- }
- }
-
- super.setRowIndex(rowIndex);
-
- if (rowIndex >= 0)
- {
- //regular row index, update request scope variables
- if (rowIndexVar != null)
- {
- requestMap.put(rowIndexVar, new Integer(rowIndex));
- }
-
- if (rowCountVar != null)
- {
- requestMap.put(rowCountVar, new Integer(getRowCount()));
- }
- }
- else
- {
- //rowIndex == -1 means end of loop --> remove request scope variables
- if (rowIndexVar != null)
- {
- requestMap.remove(rowIndexVar);
- }
-
- if (rowCountVar != null)
- {
- requestMap.remove(rowCountVar);
- }
-
- if (previousRowDataVar != null)
- {
- requestMap.remove(previousRowDataVar);
- }
- }
+ private static final int PROCESS_DECODES = 1;
+ private static final int PROCESS_VALIDATORS = 2;
+ private static final int PROCESS_UPDATES = 3;
+
+ private static final boolean DEFAULT_SORTASCENDING = true;
+
+ private static final Class OBJECT_ARRAY_CLASS = (new Object[0]).getClass();
+
+ private _SerializableDataModel _preservedDataModel;
+ private String _sortColumn = null;
+ private Boolean _sortAscending = null;
+ private String _rowOnClick = null;
+ private String _rowOnDblClick = null;
+ private String _rowOnMouseDown = null;
+ private String _rowOnMouseUp = null;
+ private String _rowOnMouseOver = null;
+ private String _rowOnMouseMove = null;
+ private String _rowOnMouseOut = null;
+ private String _rowOnKeyPress = null;
+ private String _rowOnKeyDown = null;
+ private String _rowOnKeyUp = null;
+ private boolean _isValidChilds = true;
+
+ public void setRowIndex(int rowIndex)
+ {
+ String rowIndexVar = getRowIndexVar();
+ String rowCountVar = getRowCountVar();
+ String previousRowDataVar = getPreviousRowDataVar();
+ if (rowIndexVar != null || rowCountVar != null
+ || previousRowDataVar != null)
+ {
+ Map requestMap = FacesContext.getCurrentInstance().getExternalContext()
+ .getRequestMap();
+
+ if (previousRowDataVar != null && rowIndex >= 0)
+ {
+ // we only need to provide the previousRowDataVar for a valid rowIndex
+ if (isRowAvailable())
+ {
+ // previous row is available
+ requestMap.put(previousRowDataVar, getRowData());
}
else
{
- // no extended var attributes defined, no special treatment
- super.setRowIndex(rowIndex);
+ // no previous row available
+ requestMap.put(previousRowDataVar, null);
}
- }
+ }
- public void processDecodes(FacesContext context)
- {
- if (!isRendered())
+ super.setRowIndex(rowIndex);
+
+ if (rowIndex >= 0)
+ {
+ // regular row index, update request scope variables
+ if (rowIndexVar != null)
{
- return;
+ requestMap.put(rowIndexVar, new Integer(rowIndex));
}
- super.processDecodes(context);
- setRowIndex(-1);
- processColumns(context, PROCESS_DECODES);
- setRowIndex(-1);
- }
-
- /**
- * @param context
- * @param processAction
- */
- private void processColumns(FacesContext context, int processAction)
- {
- for (Iterator it = getChildren().iterator(); it.hasNext();)
+
+ if (rowCountVar != null)
{
- UIComponent child = (UIComponent) it.next();
- if (child instanceof UIColumns)
- {
- process(context, child, processAction);
- }
+ requestMap.put(rowCountVar, new Integer(getRowCount()));
}
- }
-
- private void process(FacesContext context, UIComponent component, int processAction)
- {
- switch (processAction)
+ }
+ else
+ {
+ // rowIndex == -1 means end of loop --> remove request scope variables
+ if (rowIndexVar != null)
{
- case PROCESS_DECODES:
- component.processDecodes(context);
- break;
- case PROCESS_VALIDATORS:
- component.processValidators(context);
- break;
- case PROCESS_UPDATES:
- component.processUpdates(context);
- break;
+ requestMap.remove(rowIndexVar);
}
- }
-
- public void processValidators(FacesContext context)
- {
- if (!isRendered())
+
+ if (rowCountVar != null)
{
- return;
+ requestMap.remove(rowCountVar);
}
- super.processValidators(context);
- processColumns(context, PROCESS_VALIDATORS);
- setRowIndex(-1);
- if (context.getRenderResponse())
+ if (previousRowDataVar != null)
{
- _isValidChilds = false;
+ requestMap.remove(previousRowDataVar);
}
+ }
}
-
- public void processUpdates(FacesContext context)
+ else
{
- if (!isRendered())
- {
- return;
- }
- super.processUpdates(context);
- processColumns(context, PROCESS_UPDATES);
- setRowIndex(-1);
+ // no extended var attributes defined, no special treatment
+ super.setRowIndex(rowIndex);
+ }
+ }
- if (isPreserveDataModel())
- {
- updateModelFromPreservedDataModel(context);
- }
+ public void processDecodes(FacesContext context)
+ {
+ if (!isRendered())
+ {
+ return;
+ }
+ super.processDecodes(context);
+ setRowIndex(-1);
+ processColumns(context, PROCESS_DECODES);
+ setRowIndex(-1);
+ }
- if (context.getRenderResponse())
- {
- _isValidChilds = false;
- }
+ /**
+ * @param context
+ * @param processAction
+ */
+ private void processColumns(FacesContext context, int processAction)
+ {
+ for (Iterator it = getChildren().iterator(); it.hasNext();)
+ {
+ UIComponent child = (UIComponent) it.next();
+ if (child instanceof UIColumns)
+ {
+ process(context, child, processAction);
+ }
}
-
- private void updateModelFromPreservedDataModel(FacesContext context)
+ }
+
+ private void process(FacesContext context, UIComponent component,
+ int processAction)
+ {
+ switch (processAction)
{
- ValueBinding vb = getValueBinding("value");
- if (vb != null && !vb.isReadOnly(context))
- {
- _SerializableDataModel dm = (_SerializableDataModel) getDataModel();
- Class type = vb.getType(context);
- if (DataModel.class.isAssignableFrom(type))
- {
- vb.setValue(context, dm);
- }
- else if (List.class.isAssignableFrom(type))
- {
- vb.setValue(context, dm.getWrappedData());
- }
- else if (OBJECT_ARRAY_CLASS.isAssignableFrom(type))
- {
- List lst = (List) dm.getWrappedData();
- vb.setValue(context, lst.toArray(new Object[lst.size()]));
- }
- else if (ResultSet.class.isAssignableFrom(type))
- {
- throw new UnsupportedOperationException(this.getClass().getName()
- + " UnsupportedOperationException");
- }
- else
- {
- //Assume scalar data model
- List lst = (List) dm.getWrappedData();
- if (lst.size() > 0)
- {
- vb.setValue(context, lst.get(0));
- }
- else
- {
- vb.setValue(context, null);
- }
- }
- }
- _preservedDataModel = null;
- }
-
- public void encodeBegin(FacesContext context) throws IOException
- {
- if (!isRendered())
- return;
-
- if (_isValidChilds)
- {
- _preservedDataModel = null;
- }
-
- if (isRenderedIfEmpty() || getRowCount() > 0)
- {
- super.encodeBegin(context);
- for (Iterator iter = getChildren().iterator(); iter.hasNext();)
- {
- UIComponent component = (UIComponent) iter.next();
- if (component instanceof UIColumns)
- {
- ((UIColumns) component).encodeTableBegin(context);
- }
- }
- }
- }
-
- /**
- * @see javax.faces.component.UIComponentBase#encodeChildren(javax.faces.context.FacesContext)
- */
- public void encodeChildren(FacesContext context) throws IOException
- {
- if (isRenderedIfEmpty() || getRowCount() > 0)
- {
- super.encodeChildren(context);
- }
- }
-
- /**
- * @see javax.faces.component.UIData#encodeEnd(javax.faces.context.FacesContext)
- */
- public void encodeEnd(FacesContext context) throws IOException
- {
- if (isRenderedIfEmpty() || getRowCount() > 0)
- {
- super.encodeEnd(context);
- for (Iterator iter = getChildren().iterator(); iter.hasNext();)
- {
- UIComponent component = (UIComponent) iter.next();
- if (component instanceof UIColumns)
- {
- ((UIColumns) component).encodeTableEnd(context);
- }
- }
- }
+ case PROCESS_DECODES:
+ component.processDecodes(context);
+ break;
+ case PROCESS_VALIDATORS:
+ component.processValidators(context);
+ break;
+ case PROCESS_UPDATES:
+ component.processUpdates(context);
+ break;
}
-
- public int getFirst()
+ }
+
+ public void processValidators(FacesContext context)
+ {
+ if (!isRendered())
{
- if (_preservedDataModel != null)
- {
- //Rather get the currently restored DataModel attribute
- return ((_SerializableDataModel) _preservedDataModel).getFirst();
- }
- else
- {
- return super.getFirst();
- }
+ return;
}
-
- public void setFirst(int first)
+ super.processValidators(context);
+ processColumns(context, PROCESS_VALIDATORS);
+ setRowIndex(-1);
+
+ if (context.getRenderResponse())
{
- if (_preservedDataModel != null)
- {
- //Also change the currently restored DataModel attribute
- ((_SerializableDataModel) _preservedDataModel).setFirst(first);
- }
- super.setFirst(first);
+ _isValidChilds = false;
+ }
+ }
+
+ public void processUpdates(FacesContext context)
+ {
+ if (!isRendered())
+ {
+ return;
+ }
+ super.processUpdates(context);
+ processColumns(context, PROCESS_UPDATES);
+ setRowIndex(-1);
+
+ if (isPreserveDataModel())
+ {
+ updateModelFromPreservedDataModel(context);
+ }
+
+ if (context.getRenderResponse())
+ {
+ _isValidChilds = false;
}
-
- public int getRows()
+ }
+
+ private void updateModelFromPreservedDataModel(FacesContext context)
+ {
+ ValueBinding vb = getValueBinding("value");
+ if (vb != null && !vb.isReadOnly(context))
{
- if (_preservedDataModel != null)
+ _SerializableDataModel dm = (_SerializableDataModel) getDataModel();
+ Class type = vb.getType(context);
+ if (DataModel.class.isAssignableFrom(type))
+ {
+ vb.setValue(context, dm);
+ }
+ else if (List.class.isAssignableFrom(type))
+ {
+ vb.setValue(context, dm.getWrappedData());
+ }
+ else if (OBJECT_ARRAY_CLASS.isAssignableFrom(type))
+ {
+ List lst = (List) dm.getWrappedData();
+ vb.setValue(context, lst.toArray(new Object[lst.size()]));
+ }
+ else if (ResultSet.class.isAssignableFrom(type))
+ {
+ throw new UnsupportedOperationException(this.getClass().getName()
+ + " UnsupportedOperationException");
+ }
+ else
+ {
+ // Assume scalar data model
+ List lst = (List) dm.getWrappedData();
+ if (lst.size() > 0)
{
- //Rather get the currently restored DataModel attribute
- return ((_SerializableDataModel) _preservedDataModel).getRows();
+ vb.setValue(context, lst.get(0));
}
else
{
- return super.getRows();
+ vb.setValue(context, null);
}
+ }
}
-
- public void setRows(int rows)
+ _preservedDataModel = null;
+ }
+
+ public void encodeBegin(FacesContext context) throws IOException
+ {
+ if (!isRendered())
+ return;
+
+ if (_isValidChilds)
{
- if (_preservedDataModel != null)
- {
- //Also change the currently restored DataModel attribute
- ((_SerializableDataModel) _preservedDataModel).setRows(rows);
- }
- super.setRows(rows);
+ _preservedDataModel = null;
}
-
- public Object saveState(FacesContext context)
+
+ if (isRenderedIfEmpty() || getRowCount() > 0)
{
- boolean preserveSort = isPreserveSort();
- Object values[] = new Object[13];
- values[0] = super.saveState(context);
- values[1] = _preserveDataModel;
- if (isPreserveDataModel())
+ super.encodeBegin(context);
+ for (Iterator iter = getChildren().iterator(); iter.hasNext();)
+ {
+ UIComponent component = (UIComponent) iter.next();
+ if (component instanceof UIColumns)
{
- values[2] = saveAttachedState(context, getSerializableDataModel());
+ ((UIColumns) component).encodeTableBegin(context);
}
- else
+ }
+ }
+ }
+
+ /**
+ * @see javax.faces.component.UIComponentBase#encodeChildren(javax.faces.context.FacesContext)
+ */
+ public void encodeChildren(FacesContext context) throws IOException
+ {
+ if (isRenderedIfEmpty() || getRowCount() > 0)
+ {
+ super.encodeChildren(context);
+ }
+ }
+
+ /**
+ * @see javax.faces.component.UIData#encodeEnd(javax.faces.context.FacesContext)
+ */
+ public void encodeEnd(FacesContext context) throws IOException
+ {
+ if (isRenderedIfEmpty() || getRowCount() > 0)
+ {
+ super.encodeEnd(context);
+ for (Iterator iter = getChildren().iterator(); iter.hasNext();)
+ {
+ UIComponent component = (UIComponent) iter.next();
+ if (component instanceof UIColumns)
{
- values[2] = null;
+ ((UIColumns) component).encodeTableEnd(context);
}
- values[3] = _preserveSort;
- values[4] = _sortColumn;
- values[5] = _sortAscending;
- values[6] = _renderedIfEmpty;
- values[7] = _rowCountVar;
- values[8] = _rowIndexVar;
- values[9] = _rowOnMouseOver;
- values[10] = _rowOnMouseOut;
-
- values[11] = preserveSort ? getSortColumn() : null;
- values[12] = preserveSort ? Boolean.valueOf(isSortAscending()) : null;
- return values;
- }
-
- /**
- * @see org.apache.myfaces.component.html.ext.HtmlDataTableHack#getDataModel()
- */
- protected DataModel getDataModel()
- {
- if (_preservedDataModel != null)
- {
- setDataModel(_preservedDataModel);
- _preservedDataModel = null;
- }
- return super.getDataModel();
- }
-
- public void restoreState(FacesContext context, Object state)
- {
- Object values[] = (Object[]) state;
- super.restoreState(context, values[0]);
- _preserveDataModel = (Boolean) values[1];
- if (isPreserveDataModel())
+ }
+ }
+ }
+
+ public int getFirst()
+ {
+ if (_preservedDataModel != null)
+ {
+ // Rather get the currently restored DataModel attribute
+ return ((_SerializableDataModel) _preservedDataModel).getFirst();
+ }
+ else
+ {
+ return super.getFirst();
+ }
+ }
+
+ public void setFirst(int first)
+ {
+ if (_preservedDataModel != null)
+ {
+ // Also change the currently restored DataModel attribute
+ ((_SerializableDataModel) _preservedDataModel).setFirst(first);
+ }
+ super.setFirst(first);
+ }
+
+ public int getRows()
+ {
+ if (_preservedDataModel != null)
+ {
+ // Rather get the currently restored DataModel attribute
+ return ((_SerializableDataModel) _preservedDataModel).getRows();
+ }
+ else
+ {
+ return super.getRows();
+ }
+ }
+
+ public void setRows(int rows)
+ {
+ if (_preservedDataModel != null)
+ {
+ // Also change the currently restored DataModel attribute
+ ((_SerializableDataModel) _preservedDataModel).setRows(rows);
+ }
+ super.setRows(rows);
+ }
+
+ public Object saveState(FacesContext context)
+ {
+ boolean preserveSort = isPreserveSort();
+ Object values[] = new Object[21];
+ values[0] = super.saveState(context);
+ values[1] = _preserveDataModel;
+ if (isPreserveDataModel())
+ {
+ values[2] = saveAttachedState(context, getSerializableDataModel());
+ }
+ else
+ {
+ values[2] = null;
+ }
+ values[3] = _preserveSort;
+ values[4] = _sortColumn;
+ values[5] = _sortAscending;
+ values[6] = _renderedIfEmpty;
+ values[7] = _rowCountVar;
+ values[8] = _rowIndexVar;
+
+ values[9] = _rowOnClick = null;
+ values[10] = _rowOnDblClick = null;
+ values[11] = _rowOnMouseDown = null;
+ values[12] = _rowOnMouseUp = null;
+ values[13] = _rowOnMouseOver = null;
+ values[14] = _rowOnMouseMove = null;
+ values[15] = _rowOnMouseOut = null;
+ values[16] = _rowOnKeyPress = null;
+ values[17] = _rowOnKeyDown = null;
+ values[18] = _rowOnKeyUp = null;
+
+ values[19] = preserveSort ? getSortColumn() : null;
+ values[20] = preserveSort ? Boolean.valueOf(isSortAscending()) : null;
+ return values;
+ }
+
+ /**
+ * @see org.apache.myfaces.component.html.ext.HtmlDataTableHack#getDataModel()
+ */
+ protected DataModel getDataModel()
+ {
+ if (_preservedDataModel != null)
+ {
+ setDataModel(_preservedDataModel);
+ _preservedDataModel = null;
+ }
+ return super.getDataModel();
+ }
+
+ public void restoreState(FacesContext context, Object state)
+ {
+ Object values[] = (Object[]) state;
+ super.restoreState(context, values[0]);
+ _preserveDataModel = (Boolean) values[1];
+ if (isPreserveDataModel())
+ {
+ _preservedDataModel = (_SerializableDataModel) restoreAttachedState(
+ context, values[2]);
+ }
+ else
+ {
+ _preservedDataModel = null;
+ }
+ _preserveSort = (Boolean) values[3];
+ _sortColumn = (String) values[4];
+ _sortAscending = (Boolean) values[5];
+ _renderedIfEmpty = (Boolean) values[6];
+ _rowCountVar = (String) values[7];
+ _rowIndexVar = (String) values[8];
+
+ _rowOnClick = (String) values[9];
+ _rowOnDblClick = (String) values[10];
+ _rowOnMouseDown = (String) values[11];
+ _rowOnMouseUp = (String) values[12];
+ _rowOnMouseOver = (String) values[13];
+ _rowOnMouseMove = (String) values[14];
+ _rowOnMouseOut = (String) values[15];
+ _rowOnKeyPress = (String) values[16];
+ _rowOnKeyDown = (String) values[17];
+ _rowOnKeyUp = (String) values[18];
+
+ if (isPreserveSort())
+ {
+ String sortColumn = (String) values[19];
+ Boolean sortAscending = (Boolean) values[20];
+ if (sortColumn != null && sortAscending != null)
+ {
+ ValueBinding vb = getValueBinding("sortColumn");
+ if (vb != null && !vb.isReadOnly(context))
{
- _preservedDataModel = (_SerializableDataModel) restoreAttachedState(context, values[2]);
+ vb.setValue(context, sortColumn);
}
- else
+
+ vb = getValueBinding("sortAscending");
+ if (vb != null && !vb.isReadOnly(context))
{
- _preservedDataModel = null;
+ vb.setValue(context, sortAscending);
}
- _preserveSort = (Boolean) values[3];
- _sortColumn = (String) values[4];
- _sortAscending = (Boolean) values[5];
- _renderedIfEmpty = (Boolean) values[6];
- _rowCountVar = (String) values[7];
- _rowIndexVar = (String) values[8];
- _rowOnMouseOver = (String) values[9];
- _rowOnMouseOut = (String) values[10];
-
- if (isPreserveSort())
- {
- String sortColumn = (String) values[11];
- Boolean sortAscending = (Boolean) values[12];
- if (sortColumn != null && sortAscending != null)
- {
- ValueBinding vb = getValueBinding("sortColumn");
- if (vb != null && !vb.isReadOnly(context))
- {
- vb.setValue(context, sortColumn);
- }
-
- vb = getValueBinding("sortAscending");
- if (vb != null && !vb.isReadOnly(context))
- {
- vb.setValue(context, sortAscending);
- }
- }
- }
- }
-
- public _SerializableDataModel getSerializableDataModel()
- {
- DataModel dm = getDataModel();
- if (dm instanceof _SerializableDataModel)
- {
- return (_SerializableDataModel) dm;
- }
- return createSerializableDataModel();
- }
-
- /**
- * @return
- */
- private _SerializableDataModel createSerializableDataModel()
- {
- Object value = getValue();
- if (value == null)
- {
- return null;
- }
- else if (value instanceof DataModel)
- {
- return new _SerializableDataModel(getFirst(), getRows(), (DataModel) value);
- }
- else if (value instanceof List)
- {
- return new _SerializableListDataModel(getFirst(), getRows(), (List) value);
- }
- else if (OBJECT_ARRAY_CLASS.isAssignableFrom(value.getClass()))
- {
- return new _SerializableArrayDataModel(getFirst(), getRows(), (Object[]) value);
- }
- else if (value instanceof ResultSet)
- {
- return new _SerializableResultSetDataModel(getFirst(), getRows(), (ResultSet) value);
- }
- else if (value instanceof javax.servlet.jsp.jstl.sql.Result)
- {
- return new _SerializableResultDataModel(getFirst(), getRows(),
- (javax.servlet.jsp.jstl.sql.Result) value);
- }
- else
- {
- return new _SerializableScalarDataModel(getFirst(), getRows(), value);
- }
- }
-
- public boolean isRendered()
- {
- if (!UserRoleUtils.isVisibleOnUserRole(this))
- return false;
- return super.isRendered();
- }
-
- public void setSortColumn(String sortColumn)
- {
- _sortColumn = sortColumn;
- // update model is necessary here, because processUpdates is never called
- // reason: HtmlCommandSortHeader.isImmediate() == true
- ValueBinding vb = getValueBinding("sortColumn");
- if (vb != null)
- {
- vb.setValue(getFacesContext(), _sortColumn);
- _sortColumn = null;
- }
- }
-
- public String getSortColumn()
- {
- if (_sortColumn != null)
- return _sortColumn;
- ValueBinding vb = getValueBinding("sortColumn");
- return vb != null ? (String) vb.getValue(getFacesContext()) : null;
- }
-
- public void setSortAscending(boolean sortAscending)
- {
- _sortAscending = Boolean.valueOf(sortAscending);
- // update model is necessary here, because processUpdates is never called
- // reason: HtmlCommandSortHeader.isImmediate() == true
- ValueBinding vb = getValueBinding("sortAscending");
- if (vb != null)
- {
- vb.setValue(getFacesContext(), _sortAscending);
- _sortAscending = null;
- }
- }
-
- public boolean isSortAscending()
- {
- if (_sortAscending != null)
- return _sortAscending.booleanValue();
- ValueBinding vb = getValueBinding("sortAscending");
- Boolean v = vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
- return v != null ? v.booleanValue() : DEFAULT_SORTASCENDING;
- }
-
- public void setRowOnMouseOver(String rowOnMouseOver)
- {
- _rowOnMouseOver = rowOnMouseOver;
- // update model is necessary here, because processUpdates is never called
- // reason: HtmlCommandSortHeader.isImmediate() == true
- ValueBinding vb = getValueBinding("rowOnMouseOver");
- if (vb != null)
- {
- vb.setValue(getFacesContext(), _rowOnMouseOver);
- _rowOnMouseOver = null;
- }
- }
-
- public String getRowOnMouseOver()
- {
- if (_rowOnMouseOver != null)
- return _rowOnMouseOver;
- ValueBinding vb = getValueBinding("rowOnMouseOver");
- return vb != null ? (String) vb.getValue(getFacesContext()) : null;
- }
-
- public void setRowOnMouseOut(String rowOnMouseOut)
- {
- _rowOnMouseOut = rowOnMouseOut;
- // update model is necessary here, because processUpdates is never called
- // reason: HtmlCommandSortHeader.isImmediate() == true
- ValueBinding vb = getValueBinding("rowOnMouseOut");
- if (vb != null)
- {
- vb.setValue(getFacesContext(), _rowOnMouseOut);
- _rowOnMouseOut = null;
- }
- }
-
- public String getRowOnMouseOut()
- {
- if (_rowOnMouseOut != null)
- return _rowOnMouseOut;
- ValueBinding vb = getValueBinding("rowOnMouseOut");
- return vb != null ? (String) vb.getValue(getFacesContext()) : null;
- }
-
- public void setRowOnClick(String rowOnClick)
- {
- _rowOnClick = rowOnClick;
- ValueBinding vb = getValueBinding("rowOnClick");
- if (vb != null)
- {
- vb.setValue(getFacesContext(), _rowOnClick);
- _rowOnClick = null;
- }
- }
-
- public String getRowOnClick()
- {
- if (_rowOnClick != null)
- return _rowOnClick;
- ValueBinding vb = getValueBinding("rowOnClick");
- return vb != null ? (String) vb.getValue(getFacesContext()) : null;
- }
-
- public void setRowOnDblClick(String rowOnDblClick)
- {
- _rowOnDblClick = rowOnDblClick;
- ValueBinding vb = getValueBinding("rowOnDblClick");
- if (vb != null)
- {
- vb.setValue(getFacesContext(), _rowOnDblClick);
- _rowOnDblClick = null;
- }
- }
-
- public String getRowOnDblClick()
- {
- if (_rowOnDblClick != null)
- return _rowOnDblClick;
- ValueBinding vb = getValueBinding("rowOnDblClick");
- return vb != null ? (String) vb.getValue(getFacesContext()) : null;
- }
-
-
- //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
-
- public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlDataTable";
- private static final boolean DEFAULT_PRESERVEDATAMODEL = false;
- private static final boolean DEFAULT_PRESERVESORT = true;
- private static final boolean DEFAULT_RENDEREDIFEMPTY = true;
-
- private Boolean _preserveDataModel = null;
- private Boolean _preserveSort = null;
- private String _enabledOnUserRole = null;
- private String _visibleOnUserRole = null;
- private Boolean _renderedIfEmpty = null;
- private String _rowIndexVar = null;
- private String _rowCountVar = null;
- private String _previousRowDataVar = null;
-
- public HtmlDataTable()
- {
- }
-
- public void setPreserveDataModel(boolean preserveDataModel)
- {
- _preserveDataModel = Boolean.valueOf(preserveDataModel);
- }
-
- public boolean isPreserveDataModel()
- {
- if (_preserveDataModel != null)
- return _preserveDataModel.booleanValue();
- ValueBinding vb = getValueBinding("preserveDataModel");
- Boolean v = vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
- return v != null ? v.booleanValue() : DEFAULT_PRESERVEDATAMODEL;
- }
-
- public void setPreserveSort(boolean preserveSort)
- {
- _preserveSort = Boolean.valueOf(preserveSort);
- }
-
- public boolean isPreserveSort()
- {
- if (_preserveSort != null)
- return _preserveSort.booleanValue();
- ValueBinding vb = getValueBinding("preserveSort");
- Boolean v = vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
- return v != null ? v.booleanValue() : DEFAULT_PRESERVESORT;
- }
-
- public void setEnabledOnUserRole(String enabledOnUserRole)
- {
- _enabledOnUserRole = enabledOnUserRole;
- }
-
- public String getEnabledOnUserRole()
- {
- if (_enabledOnUserRole != null)
- return _enabledOnUserRole;
- ValueBinding vb = getValueBinding("enabledOnUserRole");
- return vb != null ? (String) vb.getValue(getFacesContext()) : null;
- }
-
- public void setVisibleOnUserRole(String visibleOnUserRole)
- {
- _visibleOnUserRole = visibleOnUserRole;
- }
-
- public String getVisibleOnUserRole()
- {
- if (_visibleOnUserRole != null)
- return _visibleOnUserRole;
- ValueBinding vb = getValueBinding("visibleOnUserRole");
- return vb != null ? (String) vb.getValue(getFacesContext()) : null;
- }
-
- public void setRenderedIfEmpty(boolean renderedIfEmpty)
- {
- _renderedIfEmpty = Boolean.valueOf(renderedIfEmpty);
- }
-
- public boolean isRenderedIfEmpty()
- {
- if (_renderedIfEmpty != null)
- return _renderedIfEmpty.booleanValue();
- ValueBinding vb = getValueBinding("renderedIfEmpty");
- Boolean v = vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
- return v != null ? v.booleanValue() : DEFAULT_RENDEREDIFEMPTY;
- }
-
- public void setRowIndexVar(String rowIndexVar)
- {
- _rowIndexVar = rowIndexVar;
- }
-
- public String getRowIndexVar()
- {
- if (_rowIndexVar != null)
- return _rowIndexVar;
- ValueBinding vb = getValueBinding("rowIndexVar");
- return vb != null ? (String) vb.getValue(getFacesContext()) : null;
- }
-
- public void setRowCountVar(String rowCountVar)
- {
- _rowCountVar = rowCountVar;
- }
-
- public String getRowCountVar()
- {
- if (_rowCountVar != null)
- return _rowCountVar;
- ValueBinding vb = getValueBinding("rowCountVar");
- return vb != null ? (String) vb.getValue(getFacesContext()) : null;
- }
-
- public void setPreviousRowDataVar(String previousRowDataVar)
- {
- _previousRowDataVar = previousRowDataVar;
- }
-
- public String getPreviousRowDataVar()
- {
- if (_previousRowDataVar != null)
- return _previousRowDataVar;
- ValueBinding vb = getValueBinding("previousRowDataVar");
- return vb != null ? (String) vb.getValue(getFacesContext()) : null;
- }
+ }
+ }
+ }
+
+ public _SerializableDataModel getSerializableDataModel()
+ {
+ DataModel dm = getDataModel();
+ if (dm instanceof _SerializableDataModel)
+ {
+ return (_SerializableDataModel) dm;
+ }
+ return createSerializableDataModel();
+ }
+
+ /**
+ * @return
+ */
+ private _SerializableDataModel createSerializableDataModel()
+ {
+ Object value = getValue();
+ if (value == null)
+ {
+ return null;
+ }
+ else if (value instanceof DataModel)
+ {
+ return new _SerializableDataModel(getFirst(), getRows(),
+ (DataModel) value);
+ }
+ else if (value instanceof List)
+ {
+ return new _SerializableListDataModel(getFirst(), getRows(), (List) value);
+ }
+ else if (OBJECT_ARRAY_CLASS.isAssignableFrom(value.getClass()))
+ {
+ return new _SerializableArrayDataModel(getFirst(), getRows(),
+ (Object[]) value);
+ }
+ else if (value instanceof ResultSet)
+ {
+ return new _SerializableResultSetDataModel(getFirst(), getRows(),
+ (ResultSet) value);
+ }
+ else if (value instanceof javax.servlet.jsp.jstl.sql.Result)
+ {
+ return new _SerializableResultDataModel(getFirst(), getRows(),
+ (javax.servlet.jsp.jstl.sql.Result) value);
+ }
+ else
+ {
+ return new _SerializableScalarDataModel(getFirst(), getRows(), value);
+ }
+ }
+
+ public boolean isRendered()
+ {
+ if (!UserRoleUtils.isVisibleOnUserRole(this))
+ return false;
+ return super.isRendered();
+ }
+
+ public void setSortColumn(String sortColumn)
+ {
+ _sortColumn = sortColumn;
+ // update model is necessary here, because processUpdates is never called
+ // reason: HtmlCommandSortHeader.isImmediate() == true
+ ValueBinding vb = getValueBinding("sortColumn");
+ if (vb != null)
+ {
+ vb.setValue(getFacesContext(), _sortColumn);
+ _sortColumn = null;
+ }
+ }
+
+ public String getSortColumn()
+ {
+ if (_sortColumn != null)
+ return _sortColumn;
+ ValueBinding vb = getValueBinding("sortColumn");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setSortAscending(boolean sortAscending)
+ {
+ _sortAscending = Boolean.valueOf(sortAscending);
+ // update model is necessary here, because processUpdates is never called
+ // reason: HtmlCommandSortHeader.isImmediate() == true
+ ValueBinding vb = getValueBinding("sortAscending");
+ if (vb != null)
+ {
+ vb.setValue(getFacesContext(), _sortAscending);
+ _sortAscending = null;
+ }
+ }
+
+ public boolean isSortAscending()
+ {
+ if (_sortAscending != null)
+ return _sortAscending.booleanValue();
+ ValueBinding vb = getValueBinding("sortAscending");
+ Boolean v = vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
+ return v != null ? v.booleanValue() : DEFAULT_SORTASCENDING;
+ }
+
+ public void setRowOnMouseOver(String rowOnMouseOver)
+ {
+ _rowOnMouseOver = rowOnMouseOver;
+ }
+
+ public String getRowOnMouseOver()
+ {
+ if (_rowOnMouseOver != null)
+ return _rowOnMouseOver;
+ ValueBinding vb = getValueBinding("rowOnMouseOver");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setRowOnMouseOut(String rowOnMouseOut)
+ {
+ _rowOnMouseOut = rowOnMouseOut;
+ }
+
+ public String getRowOnMouseOut()
+ {
+ if (_rowOnMouseOut != null)
+ return _rowOnMouseOut;
+ ValueBinding vb = getValueBinding("rowOnMouseOut");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ public String getRowOnClick()
+ {
+ if (_rowOnClick != null)
+ return _rowOnClick;
+ ValueBinding vb = getValueBinding("rowOnClick");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setRowOnClick(String rowOnClick)
+ {
+ _rowOnClick = rowOnClick;
+ }
+
+ public String getRowOnDblClick()
+ {
+ if (_rowOnDblClick != null)
+ return _rowOnDblClick;
+ ValueBinding vb = getValueBinding("rowOnDblClick");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setRowOnDblClick(String rowOnDblClick)
+ {
+ _rowOnDblClick = rowOnDblClick;
+ }
+
+ public String getRowOnKeyDown()
+ {
+ if (_rowOnKeyDown != null)
+ return _rowOnKeyDown;
+ ValueBinding vb = getValueBinding("rowOnKeyDown");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setRowOnKeyDown(String rowOnKeyDown)
+ {
+ _rowOnKeyDown = rowOnKeyDown;
+ }
+
+ public String getRowOnKeyPress()
+ {
+ if (_rowOnKeyPress != null)
+ return _rowOnKeyPress;
+ ValueBinding vb = getValueBinding("rowOnKeyPress");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setRowOnKeyPress(String rowOnKeyPress)
+ {
+ _rowOnKeyPress = rowOnKeyPress;
+ }
+
+ public String getRowOnKeyUp()
+ {
+ if (_rowOnKeyUp != null)
+ return _rowOnKeyUp;
+ ValueBinding vb = getValueBinding("rowOnKeyUp");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setRowOnKeyUp(String rowOnKeyUp)
+ {
+ _rowOnKeyUp = rowOnKeyUp;
+ }
+
+ public String getRowOnMouseDown()
+ {
+ if (_rowOnMouseDown != null)
+ return _rowOnMouseDown;
+ ValueBinding vb = getValueBinding("rowOnMouseDown");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setRowOnMouseDown(String rowOnMouseDown)
+ {
+ _rowOnMouseDown = rowOnMouseDown;
+ }
+
+ public String getRowOnMouseMove()
+ {
+ if (_rowOnMouseMove != null)
+ return _rowOnMouseMove;
+ ValueBinding vb = getValueBinding("rowOnMouseMove");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setRowOnMouseMove(String rowOnMouseMove)
+ {
+ _rowOnMouseMove = rowOnMouseMove;
+ }
+
+ public String getRowOnMouseUp()
+ {
+ if (_rowOnMouseUp != null)
+ return _rowOnMouseUp;
+ ValueBinding vb = getValueBinding("rowOnMouseUp");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setRowOnMouseUp(String rowOnMouseUp)
+ {
+ _rowOnMouseUp = rowOnMouseUp;
+ }
+
+ // ------------------ GENERATED CODE BEGIN (do not modify!)
+ // --------------------
+
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlDataTable";
+
+ private static final boolean DEFAULT_PRESERVEDATAMODEL = false;
+
+ private static final boolean DEFAULT_PRESERVESORT = true;
+
+ private static final boolean DEFAULT_RENDEREDIFEMPTY = true;
+
+ private Boolean _preserveDataModel = null;
+
+ private Boolean _preserveSort = null;
+
+ private String _enabledOnUserRole = null;
+
+ private String _visibleOnUserRole = null;
+
+ private Boolean _renderedIfEmpty = null;
+
+ private String _rowIndexVar = null;
+
+ private String _rowCountVar = null;
+
+ private String _previousRowDataVar = null;
+
+ public HtmlDataTable()
+ {
+ }
+
+ public void setPreserveDataModel(boolean preserveDataModel)
+ {
+ _preserveDataModel = Boolean.valueOf(preserveDataModel);
+ }
+
+ public boolean isPreserveDataModel()
+ {
+ if (_preserveDataModel != null)
+ return _preserveDataModel.booleanValue();
+ ValueBinding vb = getValueBinding("preserveDataModel");
+ Boolean v = vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
+ return v != null ? v.booleanValue() : DEFAULT_PRESERVEDATAMODEL;
+ }
+
+ public void setPreserveSort(boolean preserveSort)
+ {
+ _preserveSort = Boolean.valueOf(preserveSort);
+ }
+
+ public boolean isPreserveSort()
+ {
+ if (_preserveSort != null)
+ return _preserveSort.booleanValue();
+ ValueBinding vb = getValueBinding("preserveSort");
+ Boolean v = vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
+ return v != null ? v.booleanValue() : DEFAULT_PRESERVESORT;
+ }
+
+ public void setEnabledOnUserRole(String enabledOnUserRole)
+ {
+ _enabledOnUserRole = enabledOnUserRole;
+ }
+
+ public String getEnabledOnUserRole()
+ {
+ if (_enabledOnUserRole != null)
+ return _enabledOnUserRole;
+ ValueBinding vb = getValueBinding("enabledOnUserRole");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setVisibleOnUserRole(String visibleOnUserRole)
+ {
+ _visibleOnUserRole = visibleOnUserRole;
+ }
+
+ public String getVisibleOnUserRole()
+ {
+ if (_visibleOnUserRole != null)
+ return _visibleOnUserRole;
+ ValueBinding vb = getValueBinding("visibleOnUserRole");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setRenderedIfEmpty(boolean renderedIfEmpty)
+ {
+ _renderedIfEmpty = Boolean.valueOf(renderedIfEmpty);
+ }
+
+ public boolean isRenderedIfEmpty()
+ {
+ if (_renderedIfEmpty != null)
+ return _renderedIfEmpty.booleanValue();
+ ValueBinding vb = getValueBinding("renderedIfEmpty");
+ Boolean v = vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
+ return v != null ? v.booleanValue() : DEFAULT_RENDEREDIFEMPTY;
+ }
+
+ public void setRowIndexVar(String rowIndexVar)
+ {
+ _rowIndexVar = rowIndexVar;
+ }
+
+ public String getRowIndexVar()
+ {
+ if (_rowIndexVar != null)
+ return _rowIndexVar;
+ ValueBinding vb = getValueBinding("rowIndexVar");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setRowCountVar(String rowCountVar)
+ {
+ _rowCountVar = rowCountVar;
+ }
+
+ public String getRowCountVar()
+ {
+ if (_rowCountVar != null)
+ return _rowCountVar;
+ ValueBinding vb = getValueBinding("rowCountVar");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ public void setPreviousRowDataVar(String previousRowDataVar)
+ {
+ _previousRowDataVar = previousRowDataVar;
+ }
+
+ public String getPreviousRowDataVar()
+ {
+ if (_previousRowDataVar != null)
+ return _previousRowDataVar;
+ ValueBinding vb = getValueBinding("previousRowDataVar");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
- //------------------ GENERATED CODE END ---------------------------------------
+ // ------------------ GENERATED CODE END
+ // ---------------------------------------
}
Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/renderkit/html/ext/HtmlTableRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/renderkit/html/ext/HtmlTableRenderer.java?rev=220118&r1=220117&r2=220118&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/renderkit/html/ext/HtmlTableRenderer.java (original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/renderkit/html/ext/HtmlTableRenderer.java Thu Jul 21 08:49:48 2005
@@ -30,28 +30,25 @@
// get event handlers from component
HtmlDataTable table = (HtmlDataTable) uiData;
- String rowOnMouseOver = table.getRowOnMouseOver();
- String rowOnMouseOut = table.getRowOnMouseOut();
- String rowOnClick = table.getRowOnClick();
- String rowOnDblClick = table.getRowOnDblClick();
+
+ renderRowAttribute(writer, HTML.ONCLICK_ATTR, table.getRowOnClick());
+ renderRowAttribute(writer, HTML.ONDBLCLICK_ATTR, table.getRowOnDblClick());
+ renderRowAttribute(writer, HTML.ONKEYDOWN_ATTR, table.getRowOnKeyDown());
+ renderRowAttribute(writer, HTML.ONKEYPRESS_ATTR, table.getRowOnKeyPress());
+ renderRowAttribute(writer, HTML.ONKEYUP_ATTR, table.getRowOnKeyUp());
+ renderRowAttribute(writer, HTML.ONMOUSEDOWN_ATTR, table.getRowOnMouseDown());
+ renderRowAttribute(writer, HTML.ONMOUSEMOVE_ATTR, table.getRowOnMouseMove());
+ renderRowAttribute(writer, HTML.ONMOUSEOUT_ATTR, table.getRowOnMouseOut());
+ renderRowAttribute(writer, HTML.ONMOUSEOVER_ATTR, table.getRowOnMouseOver());
+ renderRowAttribute(writer, HTML.ONMOUSEUP_ATTR, table.getRowOnMouseUp());
+ }
- // render onmouseover and onmouseout handlers if not null
- if (rowOnMouseOver != null)
- {
- writer.writeAttribute(HTML.ONMOUSEOVER_ATTR, rowOnMouseOver, null);
- }
- if (rowOnMouseOut != null)
- {
- writer.writeAttribute(HTML.ONMOUSEOUT_ATTR, rowOnMouseOut, null);
- }
- if (rowOnClick != null)
- {
- writer.writeAttribute(HTML.ONCLICK_ATTR, rowOnClick, null);
- }
- if (rowOnDblClick != null)
- {
- writer.writeAttribute(HTML.ONDBLCLICK_ATTR, rowOnDblClick, null);
- }
+ protected void renderRowAttribute(ResponseWriter writer, String htmlAttribute, Object value) throws IOException
+ {
+ if(value != null)
+ {
+ writer.writeAttribute(htmlAttribute, value, null);
+ }
}
/**
Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/taglib/html/ext/HtmlDataTableTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/taglib/html/ext/HtmlDataTableTag.java?rev=220118&r1=220117&r2=220118&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/taglib/html/ext/HtmlDataTableTag.java (original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/taglib/html/ext/HtmlDataTableTag.java Thu Jul 21 08:49:48 2005
@@ -50,11 +50,17 @@
private String _rowIndexVar;
private String _rowCountVar;
private String _previousRowDataVar;
- private String _rowOnMouseOver;
- private String _rowOnMouseOut;
private String _rowOnClick;
private String _rowOnDblClick;
-
+ private String _rowOnMouseDown;
+ private String _rowOnMouseUp;
+ private String _rowOnMouseOver;
+ private String _rowOnMouseMove;
+ private String _rowOnMouseOut;
+ private String _rowOnKeyPress;
+ private String _rowOnKeyDown;
+ private String _rowOnKeyUp;
+
public void release() {
super.release();
@@ -68,10 +74,16 @@
_rowIndexVar=null;
_rowCountVar=null;
_previousRowDataVar=null;
+ _rowOnClick=null;
+ _rowOnDblClick=null;
+ _rowOnMouseDown=null;
+ _rowOnMouseUp=null;
_rowOnMouseOver=null;
+ _rowOnMouseMove=null;
_rowOnMouseOut=null;
- _rowOnClick = null;
- _rowOnDblClick = null;
+ _rowOnKeyPress=null;
+ _rowOnKeyDown=null;
+ _rowOnKeyUp=null;
}
@@ -89,10 +101,16 @@
setStringProperty(component, "rowIndexVar", _rowIndexVar);
setStringProperty(component, "rowCountVar", _rowCountVar);
setStringProperty(component, "previousRowDataVar", _previousRowDataVar);
- setStringProperty(component, "rowOnMouseOver", _rowOnMouseOver);
- setStringProperty(component, "rowOnMouseOut", _rowOnMouseOut);
setStringProperty(component, "rowOnClick", _rowOnClick);
setStringProperty(component, "rowOnDblClick", _rowOnDblClick);
+ setStringProperty(component, "rowOnMouseDown", _rowOnMouseDown);
+ setStringProperty(component, "rowOnMouseUp", _rowOnMouseUp);
+ setStringProperty(component, "rowOnMouseOver", _rowOnMouseOver);
+ setStringProperty(component, "rowOnMouseMove", _rowOnMouseMove);
+ setStringProperty(component, "rowOnMouseOut", _rowOnMouseOut);
+ setStringProperty(component, "rowOnKeyPress", _rowOnKeyPress);
+ setStringProperty(component, "rowOnKeyDown", _rowOnKeyDown);
+ setStringProperty(component, "rowOnKeyUp", _rowOnKeyUp);
}
public void setPreserveDataModel(String preserveDataModel)
@@ -157,12 +175,41 @@
public void setRowOnClick(String rowOnClick)
{
- _rowOnClick = rowOnClick;
+ _rowOnClick = rowOnClick;
}
public void setRowOnDblClick(String rowOnDblClick)
{
- _rowOnDblClick = rowOnDblClick;
+ _rowOnDblClick = rowOnDblClick;
}
+ public void setRowOnKeyDown(String rowOnKeyDown)
+ {
+ _rowOnKeyDown = rowOnKeyDown;
+ }
+
+ public void setRowOnKeyPress(String rowOnKeyPress)
+ {
+ _rowOnKeyPress = rowOnKeyPress;
+ }
+
+ public void setRowOnKeyUp(String rowOnKeyUp)
+ {
+ _rowOnKeyUp = rowOnKeyUp;
+ }
+
+ public void setRowOnMouseDown(String rowOnMouseDown)
+ {
+ _rowOnMouseDown = rowOnMouseDown;
+ }
+
+ public void setRowOnMouseMove(String rowOnMouseMove)
+ {
+ _rowOnMouseMove = rowOnMouseMove;
+ }
+
+ public void setRowOnMouseUp(String rowOnMouseUp)
+ {
+ _rowOnMouseUp = rowOnMouseUp;
+ }
}
Modified: myfaces/tomahawk/trunk/tld/myfaces_ext.tld
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/tld/myfaces_ext.tld?rev=220118&r1=220117&r2=220118&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/tld/myfaces_ext.tld (original)
+++ myfaces/tomahawk/trunk/tld/myfaces_ext.tld Thu Jul 21 08:49:48 2005
@@ -208,6 +208,38 @@
</description>
</attribute>
<attribute>
+ <name>rowOnClick</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ Defines a JavaScript onclick event handler for each table row
+ </description>
+ </attribute>
+ <attribute>
+ <name>rowOnDblClick</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ Defines a JavaScript ondblclick event handler for each table row
+ </description>
+ </attribute>
+ <attribute>
+ <name>rowOnMouseDown</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ Defines a JavaScript onmpusedown event handler for each table row
+ </description>
+ </attribute>
+ <attribute>
+ <name>rowOnMouseUp</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ Defines a JavaScript onmouseup event handler for each table row
+ </description>
+ </attribute>
+ <attribute>
<name>rowOnMouseOver</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -216,6 +248,14 @@
</description>
</attribute>
<attribute>
+ <name>rowOnMouseMove</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ Defines a JavaScript onmousemove event handler for each table row
+ </description>
+ </attribute>
+ <attribute>
<name>rowOnMouseOut</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
@@ -224,16 +264,28 @@
</description>
</attribute>
<attribute>
- <name>rowOnClick</name>
+ <name>rowOnKeyPress</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
- <description>Defines a JavaScript onclick event handler for each table row</description>
+ <description>
+ Defines a JavaScript onkeypress event handler for each table row
+ </description>
</attribute>
<attribute>
- <name>rowOnDblClick</name>
+ <name>rowOnKeyDown</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
- <description>Defines a JavaScript ondblclick event handler for each table row</description>
+ <description>
+ Defines a JavaScript onkeydown event handler for each table row
+ </description>
+ </attribute>
+ <attribute>
+ <name>rowOnKeyUp</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <description>
+ Defines a JavaScript onkeyup event handler for each table row
+ </description>
</attribute>
</tag>