Author: pkawiak
Date: 2009-02-16 16:03:30 -0500 (Mon, 16 Feb 2009)
New Revision: 12677
Modified:
trunk/ui/extendedDataTable/src/main/config/component/ExtendedDataTable.xml
trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
trunk/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableHeader.js
trunk/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx
trunk/ui/extendedDataTable/src/test/java/org/richfaces/component/renderer/ExtendedDataTableRendererTest.java
Log:
RF-5086: ExtDt's context menu can now be enabled / disabled via enableContextMenu
parameter.
Modified: trunk/ui/extendedDataTable/src/main/config/component/ExtendedDataTable.xml
===================================================================
--- trunk/ui/extendedDataTable/src/main/config/component/ExtendedDataTable.xml 2009-02-16
20:24:25 UTC (rev 12676)
+++ trunk/ui/extendedDataTable/src/main/config/component/ExtendedDataTable.xml 2009-02-16
21:03:30 UTC (rev 12677)
@@ -213,6 +213,12 @@
<description>Defines a set of column ids in the order
the columns
could be set</description>
</property>
+ <property>
+ <name>enableContextMenu</name>
+ <classname>java.lang.Boolean</classname>
+ <description>If set to true, table header context
menu will be enabled</description>
+ <defaultvalue>true</defaultvalue>
+ </property>
<property hidden="true" existintag="false"
exist="false">
<name>sortFields</name>
</property>
Modified:
trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
===================================================================
---
trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2009-02-16
20:24:25 UTC (rev 12676)
+++
trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2009-02-16
21:03:30 UTC (rev 12677)
@@ -95,6 +95,8 @@
private static final String GROUP_FUNCTION = "groupFunction";
private static final String SHOW_MENU_FUNCTION = "showMenuFunction";
+
+ private static final String ENABLE_CONTEXT_MENU = "enableContextMenu";
private static final String ON_RESIZE_FUNCTION = "onColumnResize";
@@ -890,6 +892,7 @@
table));
scriptOptions.addOption(SHOW_MENU_FUNCTION, getShowMenuFunction(
context, table));
+
scriptOptions.addOption(ENABLE_CONTEXT_MENU,table.getAttributes().get(ENABLE_CONTEXT_MENU));
/* Not needed if we do not save open/close state */
scriptOptions.addOption(ON_GROUP_TOGGLE_FUNCTION,
getOnGroupToggleFunctionDef(context, table));
Modified:
trunk/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableHeader.js
===================================================================
---
trunk/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableHeader.js 2009-02-16
20:24:25 UTC (rev 12676)
+++
trunk/ui/extendedDataTable/src/main/javascript/ClientUI/controls/datatable/ExtendedDataTableHeader.js 2009-02-16
21:03:30 UTC (rev 12677)
@@ -13,9 +13,10 @@
this.eventSepMouseDown = this.OnSepMouseDown.bindAsEventListener(this);
this.eventSepMouseMove = this.OnSepMouseMove.bindAsEventListener(this);
this.eventSepMouseUp = this.OnSepMouseUp.bindAsEventListener(this);
- this.eventHeaderCellMouseOver = this.OnHeaderCellMouseOver.bindAsEventListener(this);
- this.eventHeaderCellMouseOut = this.OnHeaderCellMouseOut.bindAsEventListener(this);
-
+ if (this.extDt.options.enableContextMenu) {
+ this.eventHeaderCellMouseOver = this.OnHeaderCellMouseOver.bindAsEventListener(this);
+ this.eventHeaderCellMouseOut = this.OnHeaderCellMouseOut.bindAsEventListener(this);
+ }
if (this.extDt.sortFct) {
this.eventHeaderCellClicked =
this.OnHeaderCellMouseClicked.bindAsEventListener(this);
}
Modified:
trunk/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx
===================================================================
---
trunk/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx 2009-02-16
20:24:25 UTC (rev 12676)
+++
trunk/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx 2009-02-16
21:03:30 UTC (rev 12677)
@@ -137,6 +137,12 @@
//]]>
</script>
</div>
- <f:call name="encodeTableMenu"/>
+ <jsp:scriptlet>
+ <![CDATA[
+ if((Boolean)component.getAttributes().get("enableContextMenu") ==
true) {
+ encodeTableMenu(context, component);
+ }
+ ]]>
+ </jsp:scriptlet>
</div>
</f:root>
Modified:
trunk/ui/extendedDataTable/src/test/java/org/richfaces/component/renderer/ExtendedDataTableRendererTest.java
===================================================================
---
trunk/ui/extendedDataTable/src/test/java/org/richfaces/component/renderer/ExtendedDataTableRendererTest.java 2009-02-16
20:24:25 UTC (rev 12676)
+++
trunk/ui/extendedDataTable/src/test/java/org/richfaces/component/renderer/ExtendedDataTableRendererTest.java 2009-02-16
21:03:30 UTC (rev 12677)
@@ -26,7 +26,6 @@
import java.util.List;
import java.util.Set;
-import javax.el.MethodExpression;
import javax.faces.component.UIOutput;
import javax.faces.component.html.HtmlOutputText;
Show replies by date