JBoss Rich Faces SVN: r9803 - trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable.
by richfaces-svn-commits@lists.jboss.org
Author: pkawiak
Date: 2008-07-28 08:39:57 -0400 (Mon, 28 Jul 2008)
New Revision: 9803
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTable.js
trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableHeader.js
Log:
Rendering images on ff3 bug
Modified: trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTable.js
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTable.js 2008-07-28 11:52:51 UTC (rev 9802)
+++ trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTable.js 2008-07-28 12:39:57 UTC (rev 9803)
@@ -346,10 +346,7 @@
cols[cols.length-1].width = null;
}
var newHeight = mainDivHeight - header.getHeight() - footerHeight - 2;
- var captions = this.table.getElement().getElementsByTagName('caption');
- if (captions.length > 0) {
- newHeight -= captions[0].offsetHeight;
- }
+ newHeight -= this.header.getCaptionHeight();
ClientUILib.log(ClientUILogger.INFO, "footerHeight: " + footerHeight);
scrollingDiv.setStyle('height:'+ newHeight +'px;');
for (var i=0; i<headerChildren.length-1; i++) {
Modified: trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableHeader.js
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableHeader.js 2008-07-28 11:52:51 UTC (rev 9802)
+++ trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableHeader.js 2008-07-28 12:39:57 UTC (rev 9803)
@@ -14,7 +14,7 @@
this.eventSepMouseMove = this.OnSepMouseMove.bindAsEventListener(this);
this.eventSepMouseUp = this.OnSepMouseUp.bindAsEventListener(this);
this.eventHeaderCellMouseOver = this.OnHeaderCellMouseOver.bindAsEventListener(this);
- this.eventHeaderCellMouseOut = this.OnHeaderCellMouseOut.bindAsEventListener(this);
+ this.eventHeaderCellMouseOut = this.OnHeaderCellMouseOut.bindAsEventListener(this);
var showMenuFct = this.extDt.options.showMenuFunction;
if (showMenuFct) {
@@ -30,7 +30,20 @@
var menuDiv = $(el.id+"header:menuDiv");
menuDiv.className = "extdt-menu-div-on";
},
+
+ getCaption: function() {
+ return this.caption;
+ },
+ getCaptionHeight: function() {
+ var caption = this.getCaption();
+ if (caption) {
+ return caption.getHeight();
+ }else{
+ return 0;
+ }
+ },
+
OnHeaderCellMouseOut: function(event) {
var el = this.extDt._findParentElement(event, "th");
var menuDiv = $(el.id+"header:menuDiv");
@@ -154,7 +167,7 @@
var headerChildChildren = headerChild.childElements();
var sepSpan = headerChildChildren[2];
var headerRowHeight = this.headerRow.getHeight();
- var headerRowY = this.headerRow.getY();
+ var headerRowY = this.getCaptionHeight();
sepSpan.columnIndex = i;
var sd = sepSpan.getWidth()/2 + 1;
var dropSpanLeft = headerChildChildren[3];
16 years, 5 months
JBoss Rich Faces SVN: r9802 - trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable.
by richfaces-svn-commits@lists.jboss.org
Author: pkawiak
Date: 2008-07-28 07:52:51 -0400 (Mon, 28 Jul 2008)
New Revision: 9802
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTable.js
trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableHeader.js
Log:
Hiding borders in ie6
Modified: trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTable.js
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTable.js 2008-07-28 11:21:37 UTC (rev 9801)
+++ trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTable.js 2008-07-28 11:52:51 UTC (rev 9802)
@@ -319,7 +319,7 @@
ClientUILib.log(ClientUILogger.INFO, "mainDivWidth: " + this.mainDiv.getWidth());
var scrollbarWidth = scrollingDiv.getElement().offsetWidth - scrollingDiv.getElement().clientWidth;
var maxAllowedWidth = this.mainDiv.getWidth() - scrollbarWidth;
- var excessWidth = this.header.getVisibleWidth() - maxAllowedWidth;
+ var excessWidth = this.header.getVisibleWidth() - maxAllowedWidth - 1;
ClientUILib.log(ClientUILogger.ALERT, "1");
if (excessWidth > 0) {
ClientUILib.log(ClientUILogger.INFO, "excessWidth: " + excessWidth);
Modified: trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableHeader.js
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableHeader.js 2008-07-28 11:21:37 UTC (rev 9801)
+++ trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableHeader.js 2008-07-28 11:52:51 UTC (rev 9802)
@@ -207,18 +207,12 @@
originalX: 0
};
var srcElement = this.dragColumnInfo.srcElement;
- if (ClientUILib.isOpera) {
- this.maxDelta = this.getColumnWidth(this.getColumnsNumber()-1);
- if (ClientUILib.isOpera) {
- this.maxDelt -= 1;
- };
- ClientUILib.log(ClientUILogger.INFO, "this.maxDelta: " + this.maxDelta);
- }else{
- this.maxDelta = this.getColumnWidth(this.getColumnsNumber()-1);
- ClientUILib.log(ClientUILogger.INFO, "this.maxDelta: " + this.maxDelta);
- this.maxDelta -= this.extDt.getScrollbarWidth();
- ClientUILib.log(ClientUILogger.INFO, "this.extDt.getScrollbarWidth() " + this.extDt.getScrollbarWidth());
- }
+ this.maxDelta = this.getColumnWidth(this.getColumnsNumber()-1);
+ this.maxDelta -= this.extDt.getScrollbarWidth();
+ if (ClientUILib.isOpera) {
+ this.maxDelt -= 1;
+ };
+ ClientUILib.log(ClientUILogger.INFO, "this.maxDelta: " + this.maxDelta);
this.minDelta = this.minColumnWidth - this.getColumnWidth(srcElement.columnIndex);
Event.observe(document, 'mousemove', this.eventSepMouseMove, true);
Event.observe(document, 'mouseup', this.eventSepMouseUp, true);
16 years, 5 months
JBoss Rich Faces SVN: r9801 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-07-28 07:21:37 -0400 (Mon, 28 Jul 2008)
New Revision: 9801
Modified:
trunk/docs/userguide/en/src/main/docbook/included/hotKey.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/hotKey.xml
Log:
https://jira.jboss.org/jira/browse/RF-3783 - Key Feature, JavaScript API example were added
Modified: trunk/docs/userguide/en/src/main/docbook/included/hotKey.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/hotKey.desc.xml 2008-07-28 09:57:18 UTC (rev 9800)
+++ trunk/docs/userguide/en/src/main/docbook/included/hotKey.desc.xml 2008-07-28 11:21:37 UTC (rev 9801)
@@ -18,6 +18,11 @@
<itemizedlist>
<listitem>
<para>
+ Includes all features of the <ulink url="http://code.google.com/p/js-hotkeys/">Javascript jQuery Hotkeys Plugin</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
Hot key registration by request through JavaScript API
</para>
</listitem>
Modified: trunk/docs/userguide/en/src/main/docbook/included/hotKey.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/hotKey.xml 2008-07-28 09:57:18 UTC (rev 9800)
+++ trunk/docs/userguide/en/src/main/docbook/included/hotKey.xml 2008-07-28 11:21:37 UTC (rev 9801)
@@ -69,7 +69,8 @@
<itemizedlist>
<listitem>
<para>
- by attaching it to the whole page (<property>html[0] element</property>). This is default scenario.
+ the easiest way is not to register it at all. In this case the <emphasis role="bold"><property><rich:hotKey></property></emphasis>
+ component is attached to the whole page (<property>html[0] element</property>). This is default scenario.
</para>
</listitem>
<listitem>
@@ -130,7 +131,7 @@
<itemizedlist>
<listitem>
<para>
- "immediate" - the component is rendered in browser immediately
+ "immediate" - the component is rendered in browser immediately (by default)
</para>
</listitem>
<listitem>
@@ -155,6 +156,24 @@
<para>
The <emphasis><property>"checkParent"</property></emphasis> attribute defines the hotkey handling of events generated by child components nested into the parent component to which the <emphasis role="bold"><property><rich:hotKey></property></emphasis> is attached.
</para>
+ <para>
+ The <emphasis role="bold"><property><rich:hotKey></property></emphasis> component also provides a number of JavaScript API functions. There is an example below.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:form id="myForm">
+ <rich:hotKey id="myKey" key="ctrl+g" handler="alert('Ctrl+G is pressed')" />
+ <button onclick="${rich:component('myKey')}.enable(); return false;">Turn Ctrl+G On</button>
+ <button onclick="${rich:component('myKey')}.disable(); return false;">Turn Ctrl+G Off</button>
+</h:form>
+...]]></programlisting>
+ <para>
+ In the example above the <property>Ctrl+G</property> is registered as a global hotkey,
+ so if you press this key combination the alert window with the <property>"Ctrl+G is pressed"</property> text appears. With the help
+ of <property>enable()</property>, <property>disable()</property> JavaScript API fucntions you could enable or disable registered hotkey.
+ </para>
</section>
<section>
<title>JavaScript API</title>
@@ -169,10 +188,12 @@
</thead>
<tbody>
<row>
- <entry>add(selector, key, handler)</entry>
<entry>
- Adds the hotkey(from key param) for elements targeted by selector. Assigns handler function to the key.
- </entry>
+ add(selector, key, handler)
+ </entry>
+ <entry>
+ Adds the hotkey(from key param) for elements targeted by selector. Assigns handler function to the key
+ </entry>
</row>
<row>
<entry>remove()</entry>
16 years, 5 months
JBoss Rich Faces SVN: r9800 - trunk/docs/migrationguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-07-28 05:57:18 -0400 (Mon, 28 Jul 2008)
New Revision: 9800
Modified:
trunk/docs/migrationguide/en/src/main/docbook/modules/req.xml
Log:
RF-3875 - ID of the chapter ("Minimum requirements for the project with RichFaces 3.2.0") is corrected
Modified: trunk/docs/migrationguide/en/src/main/docbook/modules/req.xml
===================================================================
--- trunk/docs/migrationguide/en/src/main/docbook/modules/req.xml 2008-07-28 09:34:56 UTC (rev 9799)
+++ trunk/docs/migrationguide/en/src/main/docbook/modules/req.xml 2008-07-28 09:57:18 UTC (rev 9800)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<chapter id="req" xreflabel="req">
- <?dbhtml filename="scope.html"?>
+ <?dbhtml filename="requirements.html"?>
<chapterinfo>
<keywordset>
<keyword>RichFaces</keyword>
16 years, 5 months
JBoss Rich Faces SVN: r9799 - trunk/sandbox/ui/extendedDataTable.
by richfaces-svn-commits@lists.jboss.org
Author: piotr.buda
Date: 2008-07-28 05:34:56 -0400 (Mon, 28 Jul 2008)
New Revision: 9799
Modified:
trunk/sandbox/ui/extendedDataTable/
Log:
svn ignore changes
Property changes on: trunk/sandbox/ui/extendedDataTable
___________________________________________________________________
Name: svn:ignore
- target
+ bin
target
.project
.settings
.classpath
16 years, 5 months
JBoss Rich Faces SVN: r9798 - trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: pkawiak
Date: 2008-07-28 04:54:22 -0400 (Mon, 28 Jul 2008)
New Revision: 9798
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
Log:
Hiding borders in ie6
Modified: trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-07-28 08:53:47 UTC (rev 9797)
+++ trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-07-28 08:54:22 UTC (rev 9798)
@@ -161,7 +161,7 @@
for (int i = 0; i < numberOfColumns; i++) {
writer.startElement("th", header);
encodeStyleClass(writer, null,
- "extdt-headercell rich-extdt-headercell",
+ "extdt-headercell extdt-fakeierow rich-extdt-headercell",
headerClass, null);
writer.endElement("th");
}
@@ -480,11 +480,12 @@
int numberOfColumns = getColumnsCount(table) + 1;
writer.startElement("tr", table);
+ encodeStyleClass(writer, null, "extdt-fakeierow ", null, null);
writer.writeAttribute(HTML.id_ATTRIBUTE, table.getBaseClientId(context)
+ ":body:fakeIeRow", null);
for (int i = 0; i < numberOfColumns; i++) {
writer.startElement("td", table);
- encodeStyleClass(writer, null, getCellSkinClass(), null, null);
+ encodeStyleClass(writer, null, "extdt-fakeierow " + getCellSkinClass(), null, null);
writer.endElement("td");
}
writer.endElement("tr");
16 years, 5 months
JBoss Rich Faces SVN: r9797 - in trunk/sandbox/ui/extendedDataTable/src/main: resources/org/richfaces/renderkit/html/css and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pkawiak
Date: 2008-07-28 04:53:47 -0400 (Mon, 28 Jul 2008)
New Revision: 9797
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTable.js
trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableSelection.js
trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/css/extendedDataTable.xcss
Log:
Hiding borders in ie6
Modified: trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTable.js
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTable.js 2008-07-28 07:26:32 UTC (rev 9796)
+++ trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTable.js 2008-07-28 08:53:47 UTC (rev 9797)
@@ -193,10 +193,10 @@
if (bValue) {
sVisibility = '';
- sBorderColor = '';
+ sBorderStyle = '';
}else{
sVisibility = 'none';
- sBorderColor = 'transparent';
+ sBorderStyle = 'none';
}
var size = group.size();
for (var i=0; i<size; i++) {
@@ -206,7 +206,7 @@
//which parents have been hidden :|
var cells = group[i].childNodes;
for (var j=0; j<cells.length; j++) {
- cells[j].style.borderColor = sBorderColor;
+ cells[j].style.borderStyle = sBorderStyle;
}
}
}
@@ -258,7 +258,11 @@
var i=1;
var endIndex = columns.length-1;
while ((i < endIndex) && (excessWidth > 0)) {
- var colWidth = this.getColumnWidth(i);
+ if (ClientUILib.isIE) {
+ var colWidth = parseInt(this.getColumns()[i].width) - 1;
+ }else{
+ var colWidth = this.getColumnWidth(i);
+ }
var spareWidth = colWidth - this.minColumnWidth;
var dW;
if (spareWidth >= excessWidth) {
Modified: trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableSelection.js
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableSelection.js 2008-07-28 07:26:32 UTC (rev 9796)
+++ trunk/sandbox/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableSelection.js 2008-07-28 08:53:47 UTC (rev 9797)
@@ -286,13 +286,12 @@
} else { //extended listener binding with grouping
var groupRow;
var lastGroupId = 0;
- var bGroupExpanded;
- if (!ClientUILib.isIE) {
- //make first fake row visible to ensure proper rendering
- bGroupExpanded = true;
- }else{
- bGroupExpanded = false;
- }
+ var bGroupExpanded = true;
+ var bHideFirstRow = false;
+ if (ClientUILib.isIE) {
+ //hide first fake ie row to ensure proper rendering
+ bHideFirstRow = true;
+ };
var groupId;
var groupItems = [];
var groupItem = 0;
@@ -322,14 +321,17 @@
this.addListener(nrows[i], rowIndex);
}
groupItems[groupItem++] = nrows[i];
+ if ( (i==0) && (bHideFirstRow) ) {
+
+ }
if (!bGroupExpanded) {
nrows[i].style.display = 'none';
- if (ClientUILib.isIE){
+ if ((ClientUILib.isIE) && (i!=0)){
//prevent IE from showing borders of cells
//which parents have been hidden :|
var cells = nrows[i].childNodes;
for (var j=0; j<cells.length; j++) {
- cells[j].style.borderColor = 'transparent';
+ cells[j].style.borderStyle = 'none';
}
}
}
Modified: trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/css/extendedDataTable.xcss
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/css/extendedDataTable.xcss 2008-07-28 07:26:32 UTC (rev 9796)
+++ trunk/sandbox/ui/extendedDataTable/src/main/resources/org/richfaces/renderkit/html/css/extendedDataTable.xcss 2008-07-28 08:53:47 UTC (rev 9797)
@@ -71,6 +71,10 @@
position: absolute;
width: 20px;
}
+
+ .extdt-fakeierow {
+
+ }
.extdt-menu-div-on {
height: 23px;
16 years, 5 months
JBoss Rich Faces SVN: r9796 - trunk/sandbox/ui/extendedDataTable.
by richfaces-svn-commits@lists.jboss.org
Author: pgolawski
Date: 2008-07-28 03:26:32 -0400 (Mon, 28 Jul 2008)
New Revision: 9796
Modified:
trunk/sandbox/ui/extendedDataTable/
Log:
added target to svn:ignore
Property changes on: trunk/sandbox/ui/extendedDataTable
___________________________________________________________________
Name: svn:ignore
- bin
target
.project
.settings
+ target
16 years, 5 months
JBoss Rich Faces SVN: r9795 - in trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces: renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pgolawski
Date: 2008-07-28 03:22:39 -0400 (Mon, 28 Jul 2008)
New Revision: 9795
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/component/UIExtendedDataTable.java
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/ExtendedTableHolder.java
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/RichTableMenuRenderer.java
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/SimpleTableMenuRenderer.java
Log:
do NOT reset data model before RENDER_RESPONSE phase
removed call column getColumnLabel method
Modified: trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/component/UIExtendedDataTable.java
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/component/UIExtendedDataTable.java 2008-07-28 07:16:15 UTC (rev 9794)
+++ trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/component/UIExtendedDataTable.java 2008-07-28 07:22:39 UTC (rev 9795)
@@ -17,11 +17,14 @@
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
+import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.event.AjaxEvent;
import org.ajax4jsf.model.ExtendedDataModel;
-import org.richfaces.event.ChangeColumnVisibilityEvent;
-import org.richfaces.event.ColumnResizeEvent;
-import org.richfaces.event.DragDropEvent;
+import org.richfaces.event.extdt.ChangeColumnVisibilityEvent;
+import org.richfaces.event.extdt.ColumnResizeEvent;
+import org.richfaces.event.extdt.DragDropEvent;
+import org.richfaces.event.extdt.ExtTableFilterEvent;
+import org.richfaces.event.extdt.ExtTableSortEvent;
import org.richfaces.model.ExtendedDataTableModifiableModel;
import org.richfaces.model.ExtendedTableDataModel;
import org.richfaces.model.FilterField;
@@ -33,251 +36,299 @@
*
*/
public abstract class UIExtendedDataTable extends UIDataTable implements
- Selectable {
-
- /**
- * COMPONENT_TYPE
- */
- public static final String COMPONENT_TYPE = "org.richfaces.ExtendedDataTable";
-
- /**
- * COMPONENT_FAMILY
- */
- public static final String COMPONENT_FAMILY = "org.richfaces.ExtendedDataTable";
+ Selectable {
- protected UIExtendedDataTableState state;
+ /**
+ * COMPONENT_TYPE
+ */
+ public static final String COMPONENT_TYPE = "org.richfaces.ExtendedDataTable";
- public abstract Object getActiveRowKey();
+ /**
+ * COMPONENT_FAMILY
+ */
+ public static final String COMPONENT_FAMILY = "org.richfaces.ExtendedDataTable";
- public abstract void setActiveRowKey(Object activeRowKey);
+ protected UIExtendedDataTableState state;
- public void broadcast(FacesEvent event) throws AbortProcessingException {
- super.broadcast(event);
- if (event instanceof DragDropEvent) {
- processDradDrop((DragDropEvent) event);
- } else if (event instanceof ChangeColumnVisibilityEvent) {
- processChangeColumnVisibility((ChangeColumnVisibilityEvent) event);
- } else if (event instanceof ColumnResizeEvent) {
- processColumnResize((ColumnResizeEvent) event);
- }
+ public abstract Object getActiveRowKey();
- }
+ public abstract void setActiveRowKey(Object activeRowKey);
- public void queueEvent(FacesEvent event) {
- if (event instanceof DragDropEvent) {
- new AjaxEvent(this).queue();
- event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
- // event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
- // new AjaxEvent(this).queue();
- } else if (event instanceof ChangeColumnVisibilityEvent) {
- new AjaxEvent(this).queue();
- event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
- } else if (event instanceof ColumnResizeEvent) {
- new AjaxEvent(this).queue();
- event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
- }
- super.queueEvent(event);
- }
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
+ super.broadcast(event);
+ if (event instanceof AjaxEvent) {
+ AjaxContext.getCurrentInstance().addComponentToAjaxRender(this);
+ } else if (event instanceof DragDropEvent) {
+ processDradDrop((DragDropEvent) event);
+ } else if (event instanceof ChangeColumnVisibilityEvent) {
+ processChangeColumnVisibility((ChangeColumnVisibilityEvent) event);
+ } else if (event instanceof ColumnResizeEvent) {
+ processColumnResize((ColumnResizeEvent) event);
+ } else if (event instanceof ExtTableSortEvent) {
+ processSortingChange((ExtTableSortEvent) event);
+ } else if (event instanceof ExtTableFilterEvent) {
+ processFilteringChange((ExtTableFilterEvent) event);
+ }
- public Iterator<UIColumn> getSortedColumns() {
- return new SortedColumnsIterator(this);
- }
+ }
- public Iterator<UIColumn> getChildColumns() {
- return new ExtendedTableColumnsIterator(this);
- }
+ public void queueEvent(FacesEvent event) {
+ if (event instanceof AjaxEvent) {
+ event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
+ } else if (event instanceof DragDropEvent) {
+ new AjaxEvent(this).queue();
+ event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
+ // event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
+ // new AjaxEvent(this).queue();
+ } else if (event instanceof ChangeColumnVisibilityEvent) {
+ new AjaxEvent(this).queue();
+ event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
+ } else if (event instanceof ColumnResizeEvent) {
+ // new AjaxEvent(this).queue();
+ event.setPhaseId(PhaseId.RENDER_RESPONSE);
+ } else if (event instanceof ExtTableSortEvent) {
+ new AjaxEvent(this).queue();
+ event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
+ } else if (event instanceof ExtTableFilterEvent) {
+ new AjaxEvent(this).queue();
+ event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
+ }
+ super.queueEvent(event);
+ }
- public void processDradDrop(DragDropEvent event) {
- String dragValue = event.getDragValue().toString();// dnd_drag_script
- String dropValue = event.getDropValue().toString();// dnd_drop_script
+ public Iterator<UIColumn> getSortedColumns() {
+ return new SortedColumnsIterator(this);
+ }
- ensureTableStateInitialized();
- state.changeColumnsOrder(dragValue, dropValue, event.isDropBefore());
- state.publishChanges(getFacesContext(), this);
+ public Iterator<UIColumn> getChildColumns() {
+ return new ExtendedTableColumnsIterator(this);
+ }
- getFacesContext().renderResponse();
- }
+ public void processDradDrop(DragDropEvent event) {
+ String dragValue = event.getDragValue().toString();// dnd_drag_script
+ String dropValue = event.getDropValue().toString();// dnd_drop_script
- public List<UIComponent> getSortedChildren() {
- ensureTableStateInitialized();
- return state.sortColumns(getFacesContext(), super.getChildren());
- }
+ ensureTableStateInitialized();
+ state.changeColumnsOrder(dragValue, dropValue, event.isDropBefore());
+ state.publishChanges(getFacesContext(), this);
- public void ensureTableStateInitialized() {
- if (state == null) {
- state = UIExtendedDataTableState.getUIExtendedDataTableState(this);
- }
- }
+ getFacesContext().renderResponse();
+ }
- public void processChangeColumnVisibility(ChangeColumnVisibilityEvent event) {
- ensureTableStateInitialized();
- state.toggleColumnVisibility(this, event.getColumnId());
- state.publishChanges(getFacesContext(), this);
+ public List<UIComponent> getSortedChildren() {
+ ensureTableStateInitialized();
+ return state.sortColumns(getFacesContext(), super.getChildren());
+ }
- getFacesContext().renderResponse();
- }// processChangeColumnVisibility
+ public void ensureTableStateInitialized() {
+ if (state == null) {
+ state = UIExtendedDataTableState.getUIExtendedDataTableState(this);
+ }
+ }
- public boolean isColumnVisible(UIComponent column) {
- ensureTableStateInitialized();
- return state.isColumnVisible(column.getId());
- }// isColumnVisible
+ public void processChangeColumnVisibility(ChangeColumnVisibilityEvent event) {
+ ensureTableStateInitialized();
+ state.toggleColumnVisibility(this, event.getColumnId());
+ state.publishChanges(getFacesContext(), this);
- public void processColumnResize(ColumnResizeEvent event) {
- ensureTableStateInitialized();
- state.changeColumnSize(this, event.getColumnWidths());
- state.publishChanges(getFacesContext(), this);
+ getFacesContext().renderResponse();
+ }// processChangeColumnVisibility
- getFacesContext().renderResponse();
- }// processChangeColumnVisibility
+ public void processSortingChange(ExtTableSortEvent event) {
+ resetModel();
+ getFacesContext().renderResponse();
+ }
- public String getColumnSize(UIComponent column) {
- ensureTableStateInitialized();
- return state.getColumnSize(column);
- }
+ public void processFilteringChange(ExtTableFilterEvent event) {
+ resetModel();
+ resetGroupVisibilityState();
+ getFacesContext().renderResponse();
+ }
- public boolean isGroupingOn() {
- ensureTableStateInitialized();
- return state.isGroupingOn();
- }
+ public boolean isColumnVisible(UIComponent column) {
+ ensureTableStateInitialized();
+ return state.isColumnVisible(column.getId());
+ }// isColumnVisible
- public String getGroupingColumnId() {
- ensureTableStateInitialized();
- return state.getGroupingColumnId();
- }
+ public void processColumnResize(ColumnResizeEvent event) {
+ ensureTableStateInitialized();
+ state.changeColumnSize(this, event.getColumnWidths());
+ state.publishChanges(getFacesContext(), this);
- public UIColumn getGroupingColumn() {
- String groupingColumnId = getGroupingColumnId();
- if (groupingColumnId == null)
- return null;
- for (Iterator<UIColumn> columns = getChildColumns(); columns.hasNext();) {
- UIColumn child = columns.next();
- if (groupingColumnId.equalsIgnoreCase(child.getId())) {
- return child;
- }
- }
- return null;
- }// getGroupingColumn
+ getFacesContext().renderResponse();
+ }// processChangeColumnVisibility
- public void setGroupingColumn(org.richfaces.component.UIColumn column) {
- ensureTableStateInitialized();
- if (column == null) {
- state.disableGrouping();
- } else {
- state.groupBy(column.getId(), column.getSortOrder());
- }
- state.publishChanges(getFacesContext(), this);
- }
+ public String getColumnSize(UIComponent column) {
+ ensureTableStateInitialized();
+ return state.getColumnSize(column);
+ }
- public void resetGroupVisibilityState() {
- ensureTableStateInitialized();
- state.resetGroupVisibilityState();
- }
+ public boolean isGroupingOn() {
+ ensureTableStateInitialized();
+ return state.isGroupingOn();
+ }
- public void disableGrouping() {
- ensureTableStateInitialized();
- state.disableGrouping();
- state.publishChanges(getFacesContext(), this);
- }
+ public String getGroupingColumnId() {
+ ensureTableStateInitialized();
+ return state.getGroupingColumnId();
+ }
- public boolean groupIsExpanded(int index) {
- ensureTableStateInitialized();
- return state.groupIsExpanded(index);
- }
+ public UIColumn getGroupingColumn() {
+ String groupingColumnId = getGroupingColumnId();
+ if (groupingColumnId == null)
+ return null;
+ for (Iterator<UIColumn> columns = getChildColumns(); columns.hasNext();) {
+ UIColumn child = columns.next();
+ if (groupingColumnId.equalsIgnoreCase(child.getId())) {
+ return child;
+ }
+ }
+ return null;
+ }// getGroupingColumn
- public void toggleGroup(int index) {
- ensureTableStateInitialized();
- state.toggleGroup(index);
- state.publishChanges(getFacesContext(), this);
- }
+ public void setGroupingColumn(org.richfaces.component.UIColumn column) {
+ ensureTableStateInitialized();
+ if (column == null) {
+ state.disableGrouping();
+ } else {
+ state.groupBy(column.getId(), column.getSortOrder());
+ }
+ state.publishChanges(getFacesContext(), this);
+ }
- public Collection<Object> getSortPriority() {
- Collection<Object> priority = super.getSortPriority();
- if (isGroupingOn()) {// grouping is on
- String groupColId = getGroupingColumnId();
- // try to add group column id as first
- if (priority.contains(groupColId)) {
- priority.remove(groupColId);
- }
- if (priority instanceof List) {
- ((List<Object>) priority).add(0, groupColId);
- } else {
- priority.add(groupColId);
- }
- }
- return priority;
- }
+ protected void resetGroupVisibilityState() {
+ ensureTableStateInitialized();
+ state.resetGroupVisibilityState();
+ }
- public Object saveState(FacesContext context) {
- Object values[] = new Object[2];
- values[0] = super.saveState(context);
- values[1] = state;
- return values;
- }
+ public void disableGrouping() {
+ ensureTableStateInitialized();
+ state.disableGrouping();
+ state.publishChanges(getFacesContext(), this);
+ }
- public void restoreState(FacesContext context, Object state) {
- Object values[] = (Object[]) state;
- super.restoreState(context, values[0]);
- this.state = (UIExtendedDataTableState) values[1];
- }
+ public boolean groupIsExpanded(int index) {
+ ensureTableStateInitialized();
+ return state.groupIsExpanded(index);
+ }
- public int getVisibleColumnsCount() {
- int count = 0;
- for (Iterator<UIColumn> iter = getChildColumns(); iter.hasNext();) {
- UIColumn column = iter.next();
- if (column.isRendered())
- count++;
- }// for
- return count;
- }// getVisibleColumnnCount
+ public void toggleGroup(int index) {
+ ensureTableStateInitialized();
+ state.toggleGroup(index);
+ state.publishChanges(getFacesContext(), this);
+ }
- @SuppressWarnings("unchecked")
- protected ExtendedDataModel createDataModel() {
- List<FilterField> filterFields = new LinkedList<FilterField>();
- Map<String, SortField2> sortFieldsMap = new LinkedHashMap<String, SortField2>();
- List<UIComponent> list = getChildren();
- for (Iterator<UIComponent> iterator = list.iterator(); iterator
- .hasNext();) {
- UIComponent component = iterator.next();
- if (component instanceof org.richfaces.component.UIColumn) {
- org.richfaces.component.UIColumn column = (org.richfaces.component.UIColumn) component;
- FilterField filterField = column.getFilterField();
- if (filterField != null) {
- filterFields.add(filterField);
- }
- SortField2 sortField = column.getSortField();
- if (sortField != null) {
- sortFieldsMap.put(component.getId(), sortField);
- }
- }
+ public Collection<Object> getSortPriority() {
+ Collection<Object> priority = super.getSortPriority();
+ if (isGroupingOn()) {// grouping is on
+ String groupColId = getGroupingColumnId();
+ // try to add group column id as first
+ if (priority.contains(groupColId)) {
+ priority.remove(groupColId);
+ }
+ if (priority instanceof List) {
+ ((List<Object>) priority).add(0, groupColId);
+ } else {
+ priority.add(groupColId);
+ }
+ }
+ return priority;
+ }
- }
- List<SortField2> sortFields = new LinkedList<SortField2>();
- Collection<Object> sortPriority = getSortPriority();
- if (sortPriority != null) {
- for (Object object : sortPriority) {
- if (object instanceof String) {
- String id = (String) object;
- SortField2 sortField = sortFieldsMap.get(id);
- if (sortField != null) {
- sortFields.add(sortField);
- sortFieldsMap.remove(id);
- }
- }
- }
- }
- sortFields.addAll(sortFieldsMap.values());
- setFilterFields(filterFields);
- setSortFields(sortFields);
- ExtendedDataModel dataModel = (ExtendedDataModel) super.getDataModel();
- if (dataModel instanceof ExtendedTableDataModel<?>) {
- ExtendedTableDataModel<?> tableDataModel = (ExtendedTableDataModel<?>) dataModel;
- return new ExtendedDataTableModifiableModel(tableDataModel, getVar(),
- getFilterFields(), getSortFields());
- } else {
- ModifiableModel modifiableModel = new ModifiableModel(dataModel, getVar());
- modifiableModel.modify(getFilterFields(), getSortFields());
-
- return modifiableModel;
- }
- }
+ public Object saveState(FacesContext context) {
+ Object values[] = new Object[2];
+ values[0] = super.saveState(context);
+ values[1] = state;
+ return values;
+ }
+
+ public void restoreState(FacesContext context, Object state) {
+ Object values[] = (Object[]) state;
+ super.restoreState(context, values[0]);
+ this.state = (UIExtendedDataTableState) values[1];
+ }
+
+ public int getVisibleColumnsCount() {
+ int count = 0;
+ for (Iterator<UIColumn> iter = getChildColumns(); iter.hasNext();) {
+ UIColumn column = iter.next();
+ if (column.isRendered())
+ count++;
+ }// for
+ return count;
+ }// getVisibleColumnnCount
+
+ // @Override
+ @SuppressWarnings("unchecked")
+ protected ExtendedDataModel createDataModel() {
+ List<FilterField> filterFields = new LinkedList<FilterField>();
+ Map<String, SortField2> sortFieldsMap = new LinkedHashMap<String, SortField2>();
+ List<UIComponent> list = getChildren();
+ for (Iterator<UIComponent> iterator = list.iterator(); iterator
+ .hasNext();) {
+ UIComponent component = iterator.next();
+ if (component instanceof org.richfaces.component.UIColumn) {
+ org.richfaces.component.UIColumn column = (org.richfaces.component.UIColumn) component;
+ FilterField filterField = column.getFilterField();
+ if (filterField != null) {
+ filterFields.add(filterField);
+ }
+ SortField2 sortField = column.getSortField();
+ if (sortField != null) {
+ sortFieldsMap.put(component.getId(), sortField);
+ }
+ }
+
+ }
+ List<SortField2> sortFields = new LinkedList<SortField2>();
+ Collection<Object> sortPriority = getSortPriority();
+ if (sortPriority != null) {
+ for (Object object : sortPriority) {
+ if (object instanceof String) {
+ String id = (String) object;
+ SortField2 sortField = sortFieldsMap.get(id);
+ if (sortField != null) {
+ sortFields.add(sortField);
+ sortFieldsMap.remove(id);
+ }
+ }
+ }
+ }
+ sortFields.addAll(sortFieldsMap.values());
+ setFilterFields(filterFields);
+ setSortFields(sortFields);
+ ExtendedDataModel dataModel = (ExtendedDataModel) super.getDataModel();
+ if (dataModel instanceof ExtendedTableDataModel<?>) {
+ ExtendedTableDataModel<?> tableDataModel = (ExtendedTableDataModel<?>) dataModel;
+ return new ExtendedDataTableModifiableModel(tableDataModel,
+ getVar(), getFilterFields(), getSortFields());
+ } else {
+ ModifiableModel modifiableModel = new ModifiableModel(dataModel,
+ getVar());
+ modifiableModel.modify(getFilterFields(), getSortFields());
+
+ return modifiableModel;
+ }
+ }
+
+ /**
+ * Original version of this method is defined in
+ * {@link org.ajax4jsf.component.UIDataAdaptor} and is called before
+ * RENDER_RESPONSE phase. In that version data model is reseted which causes
+ * need to sort and filter every time component is rendered. In this
+ */
+ // @Override
+ protected void resetDataModel() {
+ // Do nothing!
+ }
+
+ /**
+ * Method resets data model by calling
+ * {@link org.ajax4jsf.component.UIDataAdaptor#resetDataModel()}. This
+ * method is called on sort and filter action.
+ */
+ protected void resetModel() {
+ super.resetDataModel();
+ }
+
}
Modified: trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-07-28 07:16:15 UTC (rev 9794)
+++ trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-07-28 07:22:39 UTC (rev 9795)
@@ -50,9 +50,11 @@
import org.richfaces.component.UIDataTable;
import org.richfaces.component.UIExtendedDataTable;
import org.richfaces.component.nsutils.NSUtils;
-import org.richfaces.event.ChangeColumnVisibilityEvent;
-import org.richfaces.event.ColumnResizeEvent;
-import org.richfaces.event.DragDropEvent;
+import org.richfaces.event.extdt.ChangeColumnVisibilityEvent;
+import org.richfaces.event.extdt.ColumnResizeEvent;
+import org.richfaces.event.extdt.DragDropEvent;
+import org.richfaces.event.extdt.ExtTableFilterEvent;
+import org.richfaces.event.extdt.ExtTableSortEvent;
import org.richfaces.model.Ordering;
import org.richfaces.model.SortField2;
import org.richfaces.model.impl.expressive.JavaBeanWrapper;
@@ -1056,6 +1058,9 @@
if (SORT_FILTER_PARAMETER.equals(map.get(clientId))) {
String sortColumnId = map.get(SORT_FILTER_PARAMETER);
boolean isSingleSortMode = !"multi".equals(table.getSortMode());
+
+ boolean sorting = false;
+ boolean filtering = false;
boolean isGroupingOn = table.isGroupingOn();
boolean sortByGroupingColumn = false;
@@ -1075,6 +1080,7 @@
column.setId(id);
if (sortColumnId != null) {
+ sorting = true;
boolean isGroupingColumn = (isGroupingOn && column
.equals(groupingColumn));
if (sortColumnId.equals(column.getClientId(context))) {
@@ -1139,16 +1145,21 @@
}
boolean filterChanged = (newFilterValue == null ? (oldFilterValue != null)
: !newFilterValue.equals(oldFilterValue));
- if (filterChanged) {
- table.resetGroupVisibilityState();
- }
+ //if (filterChanged) {
+ // table.resetGroupVisibilityState();
+ //}
+ filtering = (filtering || filterChanged);
}
}
- AjaxContext.getCurrentInstance().addComponentToAjaxRender(
- component);
- // AjaxContext.getCurrentInstance().addRenderedArea(clientId +
- // ":tu");
+ // AjaxContext.getCurrentInstance().addComponentToAjaxRender(component);
+ if (sorting){
+ new ExtTableSortEvent(component).queue();
+ }
+ if (filtering){
+ new ExtTableFilterEvent(component).queue();
+ }
+
}
// GROUP COLUMNS
@@ -1180,10 +1191,10 @@
}// for columns
}// if
- AjaxContext.getCurrentInstance().addComponentToAjaxRender(
- component);
+ // AjaxContext.getCurrentInstance().addComponentToAjaxRender(component);
// AjaxContext.getCurrentInstance().addRenderedArea(clientId +
// ":tu");
+ new ExtTableSortEvent(component).queue();
}// group columns
// CHANGE COLUMN ORDER - DRAG AND DROP
@@ -1213,8 +1224,7 @@
dragDropEvent.queue();
- AjaxContext.getCurrentInstance().addComponentToAjaxRender(
- component);
+ // AjaxContext.getCurrentInstance().addComponentToAjaxRender(component);
// AjaxContext ajaxContext =
// AjaxContext.getCurrentInstance();
// ajaxContext.addComponentToAjaxRender(component);
@@ -1234,8 +1244,7 @@
event.queue();
- AjaxContext.getCurrentInstance().addComponentToAjaxRender(
- component);
+ // AjaxContext.getCurrentInstance().addComponentToAjaxRender(component);
// AjaxContext ajaxContext = AjaxContext.getCurrentInstance();
// ajaxContext.addComponentToAjaxRender(component);
// ajaxContext.addRenderedArea(clientId + ":tb");// body
@@ -1266,6 +1275,11 @@
}
}
+ public void encodeBegin(FacesContext context, UIComponent component)throws IOException {
+ super.encodeBegin(context, component);
+ //component.getAttributes().put(AjaxRendererUtils.AJAX_SINGLE_ATTR, Boolean.TRUE);
+ }
+
public void encodeEnd(FacesContext context, UIComponent component)
throws IOException {
super.encodeEnd(context, component);
@@ -1546,7 +1560,7 @@
String dragSourceId = tableId + "_hdrag_" + dataColumn.getId();
String indicatorId = tableId + ":dataTable_indicator";
renderDragSupport(context, dataColumn, dragSourceId,
- indicatorId, dataColumn.getColumnLabel());
+ indicatorId, (String)dataColumn.getAttributes().get("label"));
// separator area
writer.startElement(HTML.SPAN_ELEM, column);
@@ -1686,6 +1700,8 @@
public void encodeTableMenu(FacesContext context, UIExtendedDataTable table)
throws IOException {
AjaxContext ajaxContext = AjaxContext.getCurrentInstance();
+ Object key = table.getRowKey();
+ table.setRowKey(null);
TableMenuRenderer menuRenderer = new RichTableMenuRenderer();
menuRenderer.setSortFunction(getSortFunction(context, table));
menuRenderer.setGroupFunction(getGroupFunction(context, table));
@@ -1705,6 +1721,7 @@
// }
}
}// for
+ table.setRowKey(key);
}
public void contributorsEncodeHere(FacesContext context, UIDataTable table)
Modified: trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/ExtendedTableHolder.java
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/ExtendedTableHolder.java 2008-07-28 07:16:15 UTC (rev 9794)
+++ trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/ExtendedTableHolder.java 2008-07-28 07:22:39 UTC (rev 9795)
@@ -37,7 +37,7 @@
if (groupingOn){
groupingColumn = table.getGroupingColumn();
if ((groupingColumn != null) && (groupingColumn instanceof UIColumn)){
- groupingColumnLabel = ((UIColumn)groupingColumn).getColumnLabel();
+ groupingColumnLabel = (String)groupingColumn.getAttributes().get("label");;
}
}
}
Modified: trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/RichTableMenuRenderer.java
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/RichTableMenuRenderer.java 2008-07-28 07:16:15 UTC (rev 9794)
+++ trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/RichTableMenuRenderer.java 2008-07-28 07:22:39 UTC (rev 9795)
@@ -352,7 +352,8 @@
dataColumn.getId());
}
}// if
- menuItem.setValue(dataColumn.getColumnLabel());
+ String label = (String)dataColumn.getAttributes().get("label");
+ menuItem.setValue(label == null ? "" : label);
menuItem.setIcon(columnVisible ? iconCheckedURI : iconUncheckedURI);
if (menuItem instanceof HtmlMenuItem) {
((HtmlMenuItem) menuItem)
Modified: trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/SimpleTableMenuRenderer.java
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/SimpleTableMenuRenderer.java 2008-07-28 07:16:15 UTC (rev 9794)
+++ trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/SimpleTableMenuRenderer.java 2008-07-28 07:22:39 UTC (rev 9795)
@@ -119,7 +119,8 @@
"/org/richfaces/renderkit/html/images/s.gif").getUri(
context, null), null);
writer.endElement(HTML.IMG_ELEMENT);
- writer.writeText(dataColumn.getColumnLabel(), null);
+ String label = (String)dataColumn.getAttributes().get("label");
+ writer.writeText(label == null ? "" : label, null);
writer.endElement(HTML.a_ELEMENT);
writer.endElement("li");
}
16 years, 5 months
JBoss Rich Faces SVN: r9794 - in trunk/sandbox/api/src/main/java/org/richfaces/event: extdt and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pgolawski
Date: 2008-07-28 03:16:15 -0400 (Mon, 28 Jul 2008)
New Revision: 9794
Added:
trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/
trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityEvent.java
trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityListener.java
trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ColumnResizeEvent.java
trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ColumnResizeListener.java
trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/DragDropEvent.java
trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/DragDropListener.java
trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterEvent.java
trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterListener.java
trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ExtTableSortEvent.java
trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ExtTableSortListener.java
Removed:
trunk/sandbox/api/src/main/java/org/richfaces/event/ChangeColumnVisibilityEvent.java
trunk/sandbox/api/src/main/java/org/richfaces/event/ChangeColumnVisibilityListener.java
trunk/sandbox/api/src/main/java/org/richfaces/event/ColumnResizeEvent.java
trunk/sandbox/api/src/main/java/org/richfaces/event/ColumnResizeListener.java
trunk/sandbox/api/src/main/java/org/richfaces/event/DragDropEvent.java
trunk/sandbox/api/src/main/java/org/richfaces/event/DragDropListener.java
Log:
added events for sort and filter
package refactoring
Deleted: trunk/sandbox/api/src/main/java/org/richfaces/event/ChangeColumnVisibilityEvent.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/event/ChangeColumnVisibilityEvent.java 2008-07-28 07:05:25 UTC (rev 9793)
+++ trunk/sandbox/api/src/main/java/org/richfaces/event/ChangeColumnVisibilityEvent.java 2008-07-28 07:16:15 UTC (rev 9794)
@@ -1,47 +0,0 @@
-/**
- *
- */
-package org.richfaces.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * @author pawelgo
- *
- */
-public class ChangeColumnVisibilityEvent extends FacesEvent {
-
- private static final long serialVersionUID = 178097339066092532L;
-
- private String columnId;
-
- public ChangeColumnVisibilityEvent(UIComponent component, String columnId) {
- super(component);
- this.columnId = columnId;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
- */
- public boolean isAppropriateListener(FacesListener listener) {
- return (listener instanceof ChangeColumnVisibilityListener);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
- */
- public void processListener(FacesListener listener) {
- ((ChangeColumnVisibilityListener)listener).processChangeVisibility(this);
- }
-
- public String getColumnId() {
- return columnId;
- }
-
- public void setColumnId(String columnId) {
- this.columnId = columnId;
- }
-
-}
Deleted: trunk/sandbox/api/src/main/java/org/richfaces/event/ChangeColumnVisibilityListener.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/event/ChangeColumnVisibilityListener.java 2008-07-28 07:05:25 UTC (rev 9793)
+++ trunk/sandbox/api/src/main/java/org/richfaces/event/ChangeColumnVisibilityListener.java 2008-07-28 07:16:15 UTC (rev 9794)
@@ -1,15 +0,0 @@
-/**
- *
- */
-package org.richfaces.event;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author pawelgo
- *
- */
-public interface ChangeColumnVisibilityListener extends FacesListener {
-
- public void processChangeVisibility(ChangeColumnVisibilityEvent event);
-}
Deleted: trunk/sandbox/api/src/main/java/org/richfaces/event/ColumnResizeEvent.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/event/ColumnResizeEvent.java 2008-07-28 07:05:25 UTC (rev 9793)
+++ trunk/sandbox/api/src/main/java/org/richfaces/event/ColumnResizeEvent.java 2008-07-28 07:16:15 UTC (rev 9794)
@@ -1,47 +0,0 @@
-/**
- *
- */
-package org.richfaces.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * @author pawelgo
- *
- */
-public class ColumnResizeEvent extends FacesEvent {
-
- private static final long serialVersionUID = -8424890931071484456L;
-
- private String columnWidths;
-
- public ColumnResizeEvent(UIComponent component, String columnWidths) {
- super(component);
- this.columnWidths = columnWidths;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
- */
- public boolean isAppropriateListener(FacesListener listener) {
- return (listener instanceof ColumnResizeListener);
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
- */
- public void processListener(FacesListener listener) {
- ((ColumnResizeListener)listener).processColumnResize(this);
- }
-
- public String getColumnWidths() {
- return columnWidths;
- }
-
- public void setColumnWidths(String columnWidths) {
- this.columnWidths = columnWidths;
- }
-
-}
Deleted: trunk/sandbox/api/src/main/java/org/richfaces/event/ColumnResizeListener.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/event/ColumnResizeListener.java 2008-07-28 07:05:25 UTC (rev 9793)
+++ trunk/sandbox/api/src/main/java/org/richfaces/event/ColumnResizeListener.java 2008-07-28 07:16:15 UTC (rev 9794)
@@ -1,15 +0,0 @@
-/**
- *
- */
-package org.richfaces.event;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author pawelgo
- *
- */
-public interface ColumnResizeListener extends FacesListener {
-
- public void processColumnResize(ColumnResizeEvent event);
-}
Deleted: trunk/sandbox/api/src/main/java/org/richfaces/event/DragDropEvent.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/event/DragDropEvent.java 2008-07-28 07:05:25 UTC (rev 9793)
+++ trunk/sandbox/api/src/main/java/org/richfaces/event/DragDropEvent.java 2008-07-28 07:16:15 UTC (rev 9794)
@@ -1,67 +0,0 @@
-/**
- *
- */
-package org.richfaces.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * @author pawelgo
- *
- */
-public class DragDropEvent extends FacesEvent {
-
- private static final long serialVersionUID = 2589493255876683993L;
-
- private Object dragValue;
- private Object dropValue;
- private String dragType;
- private boolean dropBefore;
-
- public DragDropEvent(UIComponent component) {
- super(component);
- }
-
- public void processListener(FacesListener listener) {
- ((DragDropListener)listener).processDragDrop(this);
- }
-
- public Object getDragValue() {
- return dragValue;
- }
-
- public void setDragValue(Object dragValue) {
- this.dragValue = dragValue;
- }
-
- public Object getDropValue() {
- return dropValue;
- }
-
- public void setDropValue(Object dropValue) {
- this.dropValue = dropValue;
- }
-
- public String getDragType() {
- return dragType;
- }
-
- public void setDragType(String dragType) {
- this.dragType = dragType;
- }
-
- public boolean isDropBefore() {
- return dropBefore;
- }
-
- public void setDropBefore(boolean dropBefore) {
- this.dropBefore = dropBefore;
- }
-
- public boolean isAppropriateListener(FacesListener listener) {
- return (listener instanceof DragDropListener);
- }
-
-}
Deleted: trunk/sandbox/api/src/main/java/org/richfaces/event/DragDropListener.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/event/DragDropListener.java 2008-07-28 07:05:25 UTC (rev 9793)
+++ trunk/sandbox/api/src/main/java/org/richfaces/event/DragDropListener.java 2008-07-28 07:16:15 UTC (rev 9794)
@@ -1,15 +0,0 @@
-/**
- *
- */
-package org.richfaces.event;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author pawelgo
- *
- */
-public interface DragDropListener extends FacesListener {
-
- public void processDragDrop(DragDropEvent event);
-}
Added: trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityEvent.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityEvent.java (rev 0)
+++ trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityEvent.java 2008-07-28 07:16:15 UTC (rev 9794)
@@ -0,0 +1,47 @@
+/**
+ *
+ */
+package org.richfaces.event.extdt;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public class ChangeColumnVisibilityEvent extends FacesEvent {
+
+ private static final long serialVersionUID = 178097339066092532L;
+
+ private String columnId;
+
+ public ChangeColumnVisibilityEvent(UIComponent component, String columnId) {
+ super(component);
+ this.columnId = columnId;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
+ public boolean isAppropriateListener(FacesListener listener) {
+ return (listener instanceof ChangeColumnVisibilityListener);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
+ public void processListener(FacesListener listener) {
+ ((ChangeColumnVisibilityListener)listener).processChangeVisibility(this);
+ }
+
+ public String getColumnId() {
+ return columnId;
+ }
+
+ public void setColumnId(String columnId) {
+ this.columnId = columnId;
+ }
+
+}
Added: trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityListener.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityListener.java (rev 0)
+++ trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ChangeColumnVisibilityListener.java 2008-07-28 07:16:15 UTC (rev 9794)
@@ -0,0 +1,15 @@
+/**
+ *
+ */
+package org.richfaces.event.extdt;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public interface ChangeColumnVisibilityListener extends FacesListener {
+
+ public void processChangeVisibility(ChangeColumnVisibilityEvent event);
+}
Added: trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ColumnResizeEvent.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ColumnResizeEvent.java (rev 0)
+++ trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ColumnResizeEvent.java 2008-07-28 07:16:15 UTC (rev 9794)
@@ -0,0 +1,47 @@
+/**
+ *
+ */
+package org.richfaces.event.extdt;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public class ColumnResizeEvent extends FacesEvent {
+
+ private static final long serialVersionUID = -8424890931071484456L;
+
+ private String columnWidths;
+
+ public ColumnResizeEvent(UIComponent component, String columnWidths) {
+ super(component);
+ this.columnWidths = columnWidths;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
+ public boolean isAppropriateListener(FacesListener listener) {
+ return (listener instanceof ColumnResizeListener);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
+ public void processListener(FacesListener listener) {
+ ((ColumnResizeListener)listener).processColumnResize(this);
+ }
+
+ public String getColumnWidths() {
+ return columnWidths;
+ }
+
+ public void setColumnWidths(String columnWidths) {
+ this.columnWidths = columnWidths;
+ }
+
+}
Added: trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ColumnResizeListener.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ColumnResizeListener.java (rev 0)
+++ trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ColumnResizeListener.java 2008-07-28 07:16:15 UTC (rev 9794)
@@ -0,0 +1,15 @@
+/**
+ *
+ */
+package org.richfaces.event.extdt;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public interface ColumnResizeListener extends FacesListener {
+
+ public void processColumnResize(ColumnResizeEvent event);
+}
Added: trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/DragDropEvent.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/DragDropEvent.java (rev 0)
+++ trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/DragDropEvent.java 2008-07-28 07:16:15 UTC (rev 9794)
@@ -0,0 +1,67 @@
+/**
+ *
+ */
+package org.richfaces.event.extdt;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public class DragDropEvent extends FacesEvent {
+
+ private static final long serialVersionUID = 2589493255876683993L;
+
+ private Object dragValue;
+ private Object dropValue;
+ private String dragType;
+ private boolean dropBefore;
+
+ public DragDropEvent(UIComponent component) {
+ super(component);
+ }
+
+ public void processListener(FacesListener listener) {
+ ((DragDropListener)listener).processDragDrop(this);
+ }
+
+ public Object getDragValue() {
+ return dragValue;
+ }
+
+ public void setDragValue(Object dragValue) {
+ this.dragValue = dragValue;
+ }
+
+ public Object getDropValue() {
+ return dropValue;
+ }
+
+ public void setDropValue(Object dropValue) {
+ this.dropValue = dropValue;
+ }
+
+ public String getDragType() {
+ return dragType;
+ }
+
+ public void setDragType(String dragType) {
+ this.dragType = dragType;
+ }
+
+ public boolean isDropBefore() {
+ return dropBefore;
+ }
+
+ public void setDropBefore(boolean dropBefore) {
+ this.dropBefore = dropBefore;
+ }
+
+ public boolean isAppropriateListener(FacesListener listener) {
+ return (listener instanceof DragDropListener);
+ }
+
+}
Added: trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/DragDropListener.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/DragDropListener.java (rev 0)
+++ trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/DragDropListener.java 2008-07-28 07:16:15 UTC (rev 9794)
@@ -0,0 +1,15 @@
+/**
+ *
+ */
+package org.richfaces.event.extdt;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public interface DragDropListener extends FacesListener {
+
+ public void processDragDrop(DragDropEvent event);
+}
Added: trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterEvent.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterEvent.java (rev 0)
+++ trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterEvent.java 2008-07-28 07:16:15 UTC (rev 9794)
@@ -0,0 +1,39 @@
+/**
+ *
+ */
+package org.richfaces.event.extdt;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public class ExtTableFilterEvent extends FacesEvent {
+
+ private static final long serialVersionUID = -5710321006307753098L;
+
+ public ExtTableFilterEvent(UIComponent uiComponent) {
+ super(uiComponent);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
+ @Override
+ public boolean isAppropriateListener(FacesListener faceslistener) {
+ return (faceslistener instanceof ExtTableFilterListener);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
+ @Override
+ public void processListener(FacesListener faceslistener) {
+ ((ExtTableFilterListener)faceslistener).processFilter(this);
+
+ }
+
+}
Added: trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterListener.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterListener.java (rev 0)
+++ trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ExtTableFilterListener.java 2008-07-28 07:16:15 UTC (rev 9794)
@@ -0,0 +1,15 @@
+/**
+ *
+ */
+package org.richfaces.event.extdt;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public interface ExtTableFilterListener extends FacesListener {
+
+ public void processFilter(ExtTableFilterEvent event);
+}
Added: trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ExtTableSortEvent.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ExtTableSortEvent.java (rev 0)
+++ trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ExtTableSortEvent.java 2008-07-28 07:16:15 UTC (rev 9794)
@@ -0,0 +1,39 @@
+/**
+ *
+ */
+package org.richfaces.event.extdt;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public class ExtTableSortEvent extends FacesEvent {
+
+ private static final long serialVersionUID = 2971879679208358501L;
+
+ public ExtTableSortEvent(UIComponent uiComponent) {
+ super(uiComponent);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
+ //@Override
+ public boolean isAppropriateListener(FacesListener faceslistener) {
+ return (faceslistener instanceof ExtTableSortListener);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
+ //@Override
+ public void processListener(FacesListener faceslistener) {
+ ((ExtTableSortListener)faceslistener).processSort(this);
+
+ }
+
+}
Added: trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ExtTableSortListener.java
===================================================================
--- trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ExtTableSortListener.java (rev 0)
+++ trunk/sandbox/api/src/main/java/org/richfaces/event/extdt/ExtTableSortListener.java 2008-07-28 07:16:15 UTC (rev 9794)
@@ -0,0 +1,15 @@
+/**
+ *
+ */
+package org.richfaces.event.extdt;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author pawelgo
+ *
+ */
+public interface ExtTableSortListener extends FacesListener {
+
+ public void processSort(ExtTableSortEvent event);
+}
16 years, 5 months