JBoss Rich Faces SVN: r4934 - trunk/test-applications/facelets/src/main/webapp/Panel.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-12-20 05:59:28 -0500 (Thu, 20 Dec 2007)
New Revision: 4934
Removed:
trunk/test-applications/facelets/src/main/webapp/Panel/panel2.xhtml
Log:
Deleted: trunk/test-applications/facelets/src/main/webapp/Panel/panel2.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Panel/panel2.xhtml 2007-12-20 09:37:00 UTC (rev 4933)
+++ trunk/test-applications/facelets/src/main/webapp/Panel/panel2.xhtml 2007-12-20 10:59:28 UTC (rev 4934)
@@ -1,95 +0,0 @@
-<f:subview id="panel2SubviewID"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:a4j="http://richfaces.org/a4j">
- <h:panelGrid columnClasses="panel" border="0" columns="3">
- <rich:panel styleClass="top">
- <f:facet name="header">
- <h:panelGroup>
- <f:verbatim>dsdsdsdsd<br />sdsd </f:verbatim>
- </h:panelGroup>
-
- </f:facet>
-
- <f:verbatim>This is <b>default</b> panel. content here</f:verbatim>
- </rich:panel>
- <rich:panel styleClass="top" headerClass="hea" bodyClass="bo">
- <f:facet name="header">
- <h:outputText value="Header of the Panel" />
- </f:facet>
- <f:verbatim>This panel contains custom headerClass and bodyClass</f:verbatim>
- </rich:panel>
- <rich:panel styleClass="top2" headerClass="hea2" bodyClass="bo2">
- <f:facet name="header">
- <h:outputText value="Header of the Panel" />
- </f:facet>
- <f:verbatim> This panel also contains custom headerClass and bodyClass. The background is not a 3D anymore.</f:verbatim>
- </rich:panel>
-
- <h:panelGroup>
- <h:form>
- <rich:panel
- onmouseover="document.getElementById(this.id+'_header').style.background='#60BA01';document.getElementById(this.id+'_body').style.background='#F4FFF8'"
- onmouseout="document.getElementById(this.id+'_header').style.background='#4C9600';document.getElementById(this.id+'_body').style.background='#E4FFC8'"
- style="width:200px;" headerClass="hea2" bodyClass="bo3">
- <f:facet name="header">
- <h:outputText value="Header of the Panel" />
- </f:facet>
- <f:verbatim>Base on the previous layout, but form element and javascript behaviour are added</f:verbatim>
- <br />
- <h:inputText />
- </rich:panel>
- </h:form>
- </h:panelGroup>
-
- <rich:panel style="width:200px;" headerClass="hea" bodyClass="bo3">
- <f:facet name="header">
- <h:outputText value="Scrolling Text Panel" />
- </f:facet>
- <f:verbatim>
- Long Text Long Text Long Text
- Long Text Long Text Long Text
- Long Text Long Text Long Text
- Long Text Long Text Long Text
- Long Text Long Text Long Text
- Long Text Long Text Long Text
- Long Text Long Text Long Text
- Long Text Long Text Long Text
- Long Text Long Text Long Text
- Long Text Long Text Long Text
- Long Text Long Text Long Text
- Long Text Long Text Long Text
- Long Text Long Text Long Text
- </f:verbatim>
- </rich:panel>
-
- <rich:panel styleClass="top">
- <f:verbatim>This is a panel without the header</f:verbatim>
-
- </rich:panel>
- </h:panelGrid>
- <rich:panel style="position: absolute; top: 116px; right: 100px; "
- styleClass="top">
- <f:facet name="header">
- <h:outputText value="Header of the Panel" />
- </f:facet>
- <f:verbatim>
- This is a panel with absolute position on the screen.<br />
- Resize the browser's window for fun.
- </f:verbatim>
- </rich:panel>
- <rich:panel style="width:#{panel.width};height:#{panel.height}">
- <f:facet name="header">
- <f:verbatim>
- Test<br />
- Test<br />
- Test<br />
- </f:verbatim>
- </f:facet>
- <h:form>
- <h:outputText value="inside the form" />
- </h:form>
- </rich:panel>
-</f:subview>
16 years, 9 months
JBoss Rich Faces SVN: r4933 - trunk/test-applications.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-12-20 04:37:00 -0500 (Thu, 20 Dec 2007)
New Revision: 4933
Modified:
trunk/test-applications/pom.xml
Log:
Modified: trunk/test-applications/pom.xml
===================================================================
--- trunk/test-applications/pom.xml 2007-12-20 08:26:27 UTC (rev 4932)
+++ trunk/test-applications/pom.xml 2007-12-20 09:37:00 UTC (rev 4933)
@@ -47,7 +47,7 @@
<name>RichFaces Test Applications</name>
<properties>
- <rfVersion>3.1.2-SNAPSHOT</rfVersion>
+ <rfVersion>3.2.0-SNAPSHOT</rfVersion>
</properties>
<modules>
@@ -148,4 +148,4 @@
</dependencies>
</profile>
</profiles>
-</project>
+</project>
\ No newline at end of file
16 years, 9 months
JBoss Rich Faces SVN: r4932 - in trunk/test-applications/facelets/src/main/webapp: Calendar and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-12-20 03:26:27 -0500 (Thu, 20 Dec 2007)
New Revision: 4932
Removed:
trunk/test-applications/facelets/src/main/webapp/DradAndDrop/
trunk/test-applications/facelets/src/main/webapp/Rich/
Modified:
trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml
trunk/test-applications/facelets/src/main/webapp/Calendar/CalendarProperty.xhtml
trunk/test-applications/facelets/src/main/webapp/ComponentControl/ComponentControl.xhtml
trunk/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenu.xhtml
trunk/test-applications/facelets/src/main/webapp/DataOrderedList/DataOrderedList.xhtml
trunk/test-applications/facelets/src/main/webapp/DragAndDrop/DragAndDrop.xhtml
trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config.xml
Log:
update
Modified: trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml 2007-12-19 18:12:29 UTC (rev 4931)
+++ trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml 2007-12-20 08:26:27 UTC (rev 4932)
@@ -29,7 +29,7 @@
</f:facet>
<f:facet name="optionalHeader">
- <h:outputText value="optionalHeader Facet" />
+ <h:outputText value="optionalHeader Facet #{headerFacet}" />
</f:facet>
<f:facet name="optionalFooter">
Modified: trunk/test-applications/facelets/src/main/webapp/Calendar/CalendarProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Calendar/CalendarProperty.xhtml 2007-12-19 18:12:29 UTC (rev 4931)
+++ trunk/test-applications/facelets/src/main/webapp/Calendar/CalendarProperty.xhtml 2007-12-20 08:26:27 UTC (rev 4932)
@@ -6,22 +6,16 @@
xmlns:ui="http://java.sun.com/jsf/facelets">
<rich:simpleTogglePanel id="calendarPropertyID" switchType="client" opened="true" label="calendar property">
<h:panelGrid columns="2">
- <h:panelGroup>
- <a4j:commandButton value="reRender" reRender="calendarClientID,calendarAjaxID"></a4j:commandButton>
- <a4j:commandButton action="submit();" immediate="true" value="immediate submit(); (a4j)"></a4j:commandButton>
- <h:commandButton action="submit();" value="submit();" />
- <h:commandButton action="submit();" immediate="true" value="immediate submit();" />
- </h:panelGroup>
- <h:column></h:column>
-
+
<h:outputText value="Mode" />
<h:selectOneRadio value="#{calendarBean.mode}" onchange="submit();">
<f:selectItem itemLabel="client" itemValue="client"/>
<f:selectItem itemLabel="ajax" itemValue="ajax"/>
</h:selectOneRadio>
-
+
+
<h:outputText value="Select Locale:" />
- <h:selectOneRadio onchange="submit()" value="en/US" valueChangeListener="#{calendarBean.selectLocale}">
+ <h:selectOneRadio onchange="submit()" valueChangeListener="#{calendarBean.selectLocale}">
<f:selectItem itemLabel="US" itemValue="en/US" />
<f:selectItem itemLabel="DE" itemValue="de/DE" />
<f:selectItem itemLabel="FR" itemValue="fr/FR" />
Modified: trunk/test-applications/facelets/src/main/webapp/ComponentControl/ComponentControl.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/ComponentControl/ComponentControl.xhtml 2007-12-19 18:12:29 UTC (rev 4931)
+++ trunk/test-applications/facelets/src/main/webapp/ComponentControl/ComponentControl.xhtml 2007-12-20 08:26:27 UTC (rev 4932)
@@ -84,17 +84,21 @@
<h:outputText value="click text" />
</rich:panelMenu>
- <rich:contextMenu id="ccContextMenuID" submitMode="ajax" onexpand="alert(event.parameters.expand)">
- <rich:menuItem icon="/pics/header.png" value="tab1">
+ <rich:contextMenu id="ccContextMenuID" submitMode="ajax">
+ <rich:menuItem icon="/pics/header.png" value="tab1" reRender="cmInfoID">
+ <f:param name="cmdParam" value="menu" />
</rich:menuItem>
<rich:menuSeparator />
- <rich:menuItem icon="/pics/info.gif" value="a">
+ <rich:menuItem icon="/pics/info.gif" value="a" reRender="cmInfoID">
+ <f:param name="cmdParam" value="a" />
</rich:menuItem>
- <rich:menuItem icon="/pics/info.gif" value="b">
+ <rich:menuItem icon="/pics/info.gif" value=" b" reRender="cmInfoID">
+ <f:param name="cmdParam" value="b" />
</rich:menuItem>
- <rich:menuItem icon="/pics/info.gif" value="c">
+ <rich:menuItem icon="/pics/info.gif" value="c" reRender="cmInfoID">
+ <f:param name="cmdParam" value="c" />
</rich:menuItem>
</rich:contextMenu>
- <rich:componentControl event="oncontextmenu" attachTo="ccContextMenuPanelMenuID" for="ccContextMenuID"
- operation="show" params="expand:'show work'" /> </h:form>
+ <rich:componentControl event="oncontextmenu" attachTo="ccContextMenuPanelMenuID" for="ccContextMenuID" operation="doShow" />
+ </h:form>
</f:subview>
\ No newline at end of file
Modified: trunk/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenu.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenu.xhtml 2007-12-19 18:12:29 UTC (rev 4931)
+++ trunk/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenu.xhtml 2007-12-20 08:26:27 UTC (rev 4932)
@@ -42,7 +42,7 @@
<rich:contextMenu id="contextMenuID" attached="#{contextMenu.attached}" submitMode="#{contextMenu.submitMode}"
event="#{contextMenu.event}" disableDefaultMenu="#{contextMenu.disableDefaultMenu}" rendered="#{contextMenu.rendered}"
hideDelay="#{contextMenu.hideDelay}" showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}">
- <rich:menuItem icon="/pics/header.png" value="abc" reRender="cmInfoID" >
+ <rich:menuItem icon="/pics/header.png" value="abc">
<f:param name="cmdParam" value="abc" />
</rich:menuItem>
<rich:menuSeparator />
Modified: trunk/test-applications/facelets/src/main/webapp/DataOrderedList/DataOrderedList.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/DataOrderedList/DataOrderedList.xhtml 2007-12-19 18:12:29 UTC (rev 4931)
+++ trunk/test-applications/facelets/src/main/webapp/DataOrderedList/DataOrderedList.xhtml 2007-12-20 08:26:27 UTC (rev 4932)
@@ -1,7 +1,7 @@
<f:subview id="dataOrderedListSubviewID" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j"
xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" xmlns:ui="http://java.sun.com/jsf/facelets">
<rich:dataOrderedList id="doListID" value="#{dataOrderedList.arr}" var="arr" first="#{dataOrderedList.first}"
- rendered="#{dataOrderedList.rendered}" title="#{dataOrderedList.title}" type="#{dataOrderedList.type}" dir="#{dataOrderedList.dir}"
+ rendered="#{dataOrderedList.rendered}" title="#{dataOrderedList.title}" type="disc" dir="#{dataOrderedList.dir}"
rows="#{dataOrderedList.rows}">
<f:facet name="header">
<h:outputText value="Africa(header):" />
Modified: trunk/test-applications/facelets/src/main/webapp/DragAndDrop/DragAndDrop.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/DragAndDrop/DragAndDrop.xhtml 2007-12-19 18:12:29 UTC (rev 4931)
+++ trunk/test-applications/facelets/src/main/webapp/DragAndDrop/DragAndDrop.xhtml 2007-12-20 08:26:27 UTC (rev 4932)
@@ -1,11 +1,7 @@
<f:subview id="DtadAndDropSubviewID" xmlns:a4j="http://richfaces.org/a4j" xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich" xmlns:h="http://java.sun.com/jsf/html">
- <a4j:outputPanel ajaxRendered="true">
- <h:messages />
- </a4j:outputPanel>
-
- <script>
+ <script type="text/javascript">
DnD.CLIENT_VALIDATION_OFF = false;
</script>
@@ -193,4 +189,10 @@
<h:graphicImage id="dragImage" value="/pics/masshtaby_01.jpg" width="200px" height="200px" />
<f:verbatim>dragSupport</f:verbatim>
</h:panelGrid>
+
+
+
+ <a4j:outputPanel ajaxRendered="true">
+ <h:messages />
+ </a4j:outputPanel>
</f:subview>
Modified: trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config.xml 2007-12-19 18:12:29 UTC (rev 4931)
+++ trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config.xml 2007-12-20 08:26:27 UTC (rev 4932)
@@ -163,11 +163,14 @@
</navigation-case>
</navigation-rule>
<application>
- <locale-config>
- <default-locale>en</default-locale>
- </locale-config>
+ <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
<lifecycle>
<phase-listener id="phaseTracker">util.phaseTracker.PhaseTracker</phase-listener>
</lifecycle>
+ <application>
+ <locale-config>
+ <default-locale>en</default-locale>
+ </locale-config>
+ </application>
</faces-config>
16 years, 9 months
JBoss Rich Faces SVN: r4931 - in branches/3.1.x: docs/faq/en and 18 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-12-19 13:12:29 -0500 (Wed, 19 Dec 2007)
New Revision: 4931
Added:
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/AbstractSortListener.java
Modified:
branches/3.1.x/cdk/maven-javascript-plugin/
branches/3.1.x/docs/faq/en/
branches/3.1.x/extensions/portletbridge/portletbridge-impl/
branches/3.1.x/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java
branches/3.1.x/samples/contextMenuDemo/src/main/webapp/pages/index.jsp
branches/3.1.x/ui/scrollableDataTable/generatescript.xml
branches/3.1.x/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/convert/selection/ClientSelectionConverter.java
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/MultiColumnSortListener.java
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/SingleColumnSortListener.java
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ComponentSortableDataModel.java
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/model/selection/ClientSelection.java
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableRendererState.java
branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/common/box/ScrollableBox.js
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/common/utils/Utils.js
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/DataModel.js
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Grid.js
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridHeader.js
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Selection.js
branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/layouts/LayoutManager.js
branches/3.1.x/ui/scrollableDataTable/src/main/resources/org/richfaces/renderkit/html/css/scrollable-data-table.xcss
branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-footer-cell.jspx
branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table.jspx
branches/3.1.x/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/ScrollableDataTableRendererTest.java
Log:
merged scrollable-data-table into 3/1/x branch
Property changes on: branches/3.1.x/cdk/maven-javascript-plugin
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Property changes on: branches/3.1.x/docs/faq/en
___________________________________________________________________
Name: svn:ignore
- target
+ target
.project
.settings
Property changes on: branches/3.1.x/extensions/portletbridge/portletbridge-impl
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Modified: branches/3.1.x/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java
===================================================================
--- branches/3.1.x/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/framework/api/src/main/java/org/richfaces/event/sort/SortEvent.java 2007-12-19 18:12:29 UTC (rev 4931)
@@ -13,7 +13,6 @@
import javax.faces.component.UIComponent;
import javax.faces.event.FacesListener;
-import org.richfaces.event.AttributedEvent;
import org.richfaces.event.ScrollableGridViewEvent;
/**
@@ -27,6 +26,8 @@
private int sortColumn;
+ private Boolean suggestedOrder = null;
+
public SortEvent(UIComponent component, int sortColumn, int rows, int first) {
super(component, rows, first);
@@ -59,4 +60,12 @@
public void setSortColumn(int sortColumn) {
this.sortColumn = sortColumn;
}
+
+ public Boolean getSuggestedOrder() {
+ return suggestedOrder;
+ }
+
+ public void setProposedOrder(Boolean proposedOrder) {
+ this.suggestedOrder = proposedOrder;
+ }
}
Modified: branches/3.1.x/samples/contextMenuDemo/src/main/webapp/pages/index.jsp
===================================================================
--- branches/3.1.x/samples/contextMenuDemo/src/main/webapp/pages/index.jsp 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/samples/contextMenuDemo/src/main/webapp/pages/index.jsp 2007-12-19 18:12:29 UTC (rev 4931)
@@ -1,3 +1,5 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<%@ page contentType="application/xhtml+xml; charset=ISO-8859-1" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
@@ -10,8 +12,7 @@
prefix="cc"%>
<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/menu-components"
prefix="mc"%>
-<html>
-<head>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
<title></title>
<style>
<!--
@@ -36,14 +37,37 @@
<h:commandLink action="#{skinBean.change}" value="Set Skin"/>
<h:outputText value=" Current skin: #{skinBean.skin}" />
</h:form>
+
+
<div id="sgs" style="height: 50px"><a4j:outputPanel
ajaxRendered="true">
- <h:messages></h:messages>
+ <h:outputText value="#{param['param']}"></h:outputText>
</a4j:outputPanel></div>
<h:form id="f">
- <cm:contextMenu submitMode="server" id="m" attached="false">
+
+ <div style="border: dotted">div
+ <cm:contextMenu
+ id="ccContextMenuID" submitMode="ajax" attached="true" >
+ <mc:menuItem icon="/icons/ico1.gif" value="tab1">
+ <f:param name="cmdParam" value="menu" />
+ </mc:menuItem>
+ <mc:menuSeparator />
+ <mc:menuItem icon="/icons/ico1.gif" value="a" reRender="cmInfoID">
+ <f:param name="cmdParam" value="a" />
+ </mc:menuItem>
+ <mc:menuItem id="zz" icon="/icons/ico1.gif" value="b" reRender="cmInfoID">
+ <cc:componentControl event="onmouseover" for="ccContextMenuID"
+ attachTo="zz"
+ disableDefault="true" operation="hide" />
+ </mc:menuItem>
+ <mc:menuItem icon="/icons/ico1.gif" value="c" reRender="cmInfoID">
+ <f:param name="cmdParam" value="c" />
+ </mc:menuItem>
+ </cm:contextMenu></div>
+
+ <cm:contextMenu submitMode="ajax" id="m" attached="false">
<mc:menuItem action="#{bean.edit}"
- value="Edit package : {param}" submitMode="ajax"
+ value="Edit package : {param}"
actionListener="#{bean.actionListener}" icon="/icons/ico1.gif">
<a4j:actionparam assignTo="#{bean.param}" name="param"
value="{param}"></a4j:actionparam>
@@ -52,7 +76,7 @@
<mc:menuSeparator id="menuSeparator11" />
<mc:menuItem action="#{bean.delete}"
- value="Delete package {param}" submitMode="ajax"
+ value="Delete package {param}"
actionListener="#{bean.actionListener}" icon="/icons/ico2.gif">
<a4j:actionparam assignTo="#{bean.param}" name="param"
value="{param}"></a4j:actionparam>
Modified: branches/3.1.x/ui/scrollableDataTable/generatescript.xml
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/generatescript.xml 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/generatescript.xml 2007-12-19 18:12:29 UTC (rev 4931)
@@ -27,7 +27,6 @@
<file name="${resources-dir}/ClientUI/common/utils/Validators.js"/>
<file name="${resources-dir}/ClientUI/common/box/Box.js"/>
<file name="${resources-dir}/ClientUI/common/box/InlineBox.js"/>
- <file name="${resources-dir}/ClientUI/common/utils/CustomEvent.js"/>
<file name="${resources-dir}/ClientUI/common/box/ScrollableBox.js"/>
<file name="${resources-dir}/ClientUI/controls/grid/DataModel.js"/>
<file name="${resources-dir}/ClientUI/controls/grid/ArrayDataModel.js"/>
@@ -61,7 +60,6 @@
<file name="/ClientUI/common/utils/Validators.js"/>
<file name="/ClientUI/common/box/Box.js"/>
<file name="/ClientUI/common/box/InlineBox.js"/>
- <file name="/ClientUI/common/utils/CustomEvent.js"/>
<file name="/ClientUI/common/box/ScrollableBox.js"/>
<file name="/ClientUI/controls/grid/DataModel.js"/>
<file name="/ClientUI/controls/grid/ArrayDataModel.js"/>
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2007-12-19 18:12:29 UTC (rev 4931)
@@ -60,7 +60,7 @@
<property>
<name>componentState</name>
- <classname>java.lang.String</classname>
+ <classname>org.ajax4jsf.model.DataComponentState</classname>
<description>It defines EL-binding for a component state for saving or redefinition</description>
</property>
@@ -185,7 +185,7 @@
<property>
<name>rowKey</name>
- <classname>java.lang.String</classname>
+ <classname>java.lang.Object</classname>
<description>The attribute is a representation of an identifier for a specific data row</description>
</property>
@@ -234,7 +234,7 @@
<property>
<name>ajaxKeys</name>
- <classname>java.lang.String</classname>
+ <classname>java.util.Set</classname>
<description>This attribute defines rows that are updated after an AJAX request</description>
</property>
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java 2007-12-19 18:12:29 UTC (rev 4931)
@@ -129,6 +129,7 @@
if (log.isTraceEnabled()) {
log.trace("UIScrollableDataTable.processDecodes(faces)");
}
+ checkRange();
super.processDecodes(faces);
}
@@ -158,6 +159,7 @@
}
useSavedRanges = false;
+ checkRange();
super.encodeBegin(context);
}
@@ -370,6 +372,8 @@
public abstract String getSortMode();
public abstract void setSortMode(String mode);
+ public abstract Object getActiveRowKey();
+ public abstract void setActiveRowKey(Object activeRowKey);
/* (non-Javadoc)
* @see org.ajax4jsf.component.UIDataAdaptor#setRowIndex(int)
@@ -380,4 +384,16 @@
}
//super.setRowIndex(index);
}
+
+ public void resetReqRowsCount() {
+ this.reqRowsCount = -1;
+ }
+
+ private void checkRange() {
+ int rows = getRows();
+ if (getRowCount() <= getFirst() + getRows()) {
+ setFirst(0);
+ setScrollPos("0,0," + rows);
+ }
+ }
}
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/convert/selection/ClientSelectionConverter.java
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/convert/selection/ClientSelectionConverter.java 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/convert/selection/ClientSelectionConverter.java 2007-12-19 18:12:29 UTC (rev 4931)
@@ -62,13 +62,18 @@
}
final ClientSelection clientSelection = new ClientSelection();
+ if(stringSelection == null || stringSelection.length() == 0) {
+ return clientSelection;
+ }
String [] selections = stringSelection.split(";");
int length = selections.length;
- if (selections[length-1].length() == 1) {
+ if (selections[length-1].charAt(0) > '9') {
clientSelection.setSelectionFlag(selections[length-1]);
length--;
}
+ clientSelection.setActiveRowIndex(Integer.parseInt(selections[length-1]));
+ length--;
for (int i = 0; i < length; i++) {
String range = selections[i];
Added: branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/AbstractSortListener.java
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/AbstractSortListener.java (rev 0)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/AbstractSortListener.java 2007-12-19 18:12:29 UTC (rev 4931)
@@ -0,0 +1,46 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.event.sort;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public abstract class AbstractSortListener implements SortListener {
+
+ /**
+ * Encapsulate sorting toggle here
+ * @param current
+ * @param suggested
+ * @return
+ */
+ protected Boolean nextSortOrder(Boolean current, Boolean suggested) {
+
+ if (suggested != null) {
+ return suggested;
+ } else {
+ return (current == null) ? Boolean.TRUE : (current.booleanValue() ? Boolean.FALSE : Boolean.TRUE);
+ }
+
+ }
+
+}
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/MultiColumnSortListener.java
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/MultiColumnSortListener.java 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/MultiColumnSortListener.java 2007-12-19 18:12:29 UTC (rev 4931)
@@ -21,7 +21,7 @@
* @author Maksim Kaszynski
*
*/
-public class MultiColumnSortListener implements SortListener {
+public class MultiColumnSortListener extends AbstractSortListener {
public static final MultiColumnSortListener INSTANCE = new MultiColumnSortListener();
@@ -51,11 +51,13 @@
}
+ Boolean suggested = e.getSuggestedOrder();
+
SortField[] fields = sortOrder.getFields();
if (fields == null) {
//If no sorting was applied at all, set sorting to current
- fields = new SortField[] {new SortField(name, columnIndex, Boolean.TRUE)};
+ fields = new SortField[] {new SortField(name, columnIndex, nextSortOrder(null, suggested))};
} else {
List newFields = new LinkedList(Arrays.asList(fields));
@@ -69,16 +71,16 @@
name.equals(sortField.getName()))) {
Boolean asc = sortField.getAscending();
- asc = Boolean.TRUE.equals(asc) ? Boolean.FALSE : Boolean.TRUE;
- newField = new SortField(name, columnIndex, asc);
+ newField = new SortField(name, columnIndex, nextSortOrder(asc, suggested));
iterator.remove();
}
}
if (newField == null) {
- newField = new SortField(name, columnIndex, Boolean.TRUE);
+
+ newField = new SortField(name, columnIndex, nextSortOrder(null, suggested));
}
newFields.add(newField);
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/SingleColumnSortListener.java
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/SingleColumnSortListener.java 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/SingleColumnSortListener.java 2007-12-19 18:12:29 UTC (rev 4931)
@@ -15,7 +15,7 @@
* @author Maksim Kaszynski
*
*/
-public class SingleColumnSortListener implements SortListener {
+public class SingleColumnSortListener extends AbstractSortListener {
public static final SingleColumnSortListener INSTANCE = new SingleColumnSortListener();
@@ -46,7 +46,7 @@
SortField[] fields = sortOrder.getFields();
- SortField newField = new SortField(name, columnIndex, Boolean.TRUE);
+ SortField newField = new SortField(name, columnIndex, nextSortOrder(null, e.getSuggestedOrder()));
if (fields != null) {
for (int i = 0; i < fields.length; i++) {
@@ -56,8 +56,7 @@
name != null &&
name.equals(sortField.getName()))) {
- Boolean asc = sortField.getAscending();
- asc = Boolean.TRUE.equals(asc) ? Boolean.FALSE : Boolean.TRUE;
+ Boolean asc = nextSortOrder(sortField.getAscending(), e.getSuggestedOrder()) ;
newField = new SortField(name, columnIndex, asc);
break;
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ComponentSortableDataModel.java
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ComponentSortableDataModel.java 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ComponentSortableDataModel.java 2007-12-19 18:12:29 UTC (rev 4931)
@@ -27,6 +27,7 @@
import java.util.List;
import javax.faces.context.FacesContext;
+import javax.faces.model.DataModel;
import org.richfaces.model.ScrollableTableDataModel;
import org.richfaces.model.SortField;
@@ -65,6 +66,7 @@
private List wrappedList;
+ DataModel model;
private String var;
public ComponentSortableDataModel(String var, Object value) {
@@ -76,12 +78,7 @@
* @see org.richfaces.model.ScrollableTableDataModel#loadData(int, int, org.richfaces.model.SortOrder)
*/
public List loadData(int startRow, int endRow, SortOrder sortOrder) {
-
-
- List sortedCollection = sortOrder != null ?
- prepareCollection(FacesContext.getCurrentInstance(), new ArrayList(wrappedList), sortOrder) : wrappedList;
-
-
+ List list = null;
int rc = getRowCount();
if (startRow < 0) {
startRow = 0;
@@ -90,24 +87,51 @@
if (endRow > rc) {
endRow = rc;
}
-
- return sortedCollection.subList(startRow, endRow);
+ if (sortOrder == null) {
+ if(model != null) {
+ list = new ArrayList(rc);
+ for (int i = startRow; i < endRow; i++) {
+ model.setRowIndex(i);
+ list.add(model.getRowData());
+ }
+ } else {
+ list = wrappedList.subList(startRow, endRow);
+ }
+ } else {
+ if(model != null) {
+ list = new ArrayList(rc);
+ for (int i = 0; i < rc; i++) {
+ model.setRowIndex(i);
+ list.add(model.getRowData());
+ }
+ } else {
+ list = new ArrayList(wrappedList);
+ }
+ list = prepareCollection(FacesContext.getCurrentInstance(), list, sortOrder).subList(startRow, endRow);
+ }
+ return list;
}
/* (non-Javadoc)
* @see javax.faces.model.DataModel#getRowCount()
*/
public int getRowCount() {
- // TODO Auto-generated method stub
- return wrappedList.size();
+ if (model != null) {
+ return model.getRowCount();
+ } else {
+ return wrappedList.size();
+ }
}
/* (non-Javadoc)
* @see javax.faces.model.DataModel#getWrappedData()
*/
public Object getWrappedData() {
- // TODO Auto-generated method stub
- return wrappedList;
+ if (model != null) {
+ return model;
+ } else {
+ return wrappedList;
+ }
}
/* (non-Javadoc)
@@ -132,6 +156,8 @@
wrappedList = new ArrayList((Collection) value);
+ } else if (value instanceof DataModel) {
+ model = (DataModel)value;
} else {
wrappedList = new ArrayList(1);
wrappedList.add(value);
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/model/selection/ClientSelection.java
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/model/selection/ClientSelection.java 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/model/selection/ClientSelection.java 2007-12-19 18:12:29 UTC (rev 4931)
@@ -24,6 +24,8 @@
private String selectionFlag;
+ private int activeRowIndex = -1;
+
private List ranges = new ArrayList();
public ClientSelection() {
@@ -57,8 +59,8 @@
int s = ranges.size();
int insertPosition = 0;
-
- for(int i = 0; i < s && insertPosition >= 0 ; i++) {
+ int i;
+ for(i = 0; i < s && insertPosition >= 0 ; i++) {
firstRange = (SelectionRange) ranges.get(i);
@@ -86,6 +88,8 @@
} else if (firstRange.getStartIndex() > j) {
insertPosition = i;
+ } else if (insertPosition == 0 && i == s - 1) {
+ insertPosition = s;
}
}
@@ -128,4 +132,14 @@
reset = true;
}
}
+
+
+ public int getActiveRowIndex() {
+ return activeRowIndex;
+ }
+
+
+ public void setActiveRowIndex(int activeRowIndex) {
+ this.activeRowIndex = activeRowIndex;
+ }
}
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java 2007-12-19 18:12:29 UTC (rev 4931)
@@ -41,18 +41,18 @@
public abstract class ScrollableDataTableBaseRenderer extends CompositeRenderer {
- public final String PARTIAL_UPDATE= "partialUpdate";
- public final String UPDATE_HEADER = "updateHeader";
+ public static final String PARTIAL_UPDATE = "partialUpdate";
+ public static final String UPDATE_HEADER = "updateHeader";
- public final String FOOTER_PART = "footer";
+ public static final String FOOTER_PART = "footer";
- public final String HEADER_PART = "header";
+ public static final String HEADER_PART = "header";
- private final String COLUMN_FROZEN_TYPE = "frozen";
+ private static final String COLUMN_FROZEN_TYPE = "frozen";
- private final String COLUMN_NORMAL_TYPE = "normal";
+ private static final String COLUMN_NORMAL_TYPE = "normal";
- private final String PERSENTAGE_SUPPORT_ERROR_MSG = "columnsWidth property: Percentage values are not supported";
+ private static final String PERSENTAGE_SUPPORT_ERROR_MSG = "columnsWidth property: Percentage values are not supported";
private RendererBase cellTemplate = null;
@@ -289,7 +289,10 @@
ColumnWalker.iterateOverColumns(context, grid, cellRenderer, writer, state);
if(!state.isFrozenPart()){
writer.startElement("td", grid);
- getUtils().writeAttribute(writer, "class","dr-sdt-bc rich-sdt-row " + state.getColumnClass(state.getCellIndex()));
+ getUtils().writeAttribute(writer, "class","dr-sdt-bc rich-sdt-column-cell " + state.getColumnClass(state.getCellIndex()));
+ writer.startElement(HTML.DIV_ELEM, grid);
+ getUtils().writeAttribute(writer, "class","dr-sdt-bcbody");
+ writer.endElement(HTML.DIV_ELEM);
writer.endElement("td");
}
writer.endElement(HTML.TR_ELEMENT);
@@ -324,15 +327,14 @@
String row_id = null;
+ String baseClientId = grid.getBaseClientId(context);
for (Iterator iter = grid.getChildren().iterator(); iter.hasNext(); ) {
UIComponent kid = (UIComponent) iter.next();
if (kid.isRendered()) {
- if (kid instanceof Column){
- String baseClientId = grid.getBaseClientId(context);
-
+ if (kid instanceof Column){
if(state.isFrozenColumn() && !frozenTRRendered){
state.setFrozenPart(true);
@@ -347,19 +349,9 @@
}else if(!state.isFrozenColumn() && !normalTRRendered){
- if(frozenTRRendered){
- writer.endElement("tr");
- }
-
- state.setFrozenPart(false);
- row_id = baseClientId + ":n:" + state.getRowIndex();
-
- writer.startElement("tr", grid);
- getUtils().writeAttribute(writer,"id",row_id);
- getUtils().writeAttribute(writer, "class","dr-sdt-rb rich-sdt-row" + state.getRowClass(state.getRowIndex()));
- addRowJavascriptEvents(writer, grid);
+ writeNormalTr(frozenTRRendered, state, grid, collection,
+ writer, baseClientId);
normalTRRendered = true;
- collection.add(row_id);
}
@@ -376,17 +368,39 @@
}
}
-
-// if(!state.isFrozenPart()){
-// writer.startElement("td", grid);
-// getUtils().writeAttribute(writer, "class","dr-sdt-bc " + state.getColumnClass(state.getCellIndex()));
-// writer.endElement("td");
-// }
-
+ if(!normalTRRendered){
+ writeNormalTr(frozenTRRendered, state, grid, collection,
+ writer, baseClientId);
+ }
+ writer.startElement("td", grid);
+ getUtils().writeAttribute(writer, "class","dr-sdt-bc rich-sdt-column-cell " + state.getColumnClass(state.getCellIndex()));
+ writer.startElement(HTML.DIV_ELEM, grid);
+ getUtils().writeAttribute(writer, "class","dr-sdt-bcbody");
+ writer.endElement(HTML.DIV_ELEM);
+ writer.endElement("td");
writer.endElement("tr");
state.setCellIndex(0);
state.nextRow();
}
+
+ private void writeNormalTr(boolean frozenTRRendered,
+ ScrollableDataTableRendererState state,
+ UIScrollableDataTable grid, Collection collection,
+ ResponseWriter writer, String baseClientId) throws IOException {
+ String row_id;
+ if(frozenTRRendered){
+ writer.endElement("tr");
+ }
+
+ state.setFrozenPart(false);
+ row_id = baseClientId + ":n:" + state.getRowIndex();
+
+ writer.startElement("tr", grid);
+ getUtils().writeAttribute(writer,"id",row_id);
+ getUtils().writeAttribute(writer, "class","dr-sdt-rb rich-sdt-row" + state.getRowClass(state.getRowIndex()));
+ addRowJavascriptEvents(writer, grid);
+ collection.add(row_id);
+ }
};
// temporary solution RF-957
@@ -574,21 +588,40 @@
Map parameters = externalContext.getRequestParameterMap();
String s_id = clientId + ":si";
+ grid.resetReqRowsCount();
if(parameters.containsKey(s_id)){
String options = (String)parameters.get(s_id);
grid.setScrollPos(options);
+ if(options.length() > 0){
+ grid.setFirst(Integer.parseInt(options.split(",")[1]));
+ }
}
if(parameters.containsKey(clientId + ":sortColumn") &&
parameters.containsKey(clientId + ":sortStartRow") &&
- parameters.containsKey(clientId + ":sortIndex") &&
- parameters.containsKey(clientId + ":sortOrder")){
+ parameters.containsKey(clientId + ":sortIndex")){
int sortColumn = Integer.parseInt((String)parameters.get(clientId + ":sortColumn"));
int sortDataIndex = Integer.parseInt((String)parameters.get(clientId + ":sortIndex"));
Integer sortStartRow = Integer.valueOf((String)parameters.get(clientId + ":sortStartRow"));
+ String sortOrderString =
+ (String) parameters.get(clientId + ":sortOrder");
+
+ Boolean so = null;
+
+ if (sortOrderString != null && sortOrderString.length() > 0 ) {
+ sortOrderString = sortOrderString.toLowerCase();
+
+ if (sortOrderString.startsWith("a")) {
+ so = Boolean.TRUE;
+ } else if (sortOrderString.startsWith("d")){
+ so = Boolean.FALSE;
+ }
+ }
+
+
Column column = (Column)grid.getChildren().get(sortColumn);
if(column.isSortable()){
@@ -596,6 +629,8 @@
sorted = true;
SortEvent sortEvent = new SortEvent(grid,sortColumn, grid.getRows(), sortDataIndex);
+ sortEvent.setProposedOrder(so);
+
sortEvent.setAttribute(ScrollableDataTableUtils.CLIENT_ROW_KEY,sortStartRow);
if (ajaxContext.isAjaxRequest()) {
@@ -671,10 +706,29 @@
writer.startElement("tbody", grid);
grid.walk(context, ajaxRowsRenderer, state);
+ int fakeRowsCount = grid.getRows() - grid.getRowCount();
+ state.setFake(true);
+ for (int i = 0; i < fakeRowsCount; i++) {
+ ajaxRowsRenderer.process(context, null, state);
+ }
+ state.setFake(false);
+
writer.endElement("tbody");
writer.endElement("table");
+ String id = client_id+"_rows_input";
+ writer.startElement(HTML.INPUT_ELEM, grid);
+ writer.writeAttribute(HTML.TYPE_ATTR, "hidden", null);
+ writer.writeAttribute(HTML.id_ATTRIBUTE, id, null);
+ writer.writeAttribute(HTML.NAME_ATTRIBUTE, id, null);
+ writer.writeAttribute(HTML.value_ATTRIBUTE, new Integer(grid.getRowCount()), null);
+ writer.endElement(HTML.INPUT_ELEM);
+ ajaxContext.addRenderedArea(id);
+
+ renderHiddenScrollInput(context, grid);
+ ajaxContext.addRenderedArea(client_id+":si");
+
ScrollableDataTableRendererState.restoreState(context);
grid.setRowKey(null);
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableRendererState.java
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableRendererState.java 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableRendererState.java 2007-12-19 18:12:29 UTC (rev 4931)
@@ -3,7 +3,6 @@
*/
package org.richfaces.renderkit.html;
-import java.io.Serializable;
import java.util.Collection;
import java.util.HashSet;
@@ -12,11 +11,12 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import org.ajax4jsf.component.UIDataAdaptor;
import org.ajax4jsf.context.AjaxContext;
import org.richfaces.component.UIScrollableDataTable;
/**
- * bean to store current {@link com.exadel.vcp.components.datagrid.UIDataGrid } information
+ * bean to store current {@link UIDataAdaptor } information
* in request map. For nested grids, it support push/pop state saving.
* In {@link javax.faces.render.Renderer#encodeBegin(javax.faces.context.FacesContext, javax.faces.component.UIComponent)} method
* must be created instance of this bean , or, if it already exist in request map - push information.
@@ -24,7 +24,7 @@
* @author shura
*
*/
-public class ScrollableDataTableRendererState implements Serializable {
+public class ScrollableDataTableRendererState{
public static final String DATA_GRID_RENDERER_STATE = ScrollableDataTableRendererState.class.getName();
@@ -78,6 +78,8 @@
private Object rowKey;
+ private int rows;
+
private static final long serialVersionUID = 2129605586975025578L;
@@ -146,6 +148,7 @@
_cachedClientId = grid.getClientId(context);
clientId = _cachedClientId;
_previousState = previsiosState;
+ rows = grid.getRows();
}
public String getCurrentCellId(FacesContext context){
@@ -223,7 +226,7 @@
* @return Returns the rowIndex.
*/
public int getRowIndex() {
- if(_grid.getRows() != 0 && _rowIndex >= _grid.getRows()){
+ if(rows != 0 && _rowIndex >= rows){
_rowIndex = 0;
}
return _rowIndex;
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java 2007-12-19 18:12:29 UTC (rev 4931)
@@ -45,7 +45,7 @@
public void decode(FacesContext context, UIComponent component,
CompositeRenderer compositeRenderer) {
- UIScrollableDataTable grid = (UIScrollableDataTable) component;
+ final UIScrollableDataTable grid = (UIScrollableDataTable) component;
ExternalContext externalContext = context.getExternalContext();
Map requestParamMap = externalContext.getRequestParameterMap();
@@ -103,6 +103,9 @@
}
+ if(i == clientSelection.getActiveRowIndex()) {
+ grid.setActiveRowKey(rowKey);
+ }
state.nextRow();
}
@@ -165,8 +168,16 @@
ScriptOptions scriptOptions = new ScriptOptions(component);
scriptOptions.addOption("selectionInput", getSelectionInputName(
context, (UIScrollableDataTable) component));
- scriptOptions.addOption("selectedClass");
- scriptOptions.addOption("activeClass");
+ Map attributes = component.getAttributes();
+ Object attribut = attributes.get("selectedClass");
+ if (attribut == null) {
+ attribut = "";
+ }
+ scriptOptions.addOption("selectedClass", attribut);
+ attribut = attributes.get("activeClass");
+ if (attribut == null) {
+ attribut = "";
+ }scriptOptions.addOption("activeClass", attribut);
return scriptOptions;
}
@@ -194,7 +205,7 @@
}
- private void encodeSelection(FacesContext context, UIScrollableDataTable grid) throws IOException {
+ private void encodeSelection(FacesContext context, final UIScrollableDataTable grid) throws IOException {
final ScrollableDataTableRendererState state = ScrollableDataTableRendererState.createState(context, grid);
state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));
@@ -217,6 +228,9 @@
clientSelection.addIndex(i);
}
+ if (rowKey.equals(grid.getActiveRowKey())) {
+ clientSelection.setActiveRowIndex(state.getRowIndex());
+ }
state.nextRow();
@@ -245,13 +259,16 @@
Converter converter =
application.createConverter(ClientSelection.class);
+ ClientSelection selection = (ClientSelection)grid.getAttributes().get(CLIENT_SELECTION);
String string =
- converter.getAsString(context, grid, grid.getAttributes().get(CLIENT_SELECTION));
+ converter.getAsString(context, grid, selection);
if (string == null) {
string = "";
}
+ string += selection.getActiveRowIndex();
+
String id = getSelectionInputName(context, grid);
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/common/box/ScrollableBox.js
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/common/box/ScrollableBox.js 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/common/box/ScrollableBox.js 2007-12-19 18:12:29 UTC (rev 4931)
@@ -6,7 +6,6 @@
ClientUILib.declarePackage("ClientUI.common.box.ScrollableBox");
ClientUILib.requireClass("ClientUI.common.box.Box");
-ClientUILib.requireClass("ClientUI.common.utils.CustomEvent");
/**
* This class target to manage scrollable box object.
@@ -18,10 +17,6 @@
$super(element, parentElement);
this.element.setStyle({overflow: 'auto'});
- // Create custom event producers
- this.eventHScroll = new ClientUI.common.utils.CustomEvent('OnHScroll');
- this.eventVScroll = new ClientUI.common.utils.CustomEvent('OnVScroll');
-
this.eventOnScroll = this.scrollContent.bindAsEventListener(this);
Event.observe(this.element, 'scroll', this.eventOnScroll);
},
@@ -34,13 +29,13 @@
// process horizontal scrolling
if(this.scrollLeft!==this.getViewportScrollX()) {
this.scrollLeft = this.getViewportScrollX();
- this.eventHScroll.fire(this.getViewportScrollX());
+ this.element.fire("grid:onhcroll", {pos:this.getViewportScrollX()});
}
// process vertical scrolling
if(this.scrollTop!==this.getViewportScrollY()) {
this.scrollTop = this.getViewportScrollY();
- this.eventVScroll.fire(this.getViewportScrollY());
+ this.element.fire("grid:onvcroll", {pos:this.getViewportScrollY()});
}
},
updateLayout: function($super) {
@@ -117,16 +112,4 @@
this.scrollerWidth = (wNoScroll - wScroll);
return this.scrollerWidth || 0;
}
-});
-
-Object.extend(ClientUI.common.box.ScrollableBox.prototype, {
- // Custom events
- /**
- * Occured when content scrolled in horizontal
- */
- eventHScroll: {},
- /**
- * Occured when content scrolled in vertical
- */
- eventVScroll: {}
});
\ No newline at end of file
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/common/utils/Utils.js
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/common/utils/Utils.js 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/common/utils/Utils.js 2007-12-19 18:12:29 UTC (rev 4931)
@@ -255,7 +255,7 @@
}, 100);
}
- dataModel.eventDataReady.fire(localOptions);
+ grid.getBody()._onDataReady(localOptions);
}
}
};
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/DataModel.js
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/DataModel.js 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/DataModel.js 2007-12-19 18:12:29 UTC (rev 4931)
@@ -5,8 +5,6 @@
*/
ClientUILib.declarePackage("ClientUI.controls.grid.DataModel");
-ClientUILib.requireClass("ClientUI.common.utils.CustomEvent");
-
/*
* DataModel.js - Base datamodel class for grid control
* by Denis Morozov <dmorozov(a)exadel.com> distributed under the BSD license.
@@ -16,7 +14,6 @@
initialize: function() {
// constructor
- this.eventDataReady = new ClientUI.common.utils.CustomEvent('DataModel::OnDataReady');
},
// interface method
@@ -38,9 +35,4 @@
getRequestDelay: function() {
return 1000;
}
-});
-
-Object.extend(ClientUI.controls.grid.DataModel.prototype, {
- eventDataReady: {}
-});
-
+});
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Grid.js
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Grid.js 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Grid.js 2007-12-19 18:12:29 UTC (rev 4931)
@@ -33,21 +33,16 @@
initialize: function($super, element, dataModel, templates) {
$super(element);
- if(!this.element || !this.element.id)
- this.element.id = "ClientUI_Grid" + ClientUI_controls_grid_Grid_idGenerator++;
this.dataModel = dataModel;
this.templates = $A(templates);
-
- this.eventOnSort = new ClientUI.common.utils.CustomEvent('OnSort');
- this.eventOnResizeColumn = new ClientUI.common.utils.CustomEvent('OnResizeColumn');
-
+
this.createControl();
},
createControl: function() {
var grid = this;
- this.layout = new ClientUI.layouts.GridLayoutManager(this.getElement(), null);
+ this.layout = new ClientUI.layouts.GridLayoutManager(this.getElement().id + ":c", null);
var pagePart, item;
for(var i=0; i<this.templates.length; i++) {
@@ -116,7 +111,7 @@
if(this.getFooter()) this.getFooter().adjustColumnWidth(index, width);
this.updateLayout();
this.getHeader().agjustSeparators();
- this.eventOnResizeColumn.fire(index, width);
+ // this.eventOnResizeColumn.fire(index, width);
},
adjustScrollPosition: function(pos) {
if(pos<0) {pos = 0;}
@@ -162,15 +157,14 @@
},
quickFind: function(column, text, startRow) {
var start = startRow || 0;
- var searchText = "*" + text + "*";
- searchText = searchText.replace(/\*/g, ".*");
+ var searchText = ".*" + text + ".*";
var searchReg = new RegExp(searchText, 'i');
var rowIndex = -1;
var body = this.getBody();
var rowsCount = body.rowsCount;
for (var i = start; i < rowsCount; i++) {
var currentTextInGrid = body.getCellText(i, column);
- currentTextInGrid = currentTextInGrid.replace(/,/g,'');
+ currentTextInGrid = currentTextInGrid.replace(/(<[^<]*>)/g,'');
if (currentTextInGrid.search(searchReg) != -1) {
rowIndex = i;
break;
@@ -204,21 +198,4 @@
this.updateLayout();
}
}
-});
-
-Object.extend(ClientUI.controls.grid.Grid.prototype, {
- // Custom events
- /**
- * Occured when content header clicked
- */
- eventOnSort: {},
- /**
- * Occured when column width adjusted
- */
- eventOnResizeColumn: {}
-});
-
-if(!ClientUI_controls_grid_Grid_idGenerator) {
-var ClientUI_controls_grid_Grid_idGenerator = 0;
-};
-
+});
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-12-19 18:12:29 UTC (rev 4931)
@@ -24,26 +24,23 @@
$super(template);
// declare event listeners
- this._eventOnHScroll = this._onContentHScroll.bind(this);
- this._eventOnVScroll = this._onContentVScroll.bind(this);
- this._eventOnDataReady = this._onDataReady.bind(this);
+ this._eventOnHScroll = this._onContentHScroll.bindAsEventListener(this);
+ this._eventOnVScroll = this._onContentVScroll.bindAsEventListener(this);
this.createControl(template);
this.registerEvents();
},
registerEvents: function() {
- Event.observe(this.scrollBox.eventHScroll, "grid body hscroll", this._eventOnHScroll);
- Event.observe(this.scrollBox.eventVScroll, "grid body vscroll", this._eventOnVScroll);
- Event.observe(this.grid.dataModel.eventDataReady, "grid data is loaded", this._eventOnDataReady);
+ Event.observe(this.scrollBox.element, "grid:onhcroll", this._eventOnHScroll);
+ Event.observe(this.scrollBox.element, "grid:onvcroll", this._eventOnVScroll);
},
destroy: function() {
- Event.stopObserving(this.scrollBox.eventHScroll, "grid body hscroll", this._eventOnHScroll);
- Event.stopObserving(this.scrollBox.eventVScroll, "grid body vscroll", this._eventOnVScroll);
- Event.stopObserving(this.grid.dataModel.eventDataReady, "grid data is loaded", this._eventOnDataReady);
+ Event.stopObserving(this.scrollBox.element, "grid:onhcroll", this._eventOnHScroll);
+ Event.stopObserving(this.scrollBox.element, "grid:onvcroll", this._eventOnVScroll);
},
// event listeners
- _onContentHScroll: function(xpos) {
- this.grid.adjustScrollPosition(xpos);
+ _onContentHScroll: function(event) {
+ this.grid.adjustScrollPosition(event.memo.pos);
},
_onDataReady: function(options) {
// load rows data
@@ -53,14 +50,14 @@
window.loadingInvalidateTime = (new Date()).getTime();
},
- _onContentVScroll: function(ypos) {
+ _onContentVScroll: function(event) {
this.helpObject1.moveToY(this.sizeBox.getHeight()+ this.defaultRowHeight + 5);
this.helpObject2.moveToY(this.sizeBox.getHeight()+ this.defaultRowHeight + 5);
- this.setScrollPos(ypos);
- this.adjustDataPosition(ypos);
+ this.setScrollPos(event.memo.pos);
+ this.adjustDataPosition(event.memo.pos);
},
createControl: function(template) {
-
+ this.scrollInput = $(this.gridId + ":si");
var childs = template.childNodes;
for(var i=0; i<childs.length; i++) {
if(childs[i].id == this.gridId + ":bc") {
@@ -71,6 +68,7 @@
break;
}
}
+ Event.observe(this.container.getElement(), 'keypress', this.synchronizeScroll.bindAsEventListener(this));
// create scroll box
this.scrollBox = new ClientUI.common.box.ScrollableBox(this.gridId + ":scb", this.getElement());
@@ -97,6 +95,7 @@
this.contentBox = new ClientUI.common.box.Box(normal);
this.contentBox.makeAbsolute();
+ Event.observe(this.contentBox.getElement(), 'keypress', this.synchronizeScroll.bindAsEventListener(this));
this.frozenContentBox = new ClientUI.common.box.Box(frozen);
this.frozenContentBox.makeAbsolute();
@@ -224,15 +223,6 @@
this.scrollBox.setHeight(this.getHeight()+1);
this.scrollBox.setWidth(this.getWidth());
this.scrollBox.setHeight(this.getHeight());
- var viewWidth = this.scrollBox.getViewportWidth();
- this.container.setWidth(viewWidth);
-
- if(ClientUILib.isIE) {
- this.contentBox.setWidth(viewWidth - frozenContentWidth);
- }
- else {
- this.contentBox.setWidth(Math.max(this.getWidth(), totalWidth));
- }
height = this.scrollBox.getElement().clientHeight;
@@ -242,18 +232,28 @@
this.container.setHeight(height - fixH);
this.defaultRowHeight = this._calcDefaultRowHeight();
+ this.sizeBox.hide();
this.sizeBox.setHeight(this.defaultRowHeight * this.grid.dataModel.getCount() + fixH);
this.helpObject1.moveToY(this.sizeBox.getHeight()+ this.defaultRowHeight + 5);
this.helpObject2.moveToY(this.sizeBox.getHeight()+ this.defaultRowHeight + 5);
-
- var scrollPos = Math.min(totalWidth - viewWidth, scrollLeft);
- this.grid.adjustScrollPosition(scrollPos);
this.dataVisible = parseInt(this.contentBox.getHeight() / this.defaultRowHeight, 10) + 1;
this.dataVisible = Math.min(this.dataVisible, this.rowsCount);
if(height > 0) {
this.adjustDataPosition(this.currentPos);
}
+ this.sizeBox.show();
+ var viewWidth = this.scrollBox.getViewportWidth();
+ this.container.setWidth(viewWidth);
+
+ if(ClientUILib.isIE) {
+ this.contentBox.setWidth(viewWidth - frozenContentWidth);
+ }
+ else {
+ this.contentBox.setWidth(Math.max(this.getWidth(), totalWidth));
+ }
+ var scrollPos = Math.min(totalWidth - viewWidth, scrollLeft);
+ this.grid.adjustScrollPosition(scrollPos);
},
adjustScrollPosition: function(pos) {
this.templNormal.moveToX(-pos);
@@ -283,6 +283,9 @@
}
else if(to == this.grid.dataModel.getCount()) {
from = to - this.rowsCount;
+ if (from < 0) {
+ from = 0;
+ }
}
var range = $R(from, to);
@@ -339,7 +342,7 @@
var columns = this.grid.getHeader().getColumns();
var bodyCell = columns.last().bodyCol;
if(bodyCell) bodyCell.width = 1;
- var width = this.grid.getElement().offsetWidth - this.fTable.offsetWidth - this.nTable.offsetWidth;
+ var width = this.container.getElement().offsetWidth - this.fTable.offsetWidth - this.nTable.offsetWidth;
if (width < 1) {
width = 1;
}
@@ -360,6 +363,8 @@
var startRowIndx = 0;
var countToLoad = 0;
+ this.scrollInput.value = task.pos + "," + range.start + "," + range.end;
+
// if we have intersepted ranges than rearrange rows
// in other case just move rows table to first position
if(this.currRange.end < range.start
@@ -768,6 +773,27 @@
} else {
return 16;
}
+ },
+
+ restoreScrollState: function() {
+ this.scrollInput = $(this.gridId + ":si");
+ var value = this.scrollInput.value
+ if(value !=''){
+ var values = value.split(',');
+ this.currentPos = values[0];
+ this.scrollBox.getElement().scrollTop = values[0];
+ this.currRange.start = values[1];
+ this.currRange.end = values[2];
+ var visibleRowPos = this.currRange.start * this.defaultRowHeight;
+ this.templFrozen.moveToY(visibleRowPos);
+ this.templNormal.moveToY(visibleRowPos);
+ }
+ },
+
+ synchronizeScroll: function(event) {
+ if(Event.KEY_TAB == event.keyCode || Event.KEY_TAB == event.charCode) {
+ Event.stop(event);
+ }
}
});
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridHeader.js
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridHeader.js 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/GridHeader.js 2007-12-19 18:12:29 UTC (rev 4931)
@@ -183,7 +183,7 @@
frozen: false,
fixedWidth: Validators.getBoolean(cell.getAttribute("fixedWidth"), false),
sortable: Validators.getBoolean(cell.getAttribute("sortable"), false),
- sorted: Validators.getBoolean(cell.getAttribute("sorted"), "desc")
+ sorted: null
};
if(columns[j].sortable)
@@ -422,9 +422,7 @@
*/
var rows = this.grid.getBody().templFrozen.getElement().rows;
var startRow = rows && rows.length>0 ? this.grid.getBody()._getRowIndex(rows[0].id) : 0;
- this.grid.eventOnSort.fire({
- column: index,
- /*order: dir,*/
+ this.grid.element.fire("grid:onsort",{ column: index,
startRow: startRow,
index: this.grid.getBody().currRange.start
});
@@ -437,12 +435,12 @@
var cols = this.getColumns();
for(var i = 0; i < cols.length; i++) {
var col = cols[i];
- var th = col.object;
+ var div = col.object.getElement().firstChild;
var icon = this._getCellElements(i)[1];
if (icon) {
- var newPosX = th.getWidth() - icon.getWidth();
- var newPosY = (th.getHeight() - icon.getHeight())/2;
+ var newPosX = div.clientWidth - icon.getWidth();
+ var newPosY = (div.clientHeight - icon.getHeight())/2;
newPosX = Math.floor(newPosX);
newPosY = Math.floor(newPosY);
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js 2007-12-19 18:12:29 UTC (rev 4931)
@@ -7,7 +7,6 @@
this.options = options;
this.client_id = this.options.client_id;
this.rows_count = $(this.client_id + "_rows_input").value;
- this.scroll_si = $(this.client_id + ":si");
this.columns_count = this.options.columnsCount;
this.splash_id = this.options.splash_id;
this.dataModel = new ClientUI.controls.grid.FakeArrayDataModel(this.rows_count, this.columns_count, this.client_id);
@@ -19,10 +18,6 @@
];
var grid = this;
var s = $super;
-
- Event.onReady(function(){
- grid.init(s);
- });
Utils.execOnLoad(
function(){
grid.init(s);
@@ -44,57 +39,31 @@
superCtor(this.client_id, this.dataModel, this.templates);
this.endCreateTime = (new Date()).getTime();
-
- // suspend some processing
- setTimeout(function() {
- this.startPostProcessTime = (new Date()).getTime();
-
- this.eventOnPostSort = new ClientUI.common.utils.CustomEvent('OnSort');
- this.eventOnPostScroll = new ClientUI.common.utils.CustomEvent('OnScroll');
-
- //var progress = new ClientUI.common.box.SplashBox(this.splash_id, null, 300, true);
- //this.setProgressCtrl(progress);
- Event.observe(this.eventOnSort, "on sort", this.onSorted.bindAsEventListener(this));
- if (this.options.selectionInput) {
- this.selectionManager = new ClientUI.controls.grid.SelectionManager(this);
- }
-
- this.endPostProcessTime = (new Date()).getTime();
- }.bind(this), 500);
-
- if(this.scroll_si.value !=''){
- var options = this.scroll_si.value.split(',');
- this.restoreScrollState(options[0],options[1],options[2]);
+
+ Event.observe(this.element, "grid:onsort", this.onSorted.bindAsEventListener(this));
+ if (this.options.selectionInput) {
+ this.selectionManager = new ClientUI.controls.grid.SelectionManager(this);
}
-
- var form = this.getForm($(this.client_id));
- Event.observe(form, "submit",this.restoreScrollPos.bindAsEventListener(this));
+ this.element.fire("grid:initialized");
+ this.getBody().restoreScrollState();
}
- },
-
- getForm: function(element){
- var node = element;
- if(node){
- while(node.tagName.toUpperCase() != 'FORM'){
- node = node.parentNode;
- }
- }
-
- return node;
},
onSortComplete : function(request, event, data){
+ this.dataModel.count = $(this.client_id + "_rows_input").value;
var options = request.getJSON("options");
Utils.AJAX.updateRows(options,request,
this,this.client_id,
[this.updateSelectionCallBack],
[function(){
this.selectionManager.restoreState();
- this.eventOnPostSort.fire(options.column, options.order);
+ this.element.fire("grid:onpostsort",{column: options.column, order:options.order});
}]);
this.updateLayout();
+ this.getBody().restoreScrollState();
},
onScrollComplete : function(request, event, data){
+ this.dataModel.count = $(this.client_id + "_rows_input").value;
var options = this.dataModel.getCurrentOptions();
window.loadingServerTime = (new Date()).getTime();
Utils.AJAX.updateRows(options,request,
@@ -102,9 +71,11 @@
[this.updateSelectionCallBack],
[function(){
this.selectionManager.restoreState();
- this.eventOnPostScroll.fire(this.getBody().currRange.start);
+ this.element.fire("grid:onpostscroll",{start:this.getBody().currRange.start});
}]);
+ this.updateLayout();
+ this.getBody().restoreScrollState();
window.loadingEndTime = (new Date()).getTime();
// TODO: remove this time statistic logging
@@ -115,8 +86,8 @@
ClientUILib.log(ClientUILogger.WARNING, "...Selection mng time: " + (window.loadingEndTime - window.loadingInvalidateTime));
},
- onSorted: function(sortEvent) {
- this.options.onSortAjaxUpdate(sortEvent);
+ onSorted: function(event) {
+ this.options.onSortAjaxUpdate(event.memo);
},
updateSelectionCallBack: function(argMap) {
@@ -151,45 +122,5 @@
this.getBody().hideColumn(index, frozen);
if(this.getFooter()) {this.getFooter().hideColumn(index, frozen);}
this.updateLayout();
- },
-
- restoreScrollState: function(scrollPos, start, end) {
-
- var body = this.getBody();
- body.scrollBox.getElement().scrollTop = scrollPos;
- body.currentPos = scrollPos;
- body.currRange.start = start;
- body.currRange.end = end;
- body._onContentVScroll(scrollPos);
- var visibleRowPos = body.currRange.start * body.defaultRowHeight;
- //setTimeout(function(){
- body.templFrozen.moveToY(visibleRowPos);
- body.templNormal.moveToY(visibleRowPos);
- //}, 500);
- },
-
- getScrollPos: function() {
- return this.getBody().currentPos;
- },
-
- restoreScrollPos: function(){
- var body = this.getBody();
- var start = body.currRange.start;
- var end = body.currRange.end;
- var index = this.getScrollPos();
- this.scroll_si.value = index + "," + start + "," + end;
}
-});
-
-Object.extend(ClientUI.controls.grid.ScrollableGrid.prototype, {
- /**
- * Occured when scroll position adjusted
- */
- eventOnPostScroll: {},
-
- /**
- * Occured when sorting adjusted
- */
- eventOnPostSort: {}
-
});
\ No newline at end of file
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Selection.js
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Selection.js 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/controls/grid/Selection.js 2007-12-19 18:12:29 UTC (rev 4931)
@@ -143,13 +143,12 @@
this.ranges = ranges;
},
- initRanges: function(rangesStr) {
- if(!rangesStr) {
+ initRanges: function(rangeStrRArray) {
+ if(rangeStrRArray.length == 0) {
this.ranges = [];
return;
}
- var rangeStrRArray = rangesStr.split(";");
- this.ranges = new Array(rangeStrRArray.length -1);
+ this.ranges = new Array(rangeStrRArray.length);
var indexStrRArray;
for(var i = 0; i < this.ranges.length; i++) {
indexStrRArray = rangeStrRArray[i].split(",");
@@ -201,6 +200,7 @@
this.grid = grid;
this.selectionFlag;
this.firstIndex;
+ this.activeRow = -1;
var gridElement = grid.getElement();
this.prefix = gridElement.id;
this.selection = new ClientUI.controls.grid.Selection();
@@ -214,6 +214,13 @@
this.setListeners();
this.eventKeyPress = this.processKeyDown.bindAsEventListener(this);
Event.observe(document, "keypress", this.eventKeyPress);
+ A4J.AJAX.AddListener({
+ onafterajax: function(req, event, data) {
+ if(!$(this.prefix + ":n")) {
+ Event.stopObserving(document, "keypress", this.eventKeyPress);
+ }
+ }.bind(this)
+ });
if (document.selection) {
Event.observe(gridElement, "click", this.resetSelection.bindAsEventListener(this));
}
@@ -239,7 +246,15 @@
restoreState: function() {
this.selectionFlag = null;
- this.selection.initRanges($(this.inputElement).value);
+ var selStrAr = $(this.inputElement).value.split(";");
+ if(selStrAr.length != 0) {
+ var activeRowStr = selStrAr[selStrAr.length - 1];
+ if(activeRowStr.indexOf(";") == -1) {
+ this.setActiveRow(activeRowStr);
+ selStrAr.pop();
+ }
+ }
+ this.selection.initRanges(selStrAr);
// this.firstIndex = Number($(this.prefix + ":f").rows[0].id.split(this.prefix)[1].split(":")[2]);;
var i = 0;
var j;
@@ -303,81 +318,83 @@
},
processKeyDown: function(event) {
- if(!event.shiftKey) {
- this.shiftRow = null;
- }
- var range, rowIndex;
- var activeRow = this.activeRow;
- var noDefault = false;
- this.firstIndex = Number($(this.prefix + ":n").rows[0].id.split(this.prefix)[1].split(":")[2]);;
- switch (event.keyCode || event.charCode) {
- case Event.KEY_UP:
- if (this.inFocus && activeRow != null) {
- if(this.firstIndex != activeRow) {
- rowIndex = (this.rowCount + activeRow - 1) % this.rowCount;
- if (!event.ctrlKey && !event.shiftKey) {
- this.selectionFlag = "x";
- range = [rowIndex, rowIndex];
- this.setSelection(range);
- } else if (!event.ctrlKey && event.shiftKey) {
- if(!this.shiftRow) {
- this.shiftRow = this.activeRow;
+ if ($(this.prefix + ":n").rows.length > 0) {
+ if(!event.shiftKey) {
+ this.shiftRow = null;
+ }
+ var range, rowIndex;
+ var activeRow = this.activeRow;
+ var noDefault = false;
+ this.firstIndex = Number($(this.prefix + ":n").rows[0].id.split(this.prefix)[1].split(":")[2]);;
+ switch (event.keyCode || event.charCode) {
+ case Event.KEY_UP:
+ if (this.inFocus && activeRow != null) {
+ if(this.firstIndex != activeRow) {
+ rowIndex = (this.rowCount + activeRow - 1) % this.rowCount;
+ if (!event.ctrlKey && !event.shiftKey) {
+ this.selectionFlag = "x";
+ range = [rowIndex, rowIndex];
+ this.setSelection(range);
+ } else if (!event.ctrlKey && event.shiftKey) {
+ if(!this.shiftRow) {
+ this.shiftRow = this.activeRow;
+ }
+ if(this.shiftRow >= this.activeRow) {
+ this.addRowToSelection(rowIndex);
+ } else {
+ this.removeRowFromSelection(activeRow);
+ }
}
- if(this.shiftRow >= this.activeRow) {
- this.addRowToSelection(rowIndex);
- } else {
- this.removeRowFromSelection(activeRow);
- }
+ noDefault = true;
+ this.setActiveRow(rowIndex);
+ } else {
+ this.grid.getBody().showRow("up");
}
- noDefault = true;
- this.setActiveRow(rowIndex);
- } else {
- this.grid.getBody().showRow("up");
}
- }
- break;
- case Event.KEY_DOWN:
- if (this.inFocus && activeRow != null) {
- rowIndex = (activeRow + 1) % this.rowCount;
- if(this.firstIndex != rowIndex) {
- if (!event.ctrlKey && !event.shiftKey) {
- this.selectionFlag = "x";
- range = [rowIndex, rowIndex];
- this.setSelection(range);
- } else if (!event.ctrlKey && event.shiftKey) {
- if(!this.shiftRow) {
- this.shiftRow = this.activeRow;
+ break;
+ case Event.KEY_DOWN:
+ if (this.inFocus && activeRow != null) {
+ rowIndex = (activeRow + 1) % this.rowCount;
+ if(this.firstIndex != rowIndex) {
+ if (!event.ctrlKey && !event.shiftKey) {
+ this.selectionFlag = "x";
+ range = [rowIndex, rowIndex];
+ this.setSelection(range);
+ } else if (!event.ctrlKey && event.shiftKey) {
+ if(!this.shiftRow) {
+ this.shiftRow = this.activeRow;
+ }
+ if(this.shiftRow <= this.activeRow) {
+ this.addRowToSelection(rowIndex);
+ } else {
+ this.removeRowFromSelection(activeRow);
+ }
}
- if(this.shiftRow <= this.activeRow) {
- this.addRowToSelection(rowIndex);
- } else {
- this.removeRowFromSelection(activeRow);
- }
+ noDefault = true;
+ this.setActiveRow(rowIndex);
+ } else {
+ this.grid.getBody().showRow("down");
}
+ }
+ break;
+ case 65: case 97: // Ctrl-A
+ if (this.inFocus && event.ctrlKey) {
+ this.selectionFlag = "a";
+ range = [0, this.rowCount];
+ this.setSelection(range);
noDefault = true;
- this.setActiveRow(rowIndex);
- } else {
- this.grid.getBody().showRow("down");
}
- }
- break;
- case 65: case 97: // Ctrl-A
- if (this.inFocus && event.ctrlKey) {
- this.selectionFlag = "a";
- range = [0, this.rowCount];
- this.setSelection(range);
- noDefault = true;
- }
- break;
- case Event.KEY_TAB:
- this.lostFocus();
+ break;
+ case Event.KEY_TAB:
+ this.lostFocus();
+ }
+ if (noDefault) {
+ this.grid.getBody().showRow(this.activeRow);
+ this.selectionChanged(event);
+ if (event.preventBubble) event.preventBubble();
+ Event.stop(event);
+ }
}
- if (noDefault) {
- this.grid.getBody().showRow(this.activeRow);
- this.selectionChanged(event);
- if (event.preventBubble) event.preventBubble();
- Event.stop(event);
- }
},
processClick: function(event, rowIndex) {
@@ -424,7 +441,7 @@
},
selectionChanged: function(event) {
- $(this.inputElement).value = this.selection.inspectRanges()+ (this.selectionFlag ? this.selectionFlag : "") ;
+ $(this.inputElement).value = this.selection.inspectRanges() + this.activeRow + ";" + (this.selectionFlag ? this.selectionFlag : "") ;
var state = this.selection.getState();
event.oldSelection = this.oldState;
event.newSelection = state;
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/layouts/LayoutManager.js
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/layouts/LayoutManager.js 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/javascript/ClientUI/layouts/LayoutManager.js 2007-12-19 18:12:29 UTC (rev 4931)
@@ -23,10 +23,6 @@
// declare event listeners
this.eventContainerResize = this.containerResize.bindAsEventListener(this);
- // Create custom event producers
- this.eventOnBeforeResize = new ClientUI.common.utils.CustomEvent('OnBeforeResize');
- this.eventOnAfterResize = new ClientUI.common.utils.CustomEvent('OnAfterResize');
-
this.registerEvents();
},
registerEvents: function() {
@@ -36,10 +32,7 @@
Event.stopObserving(window, "resize", this.eventContainerResize);
},
containerResize: function(event) {
- //Event.stop(event);
- this.eventOnBeforeResize.fire();
this.updateLayout();
- this.eventOnAfterResize.fire();
},
updateLayout: function($super) {
if(this.container) {
@@ -57,18 +50,4 @@
getContainer: function() {
return this.container;
}
-});
-
-Object.extend(ClientUI.layouts.LayoutManager.prototype, {
-
- // Custom events
- /**
- * Occured before resizing
- */
- eventOnBeforeResize: {},
- /**
- * Occured after resizing
- */
- eventOnAfterResize: {}
-
});
\ No newline at end of file
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/resources/org/richfaces/renderkit/html/css/scrollable-data-table.xcss
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/resources/org/richfaces/renderkit/html/css/scrollable-data-table.xcss 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/resources/org/richfaces/renderkit/html/css/scrollable-data-table.xcss 2007-12-19 18:12:29 UTC (rev 4931)
@@ -95,8 +95,6 @@
*/
.dr-sdt-hcbody {
white-space: nowrap;
- position: relative;
- display: block;
overflow: hidden;
width: 100%;
font-weight: normal;
@@ -151,8 +149,6 @@
font-weight: normal;
padding: 3px 5px;
white-space: nowrap;
- position: relative;
- display: block;
overflow: hidden;
}
@@ -161,8 +157,6 @@
font-weight: normal;
padding: 0px 0px;
white-space: nowrap;
- position: relative;
- display: block;
overflow: hidden;
width: 100%;
}
@@ -212,9 +206,6 @@
cursor: default;
font-weight: normal;
white-space: nowrap;
- padding: 0px 0px;
- position: relative;
- display: block;
overflow: hidden;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-footer-cell.jspx
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-footer-cell.jspx 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-footer-cell.jspx 2007-12-19 18:12:29 UTC (rev 4931)
@@ -12,11 +12,9 @@
>
<th class="dr-sdt-fc rich-sdt-footer-cell #{footerColumnClass} #{footerColumnSortClass} #{component.attributes['footerClass']}">
- <span id="#{client_id}:fc_#{cell_index}" class="dr-sdt-fcbody1">
- <span class="dr-sdt-fcbody">
- <vcp:body/>
- </span>
- </span>
+ <div id="#{client_id}:fc_#{cell_index}" class="dr-sdt-fcbody1">
+ <vcp:body/>
+ </div>
</th>
</f:root>
\ No newline at end of file
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table.jspx
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table.jspx 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table.jspx 2007-12-19 18:12:29 UTC (rev 4931)
@@ -64,174 +64,217 @@
variables.setVariable("hStyle", hStyle);
]]>
</jsp:scriptlet>
-
-
- <div id="#{clientId}" style="width: #{component.attributes['width']};height: #{component.attributes['height']};" class="dr-sdt rich-sdt #{component.attributes['styleClass']}" >
- <div id="#{clientId}:cs" class="dr-sdt-hsplit" style="display:none;"/>
- <div id="#{clientId}_GridHeaderTemplate" class="dr-sdt-inlinebox" style="#{hStyle}; width: #{component.attributes['width']};">
- <iframe id="#{clientId}:hs" class="dr-sdt-substrate" src="" scrolling="no" frameborder="0" > <br/> </iframe>
- <div style="display: block; left: 0px; top: 0px; width: #{sumWidth}px;">
- <span class="dr-sdt-tmplbox dr-sdt-fb" id="#{clientId}:header:FrozenBox">
- <table cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
+
+ <table id="#{clientId}" cellpadding="0" cellspacing="0" style="width: #{component.attributes['width']};height: #{component.attributes['height']};" class="dr-sdt rich-sdt #{component.attributes['styleClass']}" >
+ <tbody>
+ <jsp:scriptlet>
+ <![CDATA[
+ UIComponent facet = component.getFacet("header");
+ if (null != facet && facet .isRendered()) {
+ ]]>
+ </jsp:scriptlet>
+ <tr>
+ <td>
+ <u:insertFacet name="header" />
+ </td>
+ </tr>
+ <jsp:scriptlet>
+ <![CDATA[
+ }
+ ]]>
+ </jsp:scriptlet>
+ <tr>
+ <td style="height: 100%;">
+ <div id="#{clientId}:c" style="height: 100%;">
+ <div id="#{clientId}:cs" class="dr-sdt-hsplit" style="display: none;"/>
+ <div id="#{clientId}_GridHeaderTemplate" class="dr-sdt-inlinebox" style="#{hStyle}; width: #{component.attributes['width']};">
+ <iframe id="#{clientId}:hs" class="dr-sdt-substrate" src="" scrolling="no" frameborder="0" > <br/> </iframe>
+ <div style="display: block; left: 0px; top: 0px; width: #{sumWidth}px;">
+ <span class="dr-sdt-tmplbox dr-sdt-fb" id="#{clientId}:header:FrozenBox">
+ <table cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
+
+ <jsp:scriptlet>
+ <![CDATA[
+ renderCols(context, component, true);
+ ]]>
+ </jsp:scriptlet>
+
+ <thead>
+ <tr class="dr-sdt-hr rich-std-header-row #{component.attributes['headerClass']}">
+ <jsp:scriptlet>
+ <![CDATA[
+ renderHeaders(context, component, true);
+ ]]>
+ </jsp:scriptlet>
+ </tr>
+ </thead>
+ </table>
+ </span>
- <jsp:scriptlet>
- <![CDATA[
- renderCols(context, component, true);
- ]]>
- </jsp:scriptlet>
-
- <thead>
- <tr class="dr-sdt-hr rich-std-header-row #{component.attributes['headerClass']}">
- <jsp:scriptlet>
- <![CDATA[
- renderHeaders(context, component, true);
- ]]>
- </jsp:scriptlet>
- </tr>
- </thead>
- </table>
- </span>
-
- <span class="dr-sdt-tmplbox dr-sdt-nb" id="#{clientId}:header:NormalBox">
- <table cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
-
- <jsp:scriptlet>
- <![CDATA[
- renderCols(context, component, false);
- ]]>
- </jsp:scriptlet>
- <col width="1"/>
- <thead>
- <tr class="dr-sdt-hr rich-std-header-row #{component.attributes['headerClass']}">
- <jsp:scriptlet>
- <![CDATA[
- renderHeaders(context, component, false);
- ]]>
- </jsp:scriptlet>
- <th></th>
- </tr>
- </thead>
- </table>
- </span>
- </div>
- </div>
-
-
-
- <div id="#{clientId}_GridBodyTemplate" class="dr-sdt-inlinebox" style="overflow: auto; width: #{component.attributes['width']}; height: #{component.attributes['height']};">
- <div id="#{clientId}:scb" style="position: absolute; z-index: 0;">
- <div id="#{clientId}:sb" style="position: absolute;" ><br/> </div>
- </div>
- <div id="#{clientId}:bc" style="display: block; width: #{sumWidth}px;">
- <span class="dr-sdt-tmplbox dr-sdt-fb" id="#{clientId}:body:FrozenBox">
- <table id="#{clientId}:f" cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
+ <span class="dr-sdt-tmplbox dr-sdt-nb" id="#{clientId}:header:NormalBox">
+ <table cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
+
+ <jsp:scriptlet>
+ <![CDATA[
+ renderCols(context, component, false);
+ ]]>
+ </jsp:scriptlet>
+ <col width="1"/>
+ <thead>
+ <tr class="dr-sdt-hr rich-std-header-row #{component.attributes['headerClass']}">
+ <jsp:scriptlet>
+ <![CDATA[
+ renderHeaders(context, component, false);
+ ]]>
+ </jsp:scriptlet>
+ <th class="dr-sdt-hc rich-sdt-header-cell">
+ <div class="dr-sdt-hcbody" />
+ </th>
+ </tr>
+ </thead>
+ </table>
+ </span>
+ </div>
+ </div>
- <jsp:scriptlet>
- <![CDATA[
- renderCols(context, component, true);
- ]]>
- </jsp:scriptlet>
- <tbody>
- <jsp:scriptlet>
- <![CDATA[
- renderGridBody(context, component, true);
- ]]>
- </jsp:scriptlet>
- </tbody>
- </table>
- <span class="dr-sdt-ho" id="#{clientId}:fho" ><br/></span>
- </span>
- <span class="dr-sdt-tmplbox dr-sdt-nb" id="#{clientId}:body:NormalBox">
- <table id="#{clientId}:n" cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
+
+ <div id="#{clientId}_GridBodyTemplate" class="dr-sdt-inlinebox" style="overflow: auto; width: #{component.attributes['width']}; height: #{component.attributes['height']};">
+ <div id="#{clientId}:scb" style="position: absolute; z-index: 0;">
+ <div id="#{clientId}:sb" style="position: absolute;" ><br/> </div>
+ </div>
+ <div id="#{clientId}:bc" style="display: block; width: #{sumWidth}px;">
+ <span class="dr-sdt-tmplbox dr-sdt-fb" id="#{clientId}:body:FrozenBox">
+ <table id="#{clientId}:f" cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
+
+ <jsp:scriptlet>
+ <![CDATA[
+ renderCols(context, component, true);
+ ]]>
+ </jsp:scriptlet>
+ <tbody>
+ <jsp:scriptlet>
+ <![CDATA[
+ renderGridBody(context, component, true);
+ ]]>
+ </jsp:scriptlet>
+ </tbody>
+ </table>
+ <span class="dr-sdt-ho" id="#{clientId}:fho" ><br/></span>
+ </span>
+ <span class="dr-sdt-tmplbox dr-sdt-nb" id="#{clientId}:body:NormalBox">
+ <table id="#{clientId}:n" cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
+
+ <jsp:scriptlet>
+ <![CDATA[
+ renderCols(context, component, false);
+ ]]>
+ </jsp:scriptlet>
+ <col width="1"/>
+ <tbody>
+ <jsp:scriptlet>
+ <![CDATA[
+ renderGridBody(context, component, false);
+ ]]>
+ </jsp:scriptlet>
+ </tbody>
+ </table>
+ <span class="dr-sdt-ho" id="#{clientId}:nho" ><br/></span>
+ </span>
+ </div>
+ </div>
+
+ <div id="#{clientId}_GridFooterTemplate" class="dr-sdt-inlinebox" style="#{fStyle}; width: #{component.attributes['width']};">
+ <iframe id="#{clientId}:fs" class="dr-sdt-substrate" src="" scrolling="no" frameborder="0" > <br/></iframe>
+ <div style="display: block; width: width: #{sumWidth}px;">
+ <span class="dr-sdt-tmplbox dr-sdt-fb" id="#{clientId}:footer:FrozenBox">
+ <table cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
+
+ <jsp:scriptlet>
+ <![CDATA[
+ renderCols(context, component, true);
+ ]]>
+ </jsp:scriptlet>
+ <tfoot>
+ <tr class="dr-sdt-fr rich-std-footer-row #{component.attributes['footerClass']}">
+ <jsp:scriptlet>
+ <![CDATA[
+ renderFooters(context, component,true);
+ ]]>
+ </jsp:scriptlet>
+ </tr>
+ </tfoot>
+ </table>
+ </span>
+
+ <span class="dr-sdt-tmplbox dr-sdt-nb" id="#{clientId}:footer:NormalBox">
+ <table cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
+
+ <jsp:scriptlet>
+ <![CDATA[
+ renderCols(context, component, false);
+ ]]>
+ </jsp:scriptlet>
+ <col width="1"/>
+ <tfoot>
+ <tr class="dr-sdt-fr rich-std-footer-row #{component.attributes['footerClass']}">
+ <jsp:scriptlet>
+ <![CDATA[
+ renderFooters(context, component,false);
+ ]]>
+ </jsp:scriptlet>
+ <th class="dr-sdt-fc rich-sdt-footer-cell">
+ <div class="dr-sdt-fcbody1" />
+ </th>
+ </tr>
+ </tfoot>
+ </table>
+ </span>
+ </div>
+ </div>
+
+ <input type="hidden" name="#{clientId}_hc" id="#{clientId}_hc"/>
+ <input type="hidden" name="#{clientId}_state_input" id="#{clientId}_state_input"/>
+ <input type="hidden" name="#{clientId}_options_input" id="#{clientId}_options_input"/>
+ <input type="hidden" name="#{clienId}_rows_input" id="#{clientId}_rows_input" value="#{rows_count}"/>
+ <input type="button" name="#{clientId}_submit_input" id="#{clientId}_submit_input" onclick="#{this:getRowsAjaxUpdate(context,component)}" style="display:none"/>
<jsp:scriptlet>
- <![CDATA[
- renderCols(context, component, false);
+ <![CDATA[
+ renderHiddenScrollInput(context, component);
]]>
- </jsp:scriptlet>
- <col width="1"/>
- <tbody>
- <jsp:scriptlet>
- <![CDATA[
- renderGridBody(context, component, false);
- ]]>
- </jsp:scriptlet>
- </tbody>
- </table>
- <span class="dr-sdt-ho" id="#{clientId}:nho" ><br/></span>
- </span>
- </div>
- </div>
-
- <div id="#{clientId}_GridFooterTemplate" class="dr-sdt-inlinebox" style="#{fStyle}; width: #{component.attributes['width']};">
- <iframe id="#{clientId}:fs" class="dr-sdt-substrate" src="" scrolling="no" frameborder="0" > <br/></iframe>
- <div style="display: block; width: width: #{sumWidth}px;">
- <span class="dr-sdt-tmplbox dr-sdt-fb" id="#{clientId}:footer:FrozenBox">
- <table cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
+ </jsp:scriptlet>
- <jsp:scriptlet>
- <![CDATA[
- renderCols(context, component, true);
- ]]>
- </jsp:scriptlet>
- <tfoot>
- <tr class="dr-sdt-fr rich-std-footer-row #{component.attributes['footerClass']}">
- <jsp:scriptlet>
- <![CDATA[
- renderFooters(context, component,true);
- ]]>
- </jsp:scriptlet>
- </tr>
- </tfoot>
- </table>
- </span>
+ <f:call name="contributorsEncodeHere"/>
+ <script id="#{clientId}_grid_create_scripts" type="text/javascript">
+ //<![CDATA[
+
+ #{this:getJavaScriptVarName(context, component)} = #{this:createClientScrollableGrid(context, component)};
+ #{this:getScriptContributions(context, component)};
- <span class="dr-sdt-tmplbox dr-sdt-nb" id="#{clientId}:footer:NormalBox">
- <table cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
-
- <jsp:scriptlet>
- <![CDATA[
- renderCols(context, component, false);
- ]]>
- </jsp:scriptlet>
- <col width="1"/>
- <tfoot>
- <tr class="dr-sdt-fr rich-std-footer-row #{component.attributes['footerClass']}">
- <jsp:scriptlet>
- <![CDATA[
- renderFooters(context, component,false);
- ]]>
- </jsp:scriptlet>
- <th></th>
- </tr>
- </tfoot>
- </table>
- </span>
- </div>
- </div>
-
- <input type="hidden" name="#{clientId}_hc" id="#{clientId}_hc"/>
- <input type="hidden" name="#{clientId}_state_input" id="#{clientId}_state_input"/>
- <input type="hidden" name="#{clientId}_options_input" id="#{clientId}_options_input"/>
- <input type="hidden" name="#{clienId}_rows_input" id="#{clientId}_rows_input" value="#{rows_count}"/>
- <input type="button" name="#{clientId}_submit_input" id="#{clientId}_submit_input" onclick="#{this:getRowsAjaxUpdate(context,component)}" style="display:none"/>
- <jsp:scriptlet>
- <![CDATA[
- renderHiddenScrollInput(context, component);
- ]]>
- </jsp:scriptlet>
-
- <f:call name="contributorsEncodeHere"/>
- <script id="#{clientId}_grid_create_scripts" type="text/javascript">
- //<![CDATA[
-
- #{this:getJavaScriptVarName(context, component)} = #{this:createClientScrollableGrid(context, component)};
- #{this:getScriptContributions(context, component)};
-
- // ]]>
- </script>
- <f:call name="tearDownState"/>
- </div>
+ // ]]>
+ </script>
+ <f:call name="tearDownState"/>
+ </div>
+ </td>
+ </tr>
+ <jsp:scriptlet>
+ <![CDATA[
+ facet = component.getFacet("footer");
+ if (null != facet && facet .isRendered()) {
+ ]]>
+ </jsp:scriptlet>
+ <tr>
+ <td>
+ <u:insertFacet name="footer" />
+ </td>
+ </tr>
+ <jsp:scriptlet>
+ <![CDATA[
+ }
+ ]]>
+ </jsp:scriptlet>
+ </tbody>
+ </table>
</f:root>
Modified: branches/3.1.x/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/ScrollableDataTableRendererTest.java
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/ScrollableDataTableRendererTest.java 2007-12-19 18:00:05 UTC (rev 4930)
+++ branches/3.1.x/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/ScrollableDataTableRendererTest.java 2007-12-19 18:12:29 UTC (rev 4931)
@@ -35,6 +35,7 @@
javaScripts.add(PrototypeScript.class.getName());
javaScripts.add("org/richfaces/renderkit/html/scripts/scrollable-data-table.js");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/extend/extend.js");
}
public ScrollableDataTableRendererTest(String arg0) {
16 years, 9 months
JBoss Rich Faces SVN: r4930 - trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-12-19 13:00:05 -0500 (Wed, 19 Dec 2007)
New Revision: 4930
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js
Log:
change applying cursor style mechanism
Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js 2007-12-19 17:37:23 UTC (rev 4929)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js 2007-12-19 18:00:05 UTC (rev 4930)
@@ -72,12 +72,12 @@
if (this.element.style.cursor && this.element.style.cursor != "") {
//save cursor if exist
this.oldcursor = this.element.style.cursor;
- }
+ }
},
showCursor: function() {
var parent = this.element;
- Element.setStyle(parent,this.cursor);
+ this.element.style.cursor = this.cursor;
this.visible = true;
},
@@ -87,10 +87,9 @@
this.visible = false;
if (this.oldcursor) {
//restore saved cursor
- Element.setStyle(parent,"cursor: " + this.oldcursor);
+ this.element.style.cursor = this.oldcursor;
}
}
-
};
DnD.Draggable.prototype = {
Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js 2007-12-19 17:37:23 UTC (rev 4929)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js 2007-12-19 18:00:05 UTC (rev 4930)
@@ -80,7 +80,7 @@
var cursor = this.getCursorForType(drag.type);
if (cursor) {
// show resolved cursor
- this.acceptMappingCursor = new DnD.Cursor(this.getElement(), "cursor: " + cursor);
+ this.acceptMappingCursor = new DnD.Cursor(this.getElement(), cursor);
this.acceptMappingCursor.showCursor();
} else if(this.acceptCursor) {
// show default cursor
16 years, 9 months
JBoss Rich Faces SVN: r4929 - trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-12-19 12:37:23 -0500 (Wed, 19 Dec 2007)
New Revision: 4929
Modified:
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java
Log:
fix grab, grabbing options
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java
===================================================================
--- trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java 2007-12-19 16:55:48 UTC (rev 4928)
+++ trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java 2007-12-19 17:37:23 UTC (rev 4929)
@@ -79,12 +79,12 @@
String grab = draggable.getGrabCursors();
if (!grab.equals("")) {
- addOption("grab", "cursor: " + grab);
+ addOption("grab", grab);
}
String grabbing = draggable.getGrabbingCursors();
if (!grabbing.equals("")) {
- addOption("grabbing","cursor: " + grabbing);
+ addOption("grabbing",grabbing);
}
addEventHandler("ondragstart", draggable.getOndragstart());
16 years, 9 months
JBoss Rich Faces SVN: r4928 - in trunk/ui: inputnumber-slider/src/main/templates and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-12-19 11:55:48 -0500 (Wed, 19 Dec 2007)
New Revision: 4928
Modified:
trunk/ui/calendar/design/calendar-js/calendar-xhtml.html
trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
trunk/ui/simpleTogglePanel/src/main/templates/simpleTogglePanel.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1680
Modified: trunk/ui/calendar/design/calendar-js/calendar-xhtml.html
===================================================================
--- trunk/ui/calendar/design/calendar-js/calendar-xhtml.html 2007-12-19 16:33:14 UTC (rev 4927)
+++ trunk/ui/calendar/design/calendar-js/calendar-xhtml.html 2007-12-19 16:55:48 UTC (rev 4928)
@@ -48,7 +48,7 @@
function createCalendar()
{
//var cellMarkup = '\'<div style="width:50%; float:left; disply:inline; border-bottom:1px solid #e0e0e0;"> </div><div style="width:50%; float:left; disply:inline; border-bottom:1px solid #e0e0e0;">\'+day+\'</div><div style="width:50%;float:left; disply:inline; border-bottom:1px solid #e0e0e0;"></div><div style="width:50%; float:left; disply:inline; border-bottom:1px solid #e0e0e0;"></div><div style="width:100%; border-bottom:1px solid #e0e0e0;">\'+text1+\'</div><div style="width:100%">\'+text2+\'</div>\'';
- //var cellMarkup = '\'<table><tr><td> </td><td>\'+ev("day")+\'</td></tr><tr><td> </td><td> </td></tr><tr><td colspan="2">\'+ev("text1")+\'</td></tr><tr><td colspan="2">\'+ev("text2")+\'</td></tr></table>\'';
+ //var cellMarkup = '\'<table><tr><td> </td><td>\'+ev("day")+\'</td></tr><tr><td> </td><td> </td></tr><tr><td colspan="2">\'+ev("text1")+\'</td></tr><tr><td colspan="2">\'+ev("text2")+\'</td></tr></table>\'';
cellMarkup = function (obj) {
m1 = Richfaces.evalMacro('day',obj);
m2 = Richfaces.evalMacro('text1',obj);
Modified: trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
===================================================================
--- trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2007-12-19 16:33:14 UTC (rev 4927)
+++ trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2007-12-19 16:55:48 UTC (rev 4928)
@@ -147,12 +147,12 @@
<div style="position : relative">
<div id="#{clientId}Tip" class="dr-insldr-tip rich-inslider-tip #{component.attributes['tipClass']}" style="display: none;#{component.attributes['tipStyle']}">
<jsp:scriptlet><![CDATA[
- writer.write(" ");
+ writer.write(" ");
]]></jsp:scriptlet>
</div>
<div class="dr-insldr-handler rich-inslider-handler #{component.attributes['handleClass']}" id="#{clientId}Handle">
<jsp:scriptlet><![CDATA[
- writer.write(" ");
+ writer.write(" ");
]]></jsp:scriptlet>
</div>
</div>
Modified: trunk/ui/simpleTogglePanel/src/main/templates/simpleTogglePanel.jspx
===================================================================
--- trunk/ui/simpleTogglePanel/src/main/templates/simpleTogglePanel.jspx 2007-12-19 16:33:14 UTC (rev 4927)
+++ trunk/ui/simpleTogglePanel/src/main/templates/simpleTogglePanel.jspx 2007-12-19 16:55:48 UTC (rev 4928)
@@ -74,7 +74,7 @@
]]></jsp:scriptlet>
#{component.attributes['label']}
<jsp:scriptlet><![CDATA[
- writer.write(" ");
+ writer.write(" ");
}
]]></jsp:scriptlet>
</div>
16 years, 9 months
JBoss Rich Faces SVN: r4927 - in trunk/ui: tabPanel/src/main/java/org/richfaces/renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-12-19 11:33:14 -0500 (Wed, 19 Dec 2007)
New Revision: 4927
Modified:
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabRendererBase.java
Log:
http://jira.jboss.com/jira/browse/RF-1680
Modified: trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2007-12-19 16:17:42 UTC (rev 4926)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2007-12-19 16:33:14 UTC (rev 4927)
@@ -153,7 +153,7 @@
writer.writeAttribute("width", "1", null);
writer.writeAttribute("height", "1", null);
writer.writeAttribute("style", width!=null && width.length() > 0 ? "width: " + HtmlUtil.qualifySize(width) : "", null);
- writer.write(" ");
+ writer.write(" ");
writer.endElement("div");
writer.endElement("div");
Modified: trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabRendererBase.java
===================================================================
--- trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabRendererBase.java 2007-12-19 16:17:42 UTC (rev 4926)
+++ trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabRendererBase.java 2007-12-19 16:33:14 UTC (rev 4927)
@@ -113,7 +113,7 @@
renderChildren(context, component);
} else {
ResponseWriter out = context.getResponseWriter();
- out.write(" ");
+ out.write(" ");
}
}
}
16 years, 9 months
JBoss Rich Faces SVN: r4926 - in trunk: cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-12-19 11:17:42 -0500 (Wed, 19 Dec 2007)
New Revision: 4926
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/AbstractCompilationContext.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/CompilationContext.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el/ELCompiler.java
trunk/cdk/maven-javascript-plugin/
trunk/docs/faq/en/
trunk/extensions/portletbridge/portletbridge-impl/
trunk/ui/componentControl/src/main/java/org/richfaces/component/UIComponentControl.java
Log:
more thorough property resolution
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/AbstractCompilationContext.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/AbstractCompilationContext.java 2007-12-19 16:06:59 UTC (rev 4925)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/AbstractCompilationContext.java 2007-12-19 16:17:42 UTC (rev 4926)
@@ -28,9 +28,13 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.ajax4jsf.builder.config.ClassVisitor;
+import org.ajax4jsf.builder.config.ClassWalkingLogic;
import org.ajax4jsf.templatecompiler.elements.A4JRendererElementsFactory;
import org.ajax4jsf.templatecompiler.elements.ElementsFactory;
import org.ajax4jsf.templatecompiler.elements.TemplateElement;
@@ -79,7 +83,10 @@
private String[] EncodeChildren;
- private HashMap<String, Class> variables = new HashMap<String, Class>();
+ private Map<String, Map<String, PropertyDescriptor>> resolvedProperties =
+ new HashMap<String, Map<String,PropertyDescriptor>>();
+
+ private HashMap<String, Class<?>> variables = new HashMap<String, Class<?>>();
private static String[] defaultImports = new String[] {
"java.util.Iterator", "java.util.Collection",
@@ -92,7 +99,7 @@
private TemplateElement tree;
- private ArrayList<ElementsFactory> elementFactories = new ArrayList<ElementsFactory>();
+ private List<ElementsFactory> elementFactories = new ArrayList<ElementsFactory>();
/**
@@ -312,14 +319,14 @@
addVariable(variableName, "java.lang.String");
}
- public void addVariable(String variableName, Class clazz) {
+ public void addVariable(String variableName, Class<?> clazz) {
this.variables.put(variableName, clazz);
}
public void addVariable(String variableName, String typeName)
throws CompilationException {
try {
- Class clazz = loadClass(typeName);
+ Class<?> clazz = loadClass(typeName);
this.variables.put(variableName, clazz);
} catch (ClassNotFoundException e) {
// error("Error create variable "+variableName+" with type "+typeName, e);
@@ -331,12 +338,12 @@
return this.variables.containsKey(variableName);
}
- public Class getVariableType(String variableName) {
+ public Class<?> getVariableType(String variableName) {
return this.variables.get(variableName);
}
- public Class loadClass(String className) throws ClassNotFoundException {
- Class clazz = null;
+ public Class<?> loadClass(String className) throws ClassNotFoundException {
+ Class<?> clazz = null;
try {
clazz = this.classLoader.loadClass(className);
} catch (ClassNotFoundException e) {
@@ -362,9 +369,9 @@
"org.ajax4jsf.renderkit.ComponentVariables");
}
- public Class getMethodReturnedClass(Class clazz, String methodName,
- Class[] parametersTypes) {
- Class returnedType = null;
+ public Class<?> getMethodReturnedClass(Class<?> clazz, String methodName,
+ Class<?>[] parametersTypes) {
+ Class<?> returnedType = null;
log.debug("class : " + clazz.getName() + "\n\t method : "
+ methodName + "\n\t paramTypes : "
+ Arrays.asList(parametersTypes).toString());
@@ -383,24 +390,36 @@
return returnedType;
}
- public PropertyDescriptor getPropertyDescriptor(Class clazz,
+ public PropertyDescriptor getPropertyDescriptor(Class<?> clazz,
String propertyName) {
- PropertyDescriptor returnValue = null;
+
+ Map<String, PropertyDescriptor> descriptors =
+ resolvedProperties.get(clazz.getName());
+
+ if (descriptors == null) {
+ descriptors = resolveProperties(clazz);
+ resolvedProperties.put(clazz.getName(), descriptors);
+ }
+
+
+ return descriptors.get(propertyName);
+ }
- PropertyDescriptor[] propertyDescriptors = PropertyUtils
- .getPropertyDescriptors(clazz);
-
- for (int i = 0; i < propertyDescriptors.length; i++) {
- PropertyDescriptor descriptor = propertyDescriptors[i];
- if (descriptor.getName().equals(propertyName)) {
- returnValue = descriptor;
- break;
+ private Map<String, PropertyDescriptor> resolveProperties(Class<?> clazz) {
+ final Map<String, PropertyDescriptor> descriptors =
+ new HashMap<String, PropertyDescriptor>();
+
+ new ClassWalkingLogic(clazz).walk(new ClassVisitor() {
+ public void visit(Class<?> clazz) {
+ PropertyDescriptor[] pds = PropertyUtils.getPropertyDescriptors(clazz);
+ for (PropertyDescriptor descriptor : pds) {
+ descriptors.put(descriptor.getName(), descriptor);
+ }
}
- }
-
- return returnValue;
+ });
+ return descriptors;
}
-
+
/**
*
*/
@@ -497,5 +516,9 @@
throw new CompilationException(e.getLocalizedMessage());
}
return out.toString();
- }
+ }
+
+ public Map<String, Map<String, PropertyDescriptor>> getResolvedProperties() {
+ return resolvedProperties;
+ }
}
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/CompilationContext.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/CompilationContext.java 2007-12-19 16:06:59 UTC (rev 4925)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/CompilationContext.java 2007-12-19 16:17:42 UTC (rev 4926)
@@ -102,23 +102,23 @@
*/
public void addVariable(String variableName) throws CompilationException;
- public void addVariable(String variableName, Class clazz);
+ public void addVariable(String variableName, Class<?> clazz);
public void addVariable(String variableName, String typeName)
throws CompilationException;
public boolean containsVariable(String variableName);
- public Class getVariableType(String variableName);
+ public Class<?> getVariableType(String variableName);
public void setDefaultVariables() throws CompilationException;
- public Class loadClass(String className) throws ClassNotFoundException;
+ public Class<?> loadClass(String className) throws ClassNotFoundException;
- public Class getMethodReturnedClass(Class clazz, String methodName,
- Class[] parametersTypes);
+ public Class<?> getMethodReturnedClass(Class<?> clazz, String methodName,
+ Class<?>[] parametersTypes);
- public PropertyDescriptor getPropertyDescriptor(Class clazz,
+ public PropertyDescriptor getPropertyDescriptor(Class<?> clazz,
String propertyName);
public TemplateElement getTree();
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el/ELCompiler.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el/ELCompiler.java 2007-12-19 16:06:59 UTC (rev 4925)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el/ELCompiler.java 2007-12-19 16:17:42 UTC (rev 4926)
@@ -24,14 +24,13 @@
import java.beans.PropertyDescriptor;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import javax.el.PropertyNotFoundException;
import org.ajax4jsf.templatecompiler.builder.CompilationContext;
import org.ajax4jsf.templatecompiler.builder.StringUtils;
-import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -78,7 +77,7 @@
private static final Log log = LogFactory.getLog(ELCompiler.class);
- Map functionsMap = new HashMap();
+ Map<String, String> functionsMap = new HashMap<String,String>();
static {
}
@@ -598,29 +597,16 @@
* @param propertyName
* @return
*/
- private PropertyDescriptor getPropertyDescriptor(Class clazz,
- String propertyName) {
- PropertyDescriptor returnValue = null;
-
- PropertyDescriptor[] propertyDescriptors = PropertyUtils
- .getPropertyDescriptors(clazz);
-
- for (int i = 0; i < propertyDescriptors.length; i++) {
- PropertyDescriptor descriptor = propertyDescriptors[i];
- if (descriptor.getName().equals(propertyName)) {
- returnValue = descriptor;
- break;
- }
- }
-
- return returnValue;
+ private PropertyDescriptor getPropertyDescriptor(Class<?> clazz,
+ String propertyName, CompilationContext compilationContext) {
+ return compilationContext.getPropertyDescriptor(clazz, propertyName);
}
private boolean processingValue(AstValue node, StringBuffer sb,
CompilationContext componentBean) {
- String lastIndexValue = "NULL";
+ String lastIndexValue = "null";
String lastVariableType = null;
- ArrayList names = new ArrayList();
+ List<String> names = new ArrayList<String>();
for (int i = 0; i < node.jjtGetNumChildren(); i++) {
StringBuffer sb1 = new StringBuffer();
@@ -644,10 +630,10 @@
if (lastVariableType != null) {
try {
- Class clazz = componentBean.loadClass(lastVariableType);
+ Class<?> clazz = componentBean.loadClass(lastVariableType);
PropertyDescriptor propertyDescriptor = getPropertyDescriptor(
- clazz, propertyName);
+ clazz, propertyName, componentBean);
if (propertyDescriptor == null) {
throw new PropertyNotFoundException("property: "
@@ -714,8 +700,7 @@
if (names.size() != 0) {
StringBuffer tmpbuf = new StringBuffer();
- for (Iterator iter = names.iterator(); iter.hasNext();) {
- String element = (String) iter.next();
+ for (String element : names) {
if (tmpbuf.length() != 0) {
tmpbuf.append(".");
}
Property changes on: trunk/cdk/maven-javascript-plugin
___________________________________________________________________
Name: svn:ignore
- target
+ target
.classpath
.project
.settings
Property changes on: trunk/docs/faq/en
___________________________________________________________________
Name: svn:ignore
- target
+ target
.project
.settings
Property changes on: trunk/extensions/portletbridge/portletbridge-impl
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Modified: trunk/ui/componentControl/src/main/java/org/richfaces/component/UIComponentControl.java
===================================================================
--- trunk/ui/componentControl/src/main/java/org/richfaces/component/UIComponentControl.java 2007-12-19 16:06:59 UTC (rev 4925)
+++ trunk/ui/componentControl/src/main/java/org/richfaces/component/UIComponentControl.java 2007-12-19 16:17:42 UTC (rev 4926)
@@ -175,7 +175,4 @@
public abstract void setAttachTiming( String attachTiming);
public abstract String getAttachTiming();
-
- public abstract void setDisableDefault(boolean attachTiming);
- public abstract boolean isDisableDefault();
}
16 years, 9 months
JBoss Rich Faces SVN: r4925 - in trunk/ui/calendar/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-12-19 11:06:59 -0500 (Wed, 19 Dec 2007)
New Revision: 4925
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
RF-1671
Modified: trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-12-19 15:32:07 UTC (rev 4924)
+++ trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-12-19 16:06:59 UTC (rev 4925)
@@ -575,7 +575,7 @@
writer.writeText("close:'"+closeLabel+"'", null);
} catch (MissingResourceException e) {
// Current key wasn't found in bundle, use default
- writer.writeText("close:'X'", null);
+ writer.writeText("close:'x'", null);
}
}else{
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-12-19 15:32:07 UTC (rev 4924)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-12-19 16:06:59 UTC (rev 4925)
@@ -366,7 +366,7 @@
if (ch=='d') {d=counter; counter++; return '(\\d{2})'};
}
);
-
+
var re = new RegExp(pattern,'i');
var match = dateString.match(re);
if (match!=null)
@@ -403,41 +403,42 @@
Richfaces.Calendar.formatDate = function(date, pattern, monthNames, monthNamesShort) {
if (!monthNames) monthNames = Richfaces.Calendar.getDefaultMonthNames();
if (!monthNamesShort) monthNamesShort = Richfaces.Calendar.getDefaultMonthNames(true);
- var mm; var dd; var hh;
- var result = pattern.replace(/(^|[^\\yMdHhm])(y+|M+|d+|a|H{1,2}|h{1,2}|m{2})/g,
+ var mm; var dd; var hh; var min;
+ var result = pattern.replace(/(\\\\|\\[yMdaHhm])|(y+|M+|d+|a|H{1,2}|h{1,2}|m{2})/g,
function($1,$2,$3) {
+ if ($2.length!=0) return $2.charAt(1);
switch ($3) {
case 'y':
- case 'yy': return $2+date.getYear().toString().slice(-2);
- case 'M': return $2+(date.getMonth()+1);
- case 'MM': return $2+((mm = date.getMonth()+1)<10 ? '0'+mm : mm);
- case 'MMM': return $2+monthNamesShort[date.getMonth()];
- case 'd': return $2+date.getDate();
- case 'a' : return $2+(date.getHours()<12 ? 'AM' : 'PM');
- case 'HH' : return $2+((hh = date.getHours())<10 ? '0'+hh : hh);
- case 'H' : return $2+date.getHours();
- case 'hh' : return $2+((hh = date.getHours())==0 ? '12' : (hh<10 ? '0'+hh : (hh>12 ? hh-12 : hh)));
- case 'h' : return $2+((hh = date.getHours())==0 ? '12' : (hh>12 ? hh-12 : hh));
- case 'mm' : return $2+((min = date.getMinutes())<10 ? '0'+min : min);
+ case 'yy': return date.getYear().toString().slice(-2);
+ case 'M': return (date.getMonth()+1);
+ case 'MM': return ((mm = date.getMonth()+1)<10 ? '0'+mm : mm);
+ case 'MMM': return monthNamesShort[date.getMonth()];
+ case 'd': return date.getDate();
+ case 'a' : return (date.getHours()<12 ? 'AM' : 'PM');
+ case 'HH' : return ((hh = date.getHours())<10 ? '0'+hh : hh);
+ case 'H' : return date.getHours();
+ case 'hh' : return ((hh = date.getHours())==0 ? '12' : (hh<10 ? '0'+hh : (hh>12 ? hh-12 : hh)));
+ case 'h' : return ((hh = date.getHours())==0 ? '12' : (hh>12 ? hh-12 : hh));
+ case 'mm' : return ((min = date.getMinutes())<10 ? '0'+min : min);
}
// y+,M+,d+
var ch = $3.charAt(0);
- if (ch=='y') return $2+date.getFullYear();
- if (ch=='M') return $2+monthNames[date.getMonth()];
- if (ch=='d') return $2+((dd = date.getDate())<10 ? '0'+dd : dd);
+ if (ch=='y') return date.getFullYear();
+ if (ch=='M') return monthNames[date.getMonth()];
+ if (ch=='d') return ((dd = date.getDate())<10 ? '0'+dd : dd);
}
);
- return Richfaces.Calendar.unescape(result);
+ return result;
};
Richfaces.Calendar.escape = function (str)
{
- return str.replace(/([yMdaHhm])/g,"\\$1");
+ return str.replace(/([yMdaHhm\\])/g,"\\$1");
};
Richfaces.Calendar.unescape = function (str)
{
- return str.replace(/\\([yMdaHhm])/g,"$1");
+ return str.replace(/\\([yMdaHhm\\])/g,"$1");
};
@@ -820,10 +821,11 @@
var dateTimePattern = this.params.datePattern;
var pattern = [];
- var re = /(^|[^\\yMdHhm])(y+|M+|d+|a|H{1,2}|h{1,2}|m{2})/g;
+ var re = /(\\\\|\\[yMdaHhm])|(y+|M+|d+|a|H{1,2}|h{1,2}|m{2})/g;
var r;
while (r = re.exec(dateTimePattern))
- pattern.push({str:r[0],marker:r[2],pref:r[1],idx:r.index});
+ if (!r[1])
+ pattern.push({str:r[0],marker:r[2],idx:r.index});
var datePattern = "";
var timePattern = "";
@@ -870,20 +872,21 @@
var calendar = this;
- this.timePatternHtml = timePattern.replace(/(^|[^\\Hhm])(H{1,2}|h{1,2}|m{2}|a)/g,
+ this.timePatternHtml = timePattern.replace(/(\\\\|\\[yMdaHhm])|(H{1,2}|h{1,2}|m{2}|a)/g,
function($1,$2,$3) {
+ if ($2.length!=0) return $2.charAt(1);
switch ($3) {
- case 'a' : return ($2 ? '<td>'+$2+'</td>' : '')+'<td>'+calendar.createSpinnerTable(id+'TimeSign')+'</td>';//'<input class="rich-calendar-time-input" id="'+id+'TimeSign"/>';
+ case 'a' : return '</td><td>'+calendar.createSpinnerTable(id+'TimeSign')+'</td><td>';
case 'H' :
case 'HH' :
case 'h' :
- case 'hh' : return ($2 ? '<td>'+$2+'</td>' : '')+'<td>'+calendar.createSpinnerTable(id+'TimeHours')+'</td>';//'<input class="rich-calendar-time-input" id="'+id+'TimeHours"/>';
- case 'mm' : return ($2 ? '<td>'+$2+'</td>' : '')+'<td>'+calendar.createSpinnerTable(id+'TimeMinutes')+'</td>';//'<input class="rich-calendar-time-input" id="'+id+'TimeMinutes"/>';
+ case 'hh' : return '</td><td>'+calendar.createSpinnerTable(id+'TimeHours')+'</td><td>';
+ case 'mm' : return '</td><td>'+calendar.createSpinnerTable(id+'TimeMinutes')+'</td><td>';
}
}
);
- this.timePatternHtml = '<table><tbody><tr>'+this.timePatternHtml+'</tr></tbody></table>';
+ this.timePatternHtml = '<table border="0" cellpadding="0"><tbody><tr><td>'+this.timePatternHtml+'</td></tr></tbody></table>';
if (m && h)
{
16 years, 9 months