Author: abelevich
Date: 2010-02-19 11:47:57 -0500 (Fri, 19 Feb 2010)
New Revision: 16473
Added:
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/faces-config.xml
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/datatable-test.js
Log:
Added:
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/faces-config.xml
===================================================================
---
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/faces-config.xml
(rev 0)
+++
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/faces-config.xml 2010-02-19
16:47:57 UTC (rev 16473)
@@ -0,0 +1,96 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright ${year}, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
+ version="2.0">
+
+ <component>
+ <component-type>org.richfaces.DataTable</component-type>
+ <component-class>org.richfaces.component.html.HtmlDataTable</component-class>
+ <component-extension>
+ <cdk:generate
xmlns:cdk="http://richfaces.org/cdk/extensions">false</cd...
+ </component-extension>
+ </component>
+
+ <component>
+ <component-type>org.richfaces.ExtendedDataTable</component-type>
+ <component-class>org.richfaces.component.html.HtmlExtendedDataTable</component-class>
+ <component-extension>
+ <cdk:generate
xmlns:cdk="http://richfaces.org/cdk/extensions">false</cd...
+ </component-extension>
+ </component>
+ <component>
+ <component-type>org.richfaces.Column</component-type>
+ <component-class>org.richfaces.component.html.HtmlColumn</component-class>
+ <component-extension>
+ <cdk:generate
xmlns:cdk="http://richfaces.org/cdk/extensions">false</cd...
+ </component-extension>
+ </component>
+ <component>
+ <component-type>org.richfaces.ColumnGroup</component-type>
+ <component-class>org.richfaces.component.html.HtmlColumnGroup</component-class>
+ <component-extension>
+ <cdk:generate
xmlns:cdk="http://richfaces.org/cdk/extensions">false</cd...
+ </component-extension>
+ </component>
+ <component>
+ <component-type>org.richfaces.SubTable</component-type>
+ <component-class>org.richfaces.component.html.HtmlSubTable</component-class>
+ <component-extension>
+ <cdk:generate
xmlns:cdk="http://richfaces.org/cdk/extensions">false</cd...
+ </component-extension>
+ </component>
+ <component>
+ <component-type>org.richfaces.ToggleControl</component-type>
+ <component-class>org.richfaces.component.html.HtmlToggleControl</component-class>
+ <component-extension>
+ <cdk:generate
xmlns:cdk="http://richfaces.org/cdk/extensions">false</cd...
+ </component-extension>
+ </component>
+
+ <render-kit>
+ <render-kit-id>HTML_BASIC</render-kit-id>
+ <renderer>
+ <component-family>org.richfaces.Data</component-family>
+ <renderer-type>org.richfaces.DataTableRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.DataTableRenderer</renderer-class>
+ </renderer>
+ <renderer>
+ <component-family>org.richfaces.Data</component-family>
+ <renderer-type>org.richfaces.SubTableRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.SubTableRenderer</renderer-class>
+ </renderer>
+ <renderer>
+ <component-family>org.richfaces.Column</component-family>
+ <renderer-type>org.richfaces.ColumnGroupRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.ColumnGroupRenderer</renderer-class>
+ </renderer>
+ <renderer>
+ <component-family>org.richfaces.Data</component-family>
+ <renderer-type>org.richfaces.ExtendedDataTableRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.ExtendedDataTableRenderer</renderer-class>
+ </renderer>
+ </render-kit>
+</faces-config>
\ No newline at end of file
Added:
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/datatable-test.js
===================================================================
---
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/datatable-test.js
(rev 0)
+++
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/datatable-test.js 2010-02-19
16:47:57 UTC (rev 16473)
@@ -0,0 +1,51 @@
+(function(jQuery, RichFaces) {
+
+ RichFaces.ui = RichFaces.ui || {};
+
+ RichFaces.ui.DataTable = function(id, options) {
+ this.id = id;
+ this.options = options;
+ this.sortField = options.sortField;
+ this.init(options);
+
+ }
+
+ jQuery.extend(RichFaces.ui.DataTable.prototype, ( function () {
+
+ var clientToggle = function(e, data) {
+ };
+
+ var serverToggle = function(e,data){
+ };
+
+ var ajaxToggle = function(event,data){
+ var component = event.data.component;
+
+ component.save(data.source);
+
+ var params = {"source": data.source,
"javax.faces.partial.render":"@all"};
+ var id = component.id;
+ jsf.ajax.request(id, event, params);
+ };
+
+ return {
+ init: function(options) {
+ this.switchType = options.switchType;
+ RichFaces.Event.bindById(this.id, 'RICH:sort', this.toggle, this);
+ },
+
+ toggle: function(e,elem, d) {
+ ajaxToggle(e,d);
+ },
+
+ save: function(state) {
+ var fieldToSave = jQuery(document.getElementById(this.sortField));
+ fieldToSave.attr('value', state);
+ }
+
+ }
+
+ })());
+
+})(jQuery, window.RichFaces);
+