JBoss Rich Faces SVN: r20474 - in modules/tests/metamer/trunk/application/src/main/webapp/components: richCollapsibleSubTable and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-12-09 06:23:01 -0500 (Thu, 09 Dec 2010)
New Revision: 20474
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components2.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components2.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components2.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components2.xhtml
Log:
* fixed event for calendar inside tables
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components2.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components2.xhtml 2010-12-09 10:50:23 UTC (rev 20473)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components2.xhtml 2010-12-09 11:23:01 UTC (rev 20474)
@@ -148,7 +148,7 @@
</f:facet>
<rich:calendar id="birthdate" value="#{record.birthdate}">
- <a4j:ajax event="inputchange" render="@this"/>
+ <a4j:ajax event="change" render="@this"/>
</rich:calendar>
<f:facet name="footer">
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components2.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components2.xhtml 2010-12-09 10:50:23 UTC (rev 20473)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/components2.xhtml 2010-12-09 11:23:01 UTC (rev 20474)
@@ -129,7 +129,7 @@
</rich:column>
<rich:column id="columnBirthdate">
<rich:calendar id="birthdate" value="#{item.birthdate}">
- <a4j:ajax event="inputchange" render="@this"/>
+ <a4j:ajax event="change" render="@this"/>
</rich:calendar>
</rich:column>
<rich:column id="columnCompanies">
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components2.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components2.xhtml 2010-12-09 10:50:23 UTC (rev 20473)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components2.xhtml 2010-12-09 11:23:01 UTC (rev 20474)
@@ -139,7 +139,7 @@
</f:facet>
<rich:calendar id="birthdate" value="#{record.birthdate}">
- <a4j:ajax event="inputchange" render="@this"/>
+ <a4j:ajax event="change" render="@this"/>
</rich:calendar>
<f:facet name="footer">
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components2.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components2.xhtml 2010-12-09 10:50:23 UTC (rev 20473)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components2.xhtml 2010-12-09 11:23:01 UTC (rev 20474)
@@ -187,7 +187,7 @@
</f:facet>
<rich:calendar id="birthdate" value="#{record.birthdate}">
- <a4j:ajax event="inputchange" render="@this"/>
+ <a4j:ajax event="change" render="@this"/>
</rich:calendar>
<f:facet name="footer">
14 years, 1 month
JBoss Rich Faces SVN: r20473 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richCalendar and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-12-09 05:50:23 -0500 (Thu, 09 Dec 2010)
New Revision: 20473
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/CalendarModel.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/CalendarModelItem.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/dataModel.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/simple.xhtml
Log:
https://jira.jboss.org/browse/RF-9178
* added new sample for calendar with data model
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/CalendarModel.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/CalendarModel.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/CalendarModel.java 2010-12-09 10:50:23 UTC (rev 20473)
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.model;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+import javax.faces.bean.ApplicationScoped;
+import javax.faces.bean.ManagedBean;
+
+import org.richfaces.model.CalendarDataModel;
+import org.richfaces.model.CalendarDataModelItem;
+
+/**
+ * Managed bean with calendar's model.
+ *
+ * @author Ilya Shaikovsky, Exadel
+ * @version $Revision$
+ */
+@ManagedBean
+@ApplicationScoped
+public class CalendarModel implements CalendarDataModel {
+
+ private static final String WEEKEND_DAY_CLASS = "yellowDay";
+ private static final String BUSY_DAY_CLASS = "aquaDay";
+ private static final String BOUNDARY_DAY_CLASS = "rf-ca-boundary-dates";
+
+ private boolean checkBusyDay(Calendar calendar) {
+ return (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.TUESDAY || calendar.get(Calendar.DAY_OF_WEEK) == Calendar.THURSDAY);
+ }
+
+ private boolean checkWeekend(Calendar calendar) {
+ return (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY);
+ }
+
+ public CalendarDataModelItem[] getData(Date[] dateArray) {
+ CalendarDataModelItem[] modelItems = new CalendarModelItem[dateArray.length];
+ Calendar current = GregorianCalendar.getInstance();
+ Calendar today = GregorianCalendar.getInstance();
+ today.setTime(new Date());
+ for (int i = 0; i < dateArray.length; i++) {
+ current.setTime(dateArray[i]);
+ CalendarModelItem modelItem = new CalendarModelItem();
+ if (current.before(today)) {
+ modelItem.setEnabled(false);
+ modelItem.setStyleClass(BOUNDARY_DAY_CLASS);
+ } else if (checkBusyDay(current)) {
+ modelItem.setEnabled(false);
+ modelItem.setStyleClass(BUSY_DAY_CLASS);
+ } else if (checkWeekend(current)) {
+ modelItem.setEnabled(false);
+ modelItem.setStyleClass(WEEKEND_DAY_CLASS);
+ } else {
+ modelItem.setEnabled(true);
+ modelItem.setStyleClass("");
+ }
+ modelItems[i] = modelItem;
+ }
+
+ return modelItems;
+ }
+}
Property changes on: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/CalendarModel.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/CalendarModelItem.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/CalendarModelItem.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/CalendarModelItem.java 2010-12-09 10:50:23 UTC (rev 20473)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.model;
+
+import org.richfaces.model.CalendarDataModelItem;
+
+/**
+ * Item of calendar data model.
+ *
+ * @author Ilya Shaikovsky, Exadel
+ * @version $Revision$
+ */
+public class CalendarModelItem implements CalendarDataModelItem {
+
+ private boolean enabled;
+ private String styleClass;
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public String getStyleClass() {
+ return styleClass;
+ }
+}
Property changes on: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/CalendarModelItem.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/dataModel.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/dataModel.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/dataModel.xhtml 2010-12-09 10:50:23 UTC (rev 20473)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j" xmlns:h="http://java.sun.com/jsf/html">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ <style type="text/css">
+ .yellowDay {
+ background: yellow !important;
+ }
+
+ .aquaDay {
+ background: aqua !important;
+ }
+
+ </style>
+
+ <script type="text/javascript">
+ testedComponentId = "#{rich:clientId('calendar')}";
+ </script>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+ <div style="padding: 250px">
+ <rich:calendar id="calendar" boundaryDatesMode="scroll" dataModel="#{calendarModel}" mode="ajax" >
+ <a4j:ajax event="change" render="output, requestTime" limitRender="#{true}"/>
+ </rich:calendar>
+ </div>
+
+ <br/><br/>
+
+ output: <h:outputText id="output" value="#{richCalendarBean.attributes['value'].value}"/>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter"/>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/list.xhtml 2010-12-09 09:50:04 UTC (rev 20472)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/list.xhtml 2010-12-09 10:50:23 UTC (rev 20473)
@@ -35,6 +35,10 @@
Simple page containing <b>rich:calendar</b> and inputs for all its attributes.
</metamer:testPageLink>
+ <metamer:testPageLink id="dataModel" outcome="dataModel" value="Data Model">
+ Page containing <b>rich:calendar</b> with data model and inputs for all its attributes.
+ </metamer:testPageLink>
+
</ui:define>
</ui:composition>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/simple.xhtml 2010-12-09 09:50:04 UTC (rev 20472)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/simple.xhtml 2010-12-09 10:50:23 UTC (rev 20473)
@@ -83,7 +83,6 @@
<ui:define name="component">
<div style="padding: 250px">
- <!-- add attributes direction and jointPoint ASAP -->
<rich:calendar id="calendar"
boundaryDatesMode="#{richCalendarBean.attributes['boundaryDatesMode'].value}"
buttonClass="#{richCalendarBean.attributes['buttonClass'].value}"
14 years, 1 month
JBoss Rich Faces SVN: r20472 - in modules/tests/metamer/trunk: ftest-source and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-09 04:50:04 -0500 (Thu, 09 Dec 2010)
New Revision: 20472
Modified:
modules/tests/metamer/trunk/ftest-source/pom.xml
modules/tests/metamer/trunk/ftest/pom.xml
Log:
switched Metamer tests to richfaces-selenium:1.5.3-SNAPSHOT
Modified: modules/tests/metamer/trunk/ftest/pom.xml
===================================================================
--- modules/tests/metamer/trunk/ftest/pom.xml 2010-12-09 09:49:24 UTC (rev 20471)
+++ modules/tests/metamer/trunk/ftest/pom.xml 2010-12-09 09:50:04 UTC (rev 20472)
@@ -25,7 +25,7 @@
<parent>
<artifactId>functional-test-jboss-ci-template</artifactId>
<groupId>org.jboss.test.richfaces-selenium</groupId>
- <version>1.5.2.SP1</version>
+ <version>1.5.3-SNAPSHOT</version>
</parent>
<groupId>org.richfaces.tests</groupId>
Modified: modules/tests/metamer/trunk/ftest-source/pom.xml
===================================================================
--- modules/tests/metamer/trunk/ftest-source/pom.xml 2010-12-09 09:49:24 UTC (rev 20471)
+++ modules/tests/metamer/trunk/ftest-source/pom.xml 2010-12-09 09:50:04 UTC (rev 20472)
@@ -37,7 +37,7 @@
<dependency>
<artifactId>root</artifactId>
<groupId>org.jboss.test.richfaces-selenium</groupId>
- <version>1.5.2.SP1</version>
+ <version>1.5.3-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
14 years, 1 month
JBoss Rich Faces SVN: r20471 - modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-09 04:49:24 -0500 (Thu, 09 Dec 2010)
New Revision: 20471
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/scroller.xhtml
Log:
fixed scroller rerendering in rich:dataTable - scroller sample (RFPL-912)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/scroller.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/scroller.xhtml 2010-12-09 09:38:14 UTC (rev 20470)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/scroller.xhtml 2010-12-09 09:49:24 UTC (rev 20471)
@@ -43,7 +43,7 @@
<br/>
<h:outputText value="Show data in table: " />
<h:selectBooleanCheckbox id="noDataCheckbox" value="#{richDataTableBean.state}">
- <a4j:ajax render="#{nestedComponentId}" />
+ <a4j:ajax render="#{nestedComponentId} scroller1" />
</h:selectBooleanCheckbox>
<br/><br/>
14 years, 1 month
JBoss Rich Faces SVN: r20470 - in trunk: examples/input-demo/src/main/webapp/examples and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-12-09 04:38:14 -0500 (Thu, 09 Dec 2010)
New Revision: 20470
Modified:
trunk/examples/input-demo/src/main/java/org/richfaces/demo/InputNumberSliderBean.java
trunk/examples/input-demo/src/main/webapp/examples/inputNumberSlider.xhtml
trunk/examples/output-demo/src/main/webapp/qunit/tooltip.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSlider/samples/sliders-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/tooltip.xhtml
trunk/ui/input/ui/src/main/config/faces-config.xml
trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml
Log:
RF-9865 - Tooltip: unify component name and other component's attributes
Modified: trunk/examples/input-demo/src/main/java/org/richfaces/demo/InputNumberSliderBean.java
===================================================================
--- trunk/examples/input-demo/src/main/java/org/richfaces/demo/InputNumberSliderBean.java 2010-12-09 09:31:55 UTC (rev 20469)
+++ trunk/examples/input-demo/src/main/java/org/richfaces/demo/InputNumberSliderBean.java 2010-12-09 09:38:14 UTC (rev 20470)
@@ -44,7 +44,7 @@
private boolean showArrows = false;
private boolean showBoundaryValues = true;
private boolean showInput = true;
- private boolean showToolTip = true;
+ private boolean showTooltip = true;
private double step = 1;
public void setValue(double value) {
@@ -131,12 +131,12 @@
this.showInput = showInput;
}
- public boolean isShowToolTip() {
- return showToolTip;
+ public boolean isShowTooltip() {
+ return showTooltip;
}
- public void setShowToolTip(boolean showToolTip) {
- this.showToolTip = showToolTip;
+ public void setShowTooltip(boolean showTooltip) {
+ this.showTooltip = showTooltip;
}
public double getStep() {
Modified: trunk/examples/input-demo/src/main/webapp/examples/inputNumberSlider.xhtml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/examples/inputNumberSlider.xhtml 2010-12-09 09:31:55 UTC (rev 20469)
+++ trunk/examples/input-demo/src/main/webapp/examples/inputNumberSlider.xhtml 2010-12-09 09:38:14 UTC (rev 20470)
@@ -46,7 +46,7 @@
disabled="#{inputNumberSliderBean.disabled}" enableManualInput="#{inputNumberSliderBean.enableManualInput}"
inputPosition="#{inputNumberSliderBean.inputPosition}" inputSize="#{inputNumberSliderBean.inputSize}" showArrows="#{inputNumberSliderBean.showArrows}"
showBoundaryValues="#{inputNumberSliderBean.showBoundaryValues}" showInput="#{inputNumberSliderBean.showInput}"
- showToolTip="#{inputNumberSliderBean.showToolTip}" maxValue="#{inputNumberSliderBean.maxValue}" minValue="#{inputNumberSliderBean.minValue}"
+ showTooltip="#{inputNumberSliderBean.showTooltip}" maxValue="#{inputNumberSliderBean.maxValue}" minValue="#{inputNumberSliderBean.minValue}"
step="#{inputNumberSliderBean.step}" >
<f:ajax render="date" />
</ins:inputNumberSlider>
@@ -107,8 +107,8 @@
<f:ajax render="ins"/>
</h:selectBooleanCheckbox>
<br />
- <h:outputText value="ShowToolTip: "/>
- <h:selectBooleanCheckbox value="#{inputNumberSliderBean.showToolTip}">
+ <h:outputText value="ShowTooltip: "/>
+ <h:selectBooleanCheckbox value="#{inputNumberSliderBean.showTooltip}">
<f:ajax render="ins"/>
</h:selectBooleanCheckbox>
<br />
Modified: trunk/examples/output-demo/src/main/webapp/qunit/tooltip.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/qunit/tooltip.xhtml 2010-12-09 09:31:55 UTC (rev 20469)
+++ trunk/examples/output-demo/src/main/webapp/qunit/tooltip.xhtml 2010-12-09 09:38:14 UTC (rev 20470)
@@ -50,7 +50,7 @@
Tooltip apeared under green rectangle.
<pn:tooltip id="tooltip" target="myRectangle" mode="ajax" showDelay="500">
- New ToolTip Yo!!!
+ New Tooltip Yo!!!
</pn:tooltip>
</div>
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSlider/samples/sliders-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSlider/samples/sliders-sample.xhtml 2010-12-09 09:31:55 UTC (rev 20469)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSlider/samples/sliders-sample.xhtml 2010-12-09 09:38:14 UTC (rev 20470)
@@ -14,16 +14,16 @@
<rich:inputNumberSlider value="50" showInput="false"
enableManualInput="false" showBoundaryValues="false"
- showToolTip="false" />
+ showTooltip="false" />
<p>Another variation of input:</p>
<rich:inputNumberSlider value="500" width="500" maxValue="1000"
- step="50" showArrows="true" showToolTip="false" />
+ step="50" showArrows="true" showTooltip="false" />
<p>The same variant but the control disabled:</p>
<rich:inputNumberSlider value="500" width="500" maxValue="1000"
- step="50" showArrows="true" showToolTip="false" disabled="true" />
+ step="50" showArrows="true" showTooltip="false" disabled="true" />
</ui:composition>
\ No newline at end of file
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/tooltip.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/tooltip.xhtml 2010-12-09 09:31:55 UTC (rev 20469)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/tooltip.xhtml 2010-12-09 09:38:14 UTC (rev 20470)
@@ -5,10 +5,10 @@
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition>
- <p>ToolTip is a small non-modal pop-up that could be used to
+ <p>Tooltip is a small non-modal pop-up that could be used to
display additional information, that is usually hidden.<br />
</p>
- <p>Major toolTip features:</p>
+ <p>Major tooltip features:</p>
<ul>
<li>Tool-tip content may be <b>pre-rendered</b> on a page (client
mode) or <b>loaded on separate Ajax request</b> (ajax mode)</li>
Modified: trunk/ui/input/ui/src/main/config/faces-config.xml
===================================================================
--- trunk/ui/input/ui/src/main/config/faces-config.xml 2010-12-09 09:31:55 UTC (rev 20469)
+++ trunk/ui/input/ui/src/main/config/faces-config.xml 2010-12-09 09:38:14 UTC (rev 20470)
@@ -183,7 +183,7 @@
</property-extension>
</property>
<property>
- <property-name>showToolTip</property-name>
+ <property-name>showTooltip</property-name>
<property-class>boolean</property-class>
<default-value>true</default-value>
<property-extension>
@@ -221,7 +221,7 @@
</property-extension>
</property>
<property>
- <property-name>toolTipClass</property-name>
+ <property-name>tooltipClass</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:generate>true</cdk:generate>
Modified: trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml 2010-12-09 09:31:55 UTC (rev 20469)
+++ trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml 2010-12-09 09:38:14 UTC (rev 20470)
@@ -65,8 +65,8 @@
</c:if>
<xi:include xpointer="xpointer(/*)" href="input.template.inc" />
</c:if>
- <c:if test="#{component.attributes['showToolTip']}">
- <span class="rf-insl-tt #{component.attributes['toolTipClass']}">#{getInputValue(facesContext, component)}</span>
+ <c:if test="#{component.attributes['showTooltip']}">
+ <span class="rf-insl-tt #{component.attributes['tooltipClass']}">#{getInputValue(facesContext, component)}</span>
</c:if>
<!-- TODO Rewrite the next line when the CDK will support normal way to take event handlers from attributes and behaviors. -->
<cdk:object name="onchange" type="String" value="#{convertToString(RenderKitUtils.getAttributeAndBehaviorsValue(facesContext, component, RenderKitUtils.attributes().generic('onchange', 'onchange', 'change').first()))}" />
14 years, 1 month
JBoss Rich Faces SVN: r20469 - trunk/ui/parent.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-12-09 04:31:55 -0500 (Thu, 09 Dec 2010)
New Revision: 20469
Modified:
trunk/ui/parent/pom.xml
Log:
RF-9624 Remove richfaces-core-impl from all pom.xml files
Only from ui
Modified: trunk/ui/parent/pom.xml
===================================================================
--- trunk/ui/parent/pom.xml 2010-12-09 08:49:25 UTC (rev 20468)
+++ trunk/ui/parent/pom.xml 2010-12-09 09:31:55 UTC (rev 20469)
@@ -121,6 +121,11 @@
<!-- tests -->
<dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-test-stage</artifactId>
<scope>test</scope>
14 years, 1 month
JBoss Rich Faces SVN: r20468 - in trunk: core/impl/src/main/java/org/richfaces/application and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-12-09 03:49:25 -0500 (Thu, 09 Dec 2010)
New Revision: 20468
Added:
trunk/core/api/src/main/java/org/richfaces/application/Module.java
Removed:
trunk/core/impl/src/main/java/org/richfaces/application/Module.java
Modified:
trunk/ui/dist/richfaces-components-ui/pom.xml
trunk/ui/dnd/ui/pom.xml
trunk/ui/input/ui/pom.xml
trunk/ui/iteration/ui/pom-list.xml
trunk/ui/output/ui/pom.xml
trunk/ui/parent/pom.xml
trunk/ui/validator/impl/pom.xml
Log:
RF-9624 Remove richfaces-core-impl from all pom.xml files
Only from ui
Copied: trunk/core/api/src/main/java/org/richfaces/application/Module.java (from rev 20467, trunk/core/impl/src/main/java/org/richfaces/application/Module.java)
===================================================================
--- trunk/core/api/src/main/java/org/richfaces/application/Module.java (rev 0)
+++ trunk/core/api/src/main/java/org/richfaces/application/Module.java 2010-12-09 08:49:25 UTC (rev 20468)
@@ -0,0 +1,13 @@
+package org.richfaces.application;
+
+
+/**
+ * <p class="changed_added_4_0">User-provided configuration module.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public interface Module {
+
+ public void configure(ServicesFactory factory);
+
+}
Deleted: trunk/core/impl/src/main/java/org/richfaces/application/Module.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/application/Module.java 2010-12-09 00:56:15 UTC (rev 20467)
+++ trunk/core/impl/src/main/java/org/richfaces/application/Module.java 2010-12-09 08:49:25 UTC (rev 20468)
@@ -1,13 +0,0 @@
-package org.richfaces.application;
-
-
-/**
- * <p class="changed_added_4_0">User-provided configuration module.</p>
- * @author asmirnov(a)exadel.com
- *
- */
-public interface Module {
-
- public void configure(ServicesFactory factory);
-
-}
Modified: trunk/ui/dist/richfaces-components-ui/pom.xml
===================================================================
--- trunk/ui/dist/richfaces-components-ui/pom.xml 2010-12-09 00:56:15 UTC (rev 20467)
+++ trunk/ui/dist/richfaces-components-ui/pom.xml 2010-12-09 08:49:25 UTC (rev 20468)
@@ -74,10 +74,6 @@
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-api</artifactId>
</dependency>
- <dependency>
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-impl</artifactId>
- </dependency>
<dependency>
<groupId>javax.servlet</groupId>
Modified: trunk/ui/dnd/ui/pom.xml
===================================================================
--- trunk/ui/dnd/ui/pom.xml 2010-12-09 00:56:15 UTC (rev 20467)
+++ trunk/ui/dnd/ui/pom.xml 2010-12-09 08:49:25 UTC (rev 20468)
@@ -56,10 +56,6 @@
<artifactId>richfaces-core-api</artifactId>
</dependency>
<dependency>
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-impl</artifactId>
- </dependency>
- <dependency>
<groupId>org.richfaces.ui.common</groupId>
<artifactId>richfaces-ui-common-ui</artifactId>
</dependency>
Modified: trunk/ui/input/ui/pom.xml
===================================================================
--- trunk/ui/input/ui/pom.xml 2010-12-09 00:56:15 UTC (rev 20467)
+++ trunk/ui/input/ui/pom.xml 2010-12-09 08:49:25 UTC (rev 20468)
@@ -52,10 +52,6 @@
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-api</artifactId>
</dependency>
- <dependency>
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-impl</artifactId>
- </dependency>
<dependency>
<groupId>org.richfaces.ui.common</groupId>
<artifactId>richfaces-ui-common-ui</artifactId>
Modified: trunk/ui/iteration/ui/pom-list.xml
===================================================================
--- trunk/ui/iteration/ui/pom-list.xml 2010-12-09 00:56:15 UTC (rev 20467)
+++ trunk/ui/iteration/ui/pom-list.xml 2010-12-09 08:49:25 UTC (rev 20468)
@@ -46,11 +46,6 @@
<artifactId>richfaces-core-api</artifactId>
</dependency>
<dependency>
- <!-- todo remove this dependency or move to test scope -->
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-impl</artifactId>
- </dependency>
- <dependency>
<groupId>org.richfaces.cdk</groupId>
<artifactId>annotations</artifactId>
<scope>provided</scope>
Modified: trunk/ui/output/ui/pom.xml
===================================================================
--- trunk/ui/output/ui/pom.xml 2010-12-09 00:56:15 UTC (rev 20467)
+++ trunk/ui/output/ui/pom.xml 2010-12-09 08:49:25 UTC (rev 20468)
@@ -56,10 +56,6 @@
<artifactId>richfaces-core-api</artifactId>
</dependency>
<dependency>
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-impl</artifactId>
- </dependency>
- <dependency>
<groupId>org.richfaces.ui.common</groupId>
<artifactId>richfaces-ui-common-ui</artifactId>
</dependency>
Modified: trunk/ui/parent/pom.xml
===================================================================
--- trunk/ui/parent/pom.xml 2010-12-09 00:56:15 UTC (rev 20467)
+++ trunk/ui/parent/pom.xml 2010-12-09 08:49:25 UTC (rev 20468)
@@ -89,12 +89,6 @@
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-api</artifactId>
</dependency>
- <dependency>
- <!-- todo remove this dependency or move to test scope -->
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-impl</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.richfaces.cdk</groupId>
Modified: trunk/ui/validator/impl/pom.xml
===================================================================
--- trunk/ui/validator/impl/pom.xml 2010-12-09 00:56:15 UTC (rev 20467)
+++ trunk/ui/validator/impl/pom.xml 2010-12-09 08:49:25 UTC (rev 20468)
@@ -43,11 +43,6 @@
<dependencies>
<dependency>
- <!-- todo remove this dependency or move to test scope -->
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-impl</artifactId>
- </dependency>
- <dependency>
<groupId>org.richfaces.ui.common</groupId>
<artifactId>richfaces-ui-common-ui</artifactId>
</dependency>
14 years, 1 month
JBoss Rich Faces SVN: r20467 - in branches/RF-8742-1/ui/validator/ui/src: main/resources/META-INF/resources/org.richfaces and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-08 19:56:15 -0500 (Wed, 08 Dec 2010)
New Revision: 20467
Added:
branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/csv.js
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/MockTestBase.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/TestCriteria.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/converter/
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/converter/BooleanConverterTest.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/converter/ConverterTestBase.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/validator/
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/validator/ValidatorTestBase.java
Removed:
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/MockConverterTest.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/TestCriteria.java
Modified:
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ValidatorScriptBase.java
Log:
CODING IN PROGRESS - issue RF-9217: CSV: development tests for client side(qunit)
https://jira.jboss.org/browse/RF-9217
Modified: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ValidatorScriptBase.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ValidatorScriptBase.java 2010-12-08 16:16:00 UTC (rev 20466)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ValidatorScriptBase.java 2010-12-09 00:56:15 UTC (rev 20467)
@@ -9,6 +9,7 @@
public abstract class ValidatorScriptBase extends JSFunctionDefinition implements ComponentValidatorScript {
protected static final String ELEMENT = "element";
+ protected static final JSReference ELEMENT_LITERAL = new JSReference(ELEMENT);
protected static final String EVENT = "event";
protected static final JSReference EVENT_LITERAL = new JSReference(EVENT);
protected static final String DISABLE_AJAX = "disableAjax";
@@ -20,7 +21,7 @@
protected static final NullConverterScript NULL_CONVERTER_SCRIPT = new NullConverterScript();
protected static final String CSV_NAMESPACE = "RichFaces.csv.";
protected static final String VALUE_FUNCTION_NAME = CSV_NAMESPACE+"getValue";
- protected static final JSFunction GET_VALUE_FUNCTION = new JSFunction(VALUE_FUNCTION_NAME,CLIENT_ID_LITERAL);
+ protected static final JSFunction GET_VALUE_FUNCTION = new JSFunction(VALUE_FUNCTION_NAME,CLIENT_ID_LITERAL,ELEMENT_LITERAL);
protected static final JSFunction SEND_ERROR_FUNCTION = new JSFunction(CSV_NAMESPACE+"sendMessage",CLIENT_ID_LITERAL,new JSReference("e"));
protected static final JSFunction CLEAR_ERROR_FUNCTION = new JSFunction(CSV_NAMESPACE+"clearMessage",CLIENT_ID_LITERAL);
Added: branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/csv.js
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/csv.js (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/csv.js 2010-12-09 00:56:15 UTC (rev 20467)
@@ -0,0 +1,152 @@
+(function($, rf) {
+
+ rf.csv = rf.csv || {};
+
+ var _messages = {};
+
+ var RE_MESSAGE_PATTERN = /\{(\d+)\}/g;
+
+ $.extend(rf.csv, {
+ RE_DIGITS: /^-?\d+$/,
+ RE_FLOAT: /^(-?\d+)?(\.(\d+)?(e[+-]?\d+)?)?$/,
+ MESSAGE_EVENT_NAME: "onmessage."+rf.Event.RICH_NAMESPACE,
+ // Messages API
+ addMessage: function (messagesObject) {
+ $.extend(_messages, messagesObject);
+ },
+ getMessage: function(customMessage, messageId, values) {
+ var message = customMessage || _messages[messageId] || "";
+ if (message) {
+ var msgObject = message.replace(RE_MESSAGE_PATTERN,"\n$1\n").split("\n");
+ var value;
+ for (var i=1; i<msgObject.length; i+=2) {
+ value = values[msgObject[i]];
+ msgObject[i] = typeof value == "undefined" ? "" : value;
+ }
+ message = msgObject.join('');
+ }
+ return {message:message};
+ },
+ sendMessage: function (componentId, message) {
+ rf.Event.fireById(document, MESSAGE_EVENT_NAME, message);
+ rf.Event.fireById(componentId, MESSAGE_EVENT_NAME, message);
+ },
+ clearMessage: function (componentId) {
+ rf.Event.fireById(document, MESSAGE_EVENT_NAME, message);
+ rf.Event.fireById(componentId, MESSAGE_EVENT_NAME, message);
+ },
+ getValue: function (clientId, element){
+ var value;
+ var element = element || rf.getDomElement(id);
+ if (element.value) {
+ value = element.value;
+ } else {
+ var component = rf.$(element);
+ // TODO: add getValue to baseComponent and change jsdocs
+ value = component && typeof component["getValue"] == "function" ? component.getValue() : "";
+ }
+ return value;
+ },
+ validate: function (event, id, converter, validators) {
+ var value = getValue(id);
+ if (converter) {
+ try {
+ converter.options.componentId = id;
+ value = getConverter([converter.name])(value, converter.options);
+ } catch (e){
+ sendMessage(id, e.message);
+ return false;
+ }
+ }
+ if (validators) {
+ var validatorFunction;
+ try {
+ for (i=0;i<validators.length;i++) {
+ validatorFunction = getValidator(validators[i].type);
+ if (validatorFunction) {
+ validatorFunction(id, value, validators[i]);
+ }
+ }
+ } catch (e) {
+ sendMessage(id, result);
+ return false;
+ }
+ }
+ return true;
+ },
+ // Converters
+ convertBoolean: function(value,message,options){
+ options = options || {};
+ var result;
+ value = $.trim(value).toLowerCase();
+ result = value=='true' ? true : value.length<1 ? null : false;
+ return result;
+ },
+ addFormValidators: function (formId, callValidatorFunctions) {
+
+ }
+ });
+
+ /*
+ // component ids hash that can send messages
+ // each hash item contains array of message component id that receive messages from the component
+ _componentIds = {};
+ // array of message component id that will receive messages from all components
+ _messageComponentIds = {};
+
+ var messageDispatchers = {};
+ var addDispatcher = function (dispatcherId) {
+ };
+ var removeDispatcher: function (dispatcherId) {
+ };
+
+ rf.MessageDispatcher = function(id) {
+ this.id = id;
+ };
+ rf.BaseComponent.extend(rf.MessageDispatcher);
+
+ $.extend(rf.MessageDispatcher.prototype, {
+ register: function (messageComponentId, componentIds) {
+ if (!componentIds || componentIds.length==0) {
+ // global message listener
+ _messageComponents.push(messageComponentId);
+ }
+ var messageComponents;
+ for (var i=0;i<componentIds.length;i++) {
+ messageComponents = _components[componentIds[i]];
+ if (!messageComponents) {
+ messageComponents = _components[componentIds[i]] = [];
+ }
+ messageComponents.push(messageComponentId);
+ }
+ },
+ unregister: function (messageComponentId) {
+ var messageComponents;
+ for (var i=0;i<_components.length;i++) {
+ messageComponents = _components[i];
+ if (!messageComponents) {
+ messageComponents = _components[componentIds[i]] = [];
+ }
+ messageComponents.push(messageComponentId);
+ }
+ },
+ send: function (componentId, message) {
+ var messageComponents = _components[componentId];
+ if (messageComponents) {
+ for (var i=0;i<messageComponents.length;i++) {
+ rf.$(messageComponents[id]).update(message);
+ }
+ }
+ }
+ });
+ */
+
+ /*
+ * message.constructor () {
+ * rf.Event.bindById(componentId, "onMessage.RichFaces", onMessage );
+ * rf.Event.bindById(document, "onMessage.RichFaces", onMessage );
+ * }
+ *
+ */
+
+})(jQuery, window.RichFaces || (window.RichFaces={}));
\ No newline at end of file
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/csv.js
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/MockConverterTest.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/MockConverterTest.java 2010-12-08 16:16:00 UTC (rev 20466)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/MockConverterTest.java 2010-12-09 00:56:15 UTC (rev 20467)
@@ -1,61 +0,0 @@
-package org.richfaces.convert;
-
-import static org.junit.Assert.*;
-
-import java.util.List;
-
-import org.jboss.test.faces.mock.MockFacesEnvironment;
-import org.jboss.test.qunit.Qunit;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-import com.google.common.collect.ImmutableList;
-
-(a)RunWith(Parameterized.class)
-public class MockConverterTest {
-
- @Rule
- public final Qunit qunit = Qunit.builder().loadJsfResource("jquery.js").loadJsfResource("richfaces.js")
- .loadJsfResource("richfaces-event.js").loadJsfResource("richfaces-csv.js", "org.richfaces").loadJsfResource("resource.js").build();
-
- private final TestCriteria criteria;
-
- private MockFacesEnvironment facesEnvironment;
-
- public MockConverterTest(TestCriteria criteria) {
- this.criteria = criteria;
- }
-
- @Before
- public void setUp(){
- this.facesEnvironment = MockFacesEnvironment.createEnvironment();
- }
-
- @After
- public void tearDown(){
- this.facesEnvironment.release();
- this.facesEnvironment = null;
- }
- @Test
- public void testConvert() throws Exception {
-
- }
-
- @Parameters
- public static List<TestCriteria[]> getTestCriterias() {
- return ImmutableList.of(pass("true"), pass("ok"), fail("123"));
- }
-
- private static TestCriteria[] pass(String string) {
- return new TestCriteria[] { new TestCriteria(string) };
- }
-
- private static TestCriteria[] fail(String string) {
- return new TestCriteria[] { new TestCriteria(string) };
- }
-}
Deleted: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/TestCriteria.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/TestCriteria.java 2010-12-08 16:16:00 UTC (rev 20466)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/TestCriteria.java 2010-12-09 00:56:15 UTC (rev 20467)
@@ -1,20 +0,0 @@
-package org.richfaces.convert;
-
-public class TestCriteria {
-
- private final String string;
-
- public TestCriteria(String string) {
- this.string = string;
-
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the string
- */
- public String getString() {
- return string;
- }
-
-}
Added: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/MockTestBase.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/MockTestBase.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/MockTestBase.java 2010-12-09 00:56:15 UTC (rev 20467)
@@ -0,0 +1,90 @@
+package org.richfaces.javascript.client;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+
+import org.jboss.test.faces.mock.MockFacesEnvironment;
+import org.jboss.test.qunit.Qunit;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableList.Builder;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Lists;
+
+(a)RunWith(Parameterized.class)
+public abstract class MockTestBase {
+
+ @Rule
+ public final Qunit qunit = Qunit.builder().loadJsfResource("jquery.js").loadJsfResource("richfaces.js")
+ .loadJsfResource("richfaces-event.js").loadJsfResource("csv.js", "org.richfaces").build();
+ protected final TestCriteria criteria;
+ protected MockFacesEnvironment facesEnvironment;
+ protected UIComponent component;
+
+ public MockTestBase(TestCriteria criteria) {
+ this.criteria = criteria;
+ }
+
+ @Before
+ public void setUp() {
+ this.facesEnvironment = MockFacesEnvironment.createEnvironment();
+ component = facesEnvironment.createMock(UIComponent.class);
+ facesEnvironment.replay();
+ }
+
+ @After
+ public void tearDown() {
+ this.facesEnvironment.verify();
+ this.facesEnvironment.release();
+ this.facesEnvironment = null;
+ }
+
+ protected Object getErrorMessage() {
+ return ImmutableMap.of("detail","error");
+ }
+
+ protected Object getJavaScriptOptions() {
+ return criteria.getOptions();
+ }
+
+ protected abstract String getJavaScriptFunctionName();
+
+ protected static List<TestCriteria[]> options(TestCriteria ...criterias){
+ Builder<TestCriteria[]> builder = ImmutableList.builder();
+ for (TestCriteria testCriteria : criterias) {
+ builder.add(optionsArray(testCriteria));
+ }
+ return builder.build();
+ }
+
+ protected static TestCriteria pass(Object value) {
+ return new TestCriteria(value);
+ }
+
+ protected static TestCriteria pass(Object value, String option1, Object value1) {
+ TestCriteria testCriteria = pass(value);
+ Map<String, Object> options = testCriteria.getOptions();
+ options.put(option1, value1);
+ return testCriteria;
+ }
+
+ protected static TestCriteria pass(Object value, String option1, Object value1, String option2, Object value2) {
+ TestCriteria testCriteria = pass(value);
+ Map<String, Object> options = testCriteria.getOptions();
+ options.put(option1, value1);
+ options.put(option2, value2);
+ return testCriteria;
+ }
+
+ private static TestCriteria[] optionsArray(TestCriteria testCriteria) {
+ return new TestCriteria[] { testCriteria };
+ }
+
+}
\ No newline at end of file
Property changes on: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/MockTestBase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/TestCriteria.java (from rev 20466, branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/TestCriteria.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/TestCriteria.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/TestCriteria.java 2010-12-09 00:56:15 UTC (rev 20467)
@@ -0,0 +1,33 @@
+package org.richfaces.javascript.client;
+
+import java.util.Map;
+
+import com.google.common.collect.Maps;
+
+public class TestCriteria {
+
+ private final Object value;
+
+ private final Map<String, Object> options = Maps.newHashMap();
+
+ public TestCriteria(Object value) {
+ this.value = value;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the string
+ */
+ public Object getValue() {
+ return value;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the options
+ */
+ public Map<String, Object> getOptions() {
+ return options;
+ }
+
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/TestCriteria.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/converter/BooleanConverterTest.java (from rev 20466, branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/convert/MockConverterTest.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/converter/BooleanConverterTest.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/converter/BooleanConverterTest.java 2010-12-09 00:56:15 UTC (rev 20467)
@@ -0,0 +1,31 @@
+package org.richfaces.javascript.client.converter;
+
+import java.util.List;
+
+import javax.faces.convert.BooleanConverter;
+import javax.faces.convert.Converter;
+
+import org.junit.runners.Parameterized.Parameters;
+import org.richfaces.javascript.client.TestCriteria;
+
+public class BooleanConverterTest extends ConverterTestBase {
+
+ public BooleanConverterTest(TestCriteria criteria) {
+ super(criteria);
+ }
+
+ @Override
+ protected Converter createConverter() {
+ return new BooleanConverter();
+ }
+
+ @Override
+ protected String getJavaScriptFunctionName() {
+ return "convertBoolean";
+ }
+
+ @Parameters
+ public static List<TestCriteria[]> getTestCriterias() {
+ return options(pass("true"), pass("ok"), pass("123"),pass("0"),pass("1"));
+ }
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/converter/BooleanConverterTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/converter/ConverterTestBase.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/converter/ConverterTestBase.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/converter/ConverterTestBase.java 2010-12-09 00:56:15 UTC (rev 20467)
@@ -0,0 +1,50 @@
+package org.richfaces.javascript.client.converter;
+
+import static org.junit.Assert.*;
+
+
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+
+import org.ajax4jsf.javascript.JSFunction;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.richfaces.javascript.client.MockTestBase;
+import org.richfaces.javascript.client.TestCriteria;
+
+
+public abstract class ConverterTestBase extends MockTestBase {
+
+ public ConverterTestBase(TestCriteria criteria) {
+ super(criteria);
+ }
+
+ @Test
+ public void testConvert() throws Exception {
+ Converter converter = createConverter();
+ try {
+ Object convertedValue =
+ converter.getAsObject(facesEnvironment.getFacesContext(), component, criteria.getValue().toString());
+ Object jsConvertedValue =
+ convertOnClient();
+ assertEquals(convertedValue, jsConvertedValue);
+ } catch (ConverterException e) {
+ // JSF conversion error - JavaScript should throw exception too.
+ try {
+ convertOnClient();
+ assertFalse("Client-side converted didn't throw exception for value:"+criteria.getValue(), true);
+ } catch (Exception jsException){
+ // Test passed
+ }
+ }
+ }
+
+ protected Object convertOnClient() throws ConverterException {
+ JSFunction clientSideFunction = new JSFunction("RichFaces.csv." + getJavaScriptFunctionName(),criteria.getValue(),getErrorMessage(),getJavaScriptOptions());
+ return qunit.runScript(clientSideFunction.toScript());
+ }
+
+ protected abstract Converter createConverter();
+
+}
\ No newline at end of file
Property changes on: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/converter/ConverterTestBase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/validator/ValidatorTestBase.java
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/validator/ValidatorTestBase.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/validator/ValidatorTestBase.java 2010-12-09 00:56:15 UTC (rev 20467)
@@ -0,0 +1,42 @@
+package org.richfaces.javascript.client.validator;
+
+import static org.junit.Assert.*;
+
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+import javax.validation.ValidationException;
+
+import org.junit.Test;
+import org.richfaces.javascript.client.MockTestBase;
+import org.richfaces.javascript.client.TestCriteria;
+
+public abstract class ValidatorTestBase extends MockTestBase {
+
+ public ValidatorTestBase(TestCriteria criteria) {
+ super(criteria);
+ }
+
+
+ @Test
+ public void testValidator() throws Exception {
+ Validator validator = createValidator();
+ try {
+ validator.validate(facesEnvironment.getFacesContext(), component, criteria.getValue());
+ validateOnClient();
+ } catch (ValidatorException e) {
+ // client-side script has to throw exception too.
+ try {
+ validateOnClient();
+ assertFalse("JSF validator throws exception for value: "+criteria.getValue(),true);
+ } catch (Exception e2) {
+ // both methods throws exceptions - it's ok.
+ }
+ }
+ }
+
+ protected void validateOnClient() throws ValidationException {
+
+ }
+
+ protected abstract Validator createValidator();
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/javascript/client/validator/ValidatorTestBase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 1 month
JBoss Rich Faces SVN: r20466 - in trunk/ui/input/ui/src/main/java/org/richfaces: request and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-08 11:16:00 -0500 (Wed, 08 Dec 2010)
New Revision: 20466
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/context/FileUploadPartialViewContextFactory.java
trunk/ui/input/ui/src/main/java/org/richfaces/request/FileParam.java
trunk/ui/input/ui/src/main/java/org/richfaces/request/MultipartRequest.java
Log:
small code cleanup
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/context/FileUploadPartialViewContextFactory.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/context/FileUploadPartialViewContextFactory.java 2010-12-08 15:58:09 UTC (rev 20465)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/context/FileUploadPartialViewContextFactory.java 2010-12-08 16:16:00 UTC (rev 20466)
@@ -93,8 +93,8 @@
if (maxRequestSize != 0 && externalContext.getRequestContentLength() > maxRequestSize) {
printResponse(facesContext, uid, ResponseState.sizeExceeded);
} else {
- MultipartRequest multipartRequest = new MultipartRequest(request, createTempFiles,
- tempFilesDirectory, maxRequestSize, uid);
+ MultipartRequest multipartRequest = new MultipartRequest(request, createTempFiles, tempFilesDirectory,
+ uid);
try {
multipartRequest.parseRequest();
if (!multipartRequest.isDone()) {
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/request/FileParam.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/request/FileParam.java 2010-12-08 15:58:09 UTC (rev 20465)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/request/FileParam.java 2010-12-08 16:16:00 UTC (rev 20466)
@@ -29,7 +29,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.rmi.server.UID;
+import java.util.UUID;
import org.richfaces.exception.FileUploadException;
import org.richfaces.log.Logger;
@@ -86,7 +86,7 @@
if (tempFilesDirectory != null) {
dir = new File(tempFilesDirectory);
}
- tempFile = File.createTempFile(new UID().toString().replace(":", "-"), ".upload", dir);
+ tempFile = File.createTempFile(UUID.randomUUID().toString(), ".upload", dir);
fOut = new FileOutputStream(tempFile);
} catch (IOException ex) {
if (fOut != null) {
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/request/MultipartRequest.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/request/MultipartRequest.java 2010-12-08 15:58:09 UTC (rev 20465)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/request/MultipartRequest.java 2010-12-08 16:16:00 UTC (rev 20466)
@@ -118,21 +118,11 @@
private HeadersHandler headersHandler = null;
- public MultipartRequest(HttpServletRequest request, boolean createTempFiles, String tempFilesDirectory,
- int maxRequestSize, String uid) {
+ public MultipartRequest(HttpServletRequest request, boolean createTempFiles, String tempFilesDirectory, String uid) {
super(request);
this.createTempFiles = createTempFiles;
this.tempFilesDirectory = tempFilesDirectory;
this.uid = uid;
-
- String contentLengthStr = request.getHeader("Content-Length");
- this.contentLength = Integer.parseInt(contentLengthStr);
- if (contentLengthStr != null && maxRequestSize > 0 && contentLength > maxRequestSize) {
- // TODO : we should make decision if can generate exception in this
- // place
- // throw new FileUploadException(
- // "Multipart request is larger than allowed size");
- }
}
private class ControlledProgressInputStream extends FilterInputStream {
14 years, 1 month
JBoss Rich Faces SVN: r20465 - in modules/tests/metamer/trunk/application/src/main: resources/org/richfaces/tests/metamer/bean and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-12-08 10:58:09 -0500 (Wed, 08 Dec 2010)
New Revision: 20465
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCalendarBean.java
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichCalendarBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/simple.xhtml
Log:
* added new attributes to calendar
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCalendarBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCalendarBean.java 2010-12-08 15:42:52 UTC (rev 20464)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCalendarBean.java 2010-12-08 15:58:09 UTC (rev 20465)
@@ -72,6 +72,7 @@
// TODO has to be tested in another way
attributes.remove("converter");
+ attributes.remove("dataModel");
attributes.remove("validator");
attributes.remove("valueChangeListener");
}
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichCalendarBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichCalendarBean.properties 2010-12-08 15:42:52 UTC (rev 20464)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichCalendarBean.properties 2010-12-08 15:58:09 UTC (rev 20465)
@@ -11,10 +11,14 @@
attr.buttonIconDisabled.heart=/resources/images/heart.png
attr.buttonIconDisabled.null=
-attr.dayStyleClass.yellowTuesdays=yellowTuesdays
-attr.dayStyleClass.aquaWeekends=aquaWeekends
-attr.dayStyleClass.null=
+attr.dayClassFunction.yellowTuesdays=yellowTuesdays
+attr.dayClassFunction.aquaWeekends=aquaWeekends
+attr.dayClassFunction.null=
+attr.dayDisableFunction.disableTuesdays=disableTuesdays
+attr.dayDisableFunction.disableWeekends=disableWeekends
+attr.dayDisableFunction.null=
+
attr.direction.top-left=top-left
attr.direction.top-right=top-right
attr.direction.bottom-left=bottom-left
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/simple.xhtml 2010-12-08 15:42:52 UTC (rev 20464)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCalendar/simple.xhtml 2010-12-08 15:58:09 UTC (rev 20465)
@@ -60,6 +60,20 @@
return false;
}
+ function disableTuesdays(day) {
+ if (day.date.getDay() == 2) {
+ return false;
+ }
+ return true;
+ }
+
+ function disableWeekends(day) {
+ if (day.isWeekend) {
+ return false;
+ }
+ return true;
+ }
+
testedComponentId = "#{rich:clientId('calendar')}";
</script>
</ui:define>
@@ -79,8 +93,8 @@
converterMessage="#{richCalendarBean.attributes['converterMessage'].value}"
currentDate="#{richCalendarBean.attributes['currentDate'].value}"
datePattern="#{richCalendarBean.attributes['datePattern'].value}"
- dayEnabled="#{richCalendarBean.attributes['dayEnabled'].value}"
- dayStyleClass="#{richCalendarBean.attributes['dayStyleClass'].value}"
+ dayClassFunction="#{richCalendarBean.attributes['dayClassFunction'].value}"
+ dayDisableFunction="#{richCalendarBean.attributes['dayDisableFunction'].value}"
defaultTime="#{richCalendarBean.attributes['defaultTime'].value}"
direction="#{richCalendarBean.attributes['direction'].value}"
disabled="#{richCalendarBean.attributes['disabled'].value}"
@@ -95,6 +109,18 @@
jointPoint="#{richCalendarBean.attributes['jointPoint'].value}"
locale="#{richCalendarBean.attributes['locale'].value}"
minDaysInFirstWeek="#{richCalendarBean.attributes['minDaysInFirstWeek'].value}"
+ mode="#{richCalendarBean.attributes['mode'].value}"
+ onbeforecurrentdateselect="#{richCalendarBean.attributes['onbeforecurrentdateselect'].value}"
+ onbeforedateselect="#{richCalendarBean.attributes['onbeforedateselect'].value}"
+ onbeforetimeselect="#{richCalendarBean.attributes['onbeforetimeselect'].value}"
+ onchange="#{richCalendarBean.attributes['onchange'].value}"
+ onclean="#{richCalendarBean.attributes['onclean'].value}"
+ oncollapse="#{richCalendarBean.attributes['oncollapse'].value}"
+ oncomplete="#{richCalendarBean.attributes['oncomplete'].value}"
+ oncurrentdateselect="#{richCalendarBean.attributes['oncurrentdateselect'].value}"
+ ondatemouseout="#{richCalendarBean.attributes['ondatemouseout'].value}"
+ ondatemouseover="#{richCalendarBean.attributes['ondatemouseover'].value}"
+ ondateselect="#{richCalendarBean.attributes['ondateselect'].value}"
oninputblur="#{richCalendarBean.attributes['oninputblur'].value}"
oninputchange="#{richCalendarBean.attributes['oninputchange'].value}"
oninputclick="#{richCalendarBean.attributes['oninputclick'].value}"
@@ -109,7 +135,11 @@
oninputmouseover="#{richCalendarBean.attributes['oninputmouseover'].value}"
oninputmouseup="#{richCalendarBean.attributes['oninputmouseup'].value}"
oninputselect="#{richCalendarBean.attributes['oninputselect'].value}"
+ onshow="#{richCalendarBean.attributes['onshow'].value}"
+ ontimeselect="#{richCalendarBean.attributes['ontimeselect'].value}"
popup="#{richCalendarBean.attributes['popup'].value}"
+ preloadDateRangeBegin="#{richCalendarBean.attributes['preloadDateRangeBegin'].value}"
+ preloadDateRangeEnd="#{richCalendarBean.attributes['preloadDateRangeEnd'].value}"
rendered="#{richCalendarBean.attributes['rendered'].value}"
required="#{richCalendarBean.attributes['required'].value}"
requiredMessage="#{richCalendarBean.attributes['requiredMessage'].value}"
@@ -126,10 +156,11 @@
todayControlMode="#{richCalendarBean.attributes['todayControlMode'].value}"
validatorMessage="#{richCalendarBean.attributes['validatorMessage'].value}"
value="#{richCalendarBean.attributes['value'].value}"
+ valueChangeListener="#{richBean.valueChangeListener}"
verticalOffset="#{richCalendarBean.attributes['verticalOffset'].value}"
zindex="#{richCalendarBean.attributes['zindex'].value}"
>
- <a4j:ajax event="inputchange" render="output"/>
+ <a4j:ajax event="change" render="output, requestTime" limitRender="#{true}"/>
</rich:calendar>
</div>
14 years, 1 month