JBoss Rich Faces SVN: r20687 - trunk/ui/output/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-12-20 09:15:34 -0500 (Mon, 20 Dec 2010)
New Revision: 20687
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java
Log:
RF-9990 Taglib: menuGroup missing attribute label
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java 2010-12-20 13:52:14 UTC (rev 20686)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java 2010-12-20 14:15:34 UTC (rev 20687)
@@ -33,6 +33,9 @@
public abstract String getIconFolderDisabled();
@Attribute
+ public abstract String getLabel();
+
+ @Attribute
public abstract String getStyleClass();
@Attribute
14 years
JBoss Rich Faces SVN: r20686 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-12-20 08:52:14 -0500 (Mon, 20 Dec 2010)
New Revision: 20686
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java
Log:
* testLimitToList fixed
* added issue tracking information
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java 2010-12-20 13:23:47 UTC (rev 20685)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanel/TestRichTogglePanel.java 2010-12-20 13:52:14 UTC (rev 20686)
@@ -128,6 +128,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10040")
public void testSwitchTypeServer() {
selenium.click(pjq("input[name$=switchTypeInput][value=server]"));
selenium.waitForPageToLoad();
@@ -206,6 +207,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10040")
public void testFirstLastPrevNextSwitchServer() {
selenium.click(pjq("input[name$=switchTypeInput][value=server]"));
selenium.waitForPageToLoad();
@@ -232,6 +234,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10054")
public void testBypassUpdates() {
JQueryLocator input = pjq("input[type=radio][name$=bypassUpdatesInput][value=true]");
selenium.click(input);
@@ -264,6 +267,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10054")
public void testImmediate() {
JQueryLocator input = pjq("input[type=radio][name$=immediateInput][value=true]");
selenium.click(input);
@@ -285,15 +289,12 @@
@Test
@IssueTracking("https://jira.jboss.org/browse/RF-9881")
- public void testLimitToList() {
+ public void testLimitRender() {
JQueryLocator timeLoc = jq("span[id$=requestTime]");
- selenium.type(pjq("input[type=text][id$=renderInput]"), "@this");
+ selenium.click(pjq("input[type=radio][name$=limitRenderInput][value=true]"));
selenium.waitForPageToLoad();
- selenium.click(pjq("input[type=radio][name$=limitToListInput][value=true]"));
- selenium.waitForPageToLoad();
-
String time = selenium.getText(timeLoc);
guardXhr(selenium).click(tc2);
14 years
JBoss Rich Faces SVN: r20685 - in modules/tests/metamer/trunk: application/src/main/webapp/components/richTabPanel and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-12-20 08:23:47 -0500 (Mon, 20 Dec 2010)
New Revision: 20685
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTabPanelBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTabPanel/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
Log:
* fixed tests for rich:tabPanel
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTabPanelBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTabPanelBean.java 2010-12-20 12:53:38 UTC (rev 20684)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTabPanelBean.java 2010-12-20 13:23:47 UTC (rev 20685)
@@ -61,6 +61,7 @@
// TODO has to be tested in another way
attributes.remove("converter");
+ attributes.remove("itemChangeListener");
}
public Attributes getAttributes() {
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTabPanel/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTabPanel/simple.xhtml 2010-12-20 12:53:38 UTC (rev 20684)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTabPanel/simple.xhtml 2010-12-20 13:23:47 UTC (rev 20685)
@@ -69,6 +69,7 @@
styleClass="#{richTabPanelBean.attributes['styleClass'].value}"
switchType="#{richTabPanelBean.attributes['switchType'].value}"
tabContentClass="#{richTabPanelBean.attributes['tabContentClass'].value}"
+ title="#{richTabPanelBean.attributes['title'].value}"
>
<rich:tab id="tab1" name="tab1" header="tab1 header">
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2010-12-20 12:53:38 UTC (rev 20684)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTabPanel/TestRichTabPanel.java 2010-12-20 13:23:47 UTC (rev 20685)
@@ -132,6 +132,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10040")
public void testSwitchTypeServer() {
JQueryLocator selectOption = pjq("input[name$=switchTypeInput][value=server]");
selenium.click(selectOption);
@@ -145,6 +146,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10054")
public void testBypassUpdates() {
JQueryLocator input = pjq("input[type=radio][name$=bypassUpdatesInput][value=true]");
selenium.click(input);
@@ -189,6 +191,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10054")
public void testImmediate() {
JQueryLocator input = pjq("input[type=radio][name$=immediateInput][value=true]");
selenium.click(input);
@@ -207,13 +210,13 @@
@Test
@IssueTracking("https://jira.jboss.org/browse/RF-9535")
- public void testLimitToList() {
+ public void testLimitRender() {
JQueryLocator timeLoc = jq("span[id$=requestTime]");
selenium.type(pjq("input[type=text][id$=renderInput]"), "@this");
selenium.waitForPageToLoad();
- selenium.click(pjq("input[type=radio][name$=limitToListInput][value=true]"));
+ selenium.click(pjq("input[type=radio][name$=limitRenderInput][value=true]"));
selenium.waitForPageToLoad();
String time = selenium.getText(timeLoc);
14 years
JBoss Rich Faces SVN: r20684 - in modules/tests/metamer/trunk/application/src/main: webapp/components and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-20 07:53:38 -0500 (Mon, 20 Dec 2010)
New Revision: 20684
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragSourceBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml
Removed:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragBehaviorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropBehaviorBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/simple.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml
Log:
drag-n-drop: sample alligned after moving from behaviors to components (RFPL-979)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-12-20 12:27:46 UTC (rev 20683)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-12-20 12:53:38 UTC (rev 20684)
@@ -128,9 +128,9 @@
components.put("richDataGrid", "Rich Data Grid");
components.put("richDataScroller", "Rich Data Scroller");
components.put("richDataTable", "Rich Data Table");
- components.put("richDragBehavior", "Rich Drag Behavior");
+ components.put("richDragSource", "Rich Drag Source");
components.put("richDragIndicator", "Rich Drag Indicator");
- components.put("richDropBehavior", "Rich Drop Behavior");
+ components.put("richDropTarget", "Rich Drop Target");
components.put("richDropDownMenu", "Rich Drop Down Menu");
components.put("richExtendedDataTable", "Rich Extended Data Table");
components.put("richFileUpload", "Rich File Upload");
Deleted: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragBehaviorBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragBehaviorBean.java 2010-12-20 12:27:46 UTC (rev 20683)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragBehaviorBean.java 2010-12-20 12:53:38 UTC (rev 20684)
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * 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.bean;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.behavior.DragBehavior;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.model.drag.DragValue;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richDragBehaviorBean")
-@ViewScoped
-public class RichDragBehaviorBean implements Serializable {
-
- private static final int DRAG_VALUES = 3;
- private static final long serialVersionUID = 4008175400649809L;
- private static Logger logger;
- private Attributes attributes;
-
- private List<DragValue> dragValues = new ArrayList<DragValue>();
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getBehaviorAttributesFromClass(DragBehavior.class, getClass());
-
- attributes.setAttribute("event", "mouseover");
- attributes.setAttribute("type", "drg1");
-
- for (int i = 0; i < DRAG_VALUES; i++) {
- dragValues.add(new DragValue(i + 1));
- }
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public List<DragValue> getDragValues() {
- return dragValues;
- }
-
- public void setDragValues(List<DragValue> dragValues) {
- this.dragValues = dragValues;
- }
-}
Copied: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragSourceBean.java (from rev 20664, modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragBehaviorBean.java)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragSourceBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragSourceBean.java 2010-12-20 12:53:38 UTC (rev 20684)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * 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.bean;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIDragSource;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.model.drag.DragValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richDragSourceBean")
+@ViewScoped
+public class RichDragSourceBean implements Serializable {
+
+ private static final int DRAG_VALUES = 3;
+ private static final long serialVersionUID = 4008175400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ private List<DragValue> dragValues = new ArrayList<DragValue>();
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromClass(UIDragSource.class, getClass());
+
+ attributes.setAttribute("event", "mouseover");
+ attributes.setAttribute("type", "drg1");
+
+ for (int i = 0; i < DRAG_VALUES; i++) {
+ dragValues.add(new DragValue(i + 1));
+ }
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<DragValue> getDragValues() {
+ return dragValues;
+ }
+
+ public void setDragValues(List<DragValue> dragValues) {
+ this.dragValues = dragValues;
+ }
+}
Deleted: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropBehaviorBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropBehaviorBean.java 2010-12-20 12:27:46 UTC (rev 20683)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropBehaviorBean.java 2010-12-20 12:53:38 UTC (rev 20684)
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * 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.bean;
-
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.behavior.DropBehavior;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.model.drag.DragValue;
-import org.richfaces.tests.metamer.model.drag.DropValue;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richDropBehaviorBean")
-@ViewScoped
-public class RichDropBehaviorBean implements Serializable {
-
- private static final long serialVersionUID = 4008175400649809L;
- private static Logger logger;
- private Attributes attributes;
-
- private Map<DropValue, DragValue> droppedValues = new LinkedHashMap<DropValue, DragValue>();
- private DropValue dropValue;
- private int dropValueCounter = 1;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getBehaviorAttributesFromClass(DropBehavior.class, getClass());
-
- attributes.setAttribute("event", "mouseover");
- attributes.setAttribute("acceptedTypes", "drg1, drg2");
- attributes.setAttribute("render", "droppedValues");
-
- increaseDropValue();
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public Map<DropValue, DragValue> getDroppedValues() {
- return droppedValues;
- }
-
- public void increaseDropValue() {
- dropValue = new DropValue(dropValueCounter++);
- }
-
- public DropValue getDropValue() {
- return dropValue;
- }
-
- public List<Entry<DropValue, DragValue>> getDroppedEntries() {
- List<Entry<DropValue, DragValue>> list = new LinkedList<Entry<DropValue, DragValue>>(droppedValues.entrySet());
- Collections.reverse(list);
- return list;
- }
-}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java 2010-12-20 12:27:46 UTC (rev 20683)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java 2010-12-20 12:53:38 UTC (rev 20684)
@@ -39,27 +39,27 @@
private DropEvent dropEvent;
- @ManagedProperty("#{richDropBehaviorBean}")
- private RichDropBehaviorBean richDropBehaviorBean;
+ @ManagedProperty("#{richDropTargetBean}")
+ private RichDropTargetBean richDropTargetBean;
public void processDragging(DropEvent dropEvent) {
DragValue dragValue = (DragValue) dropEvent.getDragValue();
DropValue dropValue = (DropValue) dropEvent.getDropValue();
this.dropEvent = dropEvent;
- richDropBehaviorBean.increaseDropValue();
- richDropBehaviorBean.getDroppedValues().put(dropValue, dragValue);
+ richDropTargetBean.increaseDropValue();
+ richDropTargetBean.getDroppedValues().put(dropValue, dragValue);
}
public DropEvent getDropEvent() {
return dropEvent;
}
- public RichDropBehaviorBean getRichDropBehaviorBean() {
- return richDropBehaviorBean;
+ public RichDropTargetBean getRichDropTargetBean() {
+ return richDropTargetBean;
}
- public void setRichDropBehaviorBean(RichDropBehaviorBean richDropBehaviorBean) {
- this.richDropBehaviorBean = richDropBehaviorBean;
+ public void setRichDropTargetBean(RichDropTargetBean richDropBehaviorBean) {
+ this.richDropTargetBean = richDropBehaviorBean;
}
}
Copied: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java (from rev 20664, modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropBehaviorBean.java)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java 2010-12-20 12:53:38 UTC (rev 20684)
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * 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.bean;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIDropTarget;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.model.drag.DragValue;
+import org.richfaces.tests.metamer.model.drag.DropValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richDropTargetBean")
+@ViewScoped
+public class RichDropTargetBean implements Serializable {
+
+ private static final long serialVersionUID = 4008175400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ private Map<DropValue, DragValue> droppedValues = new LinkedHashMap<DropValue, DragValue>();
+ private DropValue dropValue;
+ private int dropValueCounter = 1;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromClass(UIDropTarget.class, getClass());
+
+ attributes.setAttribute("event", "mouseover");
+ attributes.setAttribute("acceptedTypes", "drg1, drg2");
+ attributes.setAttribute("render", "droppedValues");
+
+ attributes.remove("dropListener");
+
+ increaseDropValue();
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public Map<DropValue, DragValue> getDroppedValues() {
+ return droppedValues;
+ }
+
+ public void increaseDropValue() {
+ dropValue = new DropValue(dropValueCounter++);
+ }
+
+ public DropValue getDropValue() {
+ return dropValue;
+ }
+
+ public List<Entry<DropValue, DragValue>> getDroppedEntries() {
+ List<Entry<DropValue, DragValue>> list = new LinkedList<Entry<DropValue, DragValue>>(droppedValues.entrySet());
+ Collections.reverse(list);
+ return list;
+ }
+}
Deleted: modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/list.xhtml 2010-12-20 12:27:46 UTC (rev 20683)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/list.xhtml 2010-12-20 12:53:38 UTC (rev 20684)
@@ -1,42 +0,0 @@
-<?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:ui="http://java.sun.com/jsf/facelets"
- xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
-
- <!--
-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/list.xhtml">
-
- <ui:define name="pageTitle">Rich Drag Behavior</ui:define>
-
- <ui:define name="links">
-
- <metamer:testPageLink id="simple" outcome="simple" value="Simple">
-
- </metamer:testPageLink>
-
- </ui:define>
-
- </ui:composition>
-
-</html>
Deleted: modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/simple.xhtml 2010-12-20 12:27:46 UTC (rev 20683)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/simple.xhtml 2010-12-20 12:53:38 UTC (rev 20684)
@@ -1,124 +0,0 @@
-<?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:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:a4j="http://richfaces.org/a4j">
-
-<!--
-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:param name="componentId" value="richTree" />
-
- <ui:define name="head">
- <f:metadata>
- <f:viewParam name="templates" value="#{templateBean.templates}">
- <f:converter converterId="templatesListConverter" />
- </f:viewParam>
- <f:event type="preRenderView"
- listener="#{richTreeBean.preRenderView}" />
- </f:metadata>
- <h:outputStylesheet library="css" name="richDragBehavior.css" />
- </ui:define>
-
- <ui:define name="outOfTemplateBefore">
- </ui:define>
-
- <ui:define name="component">
-
- <rich:dragIndicator id="indicator" />
-
- <table>
- <tr>
- <td>
- <a4j:outputPanel id="draggable1" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragBehaviorBean.dragValues[0]}" />
- <rich:dragBehavior event="mouseover"
- dragValue="#{richDragBehaviorBean.dragValues[0]}"
-
- dragIndicator="#{richDragBehaviorBean.attributes['dragIndicator'].value}"
- type="#{richDragBehaviorBean.attributes['type'].value}" />
- </a4j:outputPanel>
- </td>
- <td>
- <a4j:outputPanel id="draggable2" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragBehaviorBean.dragValues[1]}" />
- <rich:dragBehavior event="mouseover" type="drg2" dragIndicator="indicator" dragValue="#{richDragBehaviorBean.dragValues[1]}" />
- </a4j:outputPanel>
- </td>
- <td>
- <a4j:outputPanel id="draggable3" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragBehaviorBean.dragValues[2]}" />
- <rich:dragBehavior event="mouseover" type="drg3" dragIndicator="indicator" dragValue="#{richDragBehaviorBean.dragValues[2]}" />
- </a4j:outputPanel>
- </td>
- </tr>
- </table>
-
- <a4j:outputPanel id="droppable" layout="block" styleClass="droppable">
- <rich:dropBehavior event="mouseover"
- dropValue="#{richDropBehaviorBean.dropValue}"
- listener="#{richDropListenerBean.processDragging}"
- acceptedTypes="drg1, drg2"
- render="droppedValues"
- />
-
- <h:dataTable id="droppedValues" var="droppedValue" value="#{richDropBehaviorBean.droppedEntries}">
- <h:column>
- <h:outputText value="#{droppedValue.key}" />
- </h:column>
- <h:column>
- <h:outputText value="#{droppedValue.value}" />
- </h:column>
- </h:dataTable>
- </a4j:outputPanel>
-
- </ui:define>
-
- <ui:define name="outOfTemplateAfter">
- <a4j:outputPanel ajaxRendered="true">
- <h:panelGrid columns="2">
- <h:outputLabel value="Drop Event:" rendered="#{not empty richDropListenerBean.dropEvent}" />
- <h:panelGroup rendered="#{not empty richDropListenerBean.dropEvent}">
- <h:panelGrid columns="2">
- <h:outputLabel value="clientId:" />
- <h:outputText value="#{richDropListenerBean.dropEvent.component.clientId}" />
-
- <h:outputLabel value="Drag Value:" />
- <h:outputText value="#{richDropListenerBean.dropEvent.dragValue}" />
-
- <h:outputLabel value="Drop Value:" />
- <h:outputText value="#{richDropListenerBean.dropEvent.dropValue}" />
- </h:panelGrid>
- </h:panelGroup>
- </h:panelGrid>
- </a4j:outputPanel>
-
- <metamer:attributes value="#{richDragBehaviorBean.attributes}" id="attributes" />
- </ui:define>
-
-</ui:composition>
-</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/list.xhtml 2010-12-20 12:27:46 UTC (rev 20683)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/list.xhtml 2010-12-20 12:53:38 UTC (rev 20684)
@@ -32,7 +32,8 @@
<ui:define name="links">
<metamer:testPageLink id="simple" outcome="simple" value="Simple">
-
+ <div>The simple <b>rich:dropTarget</b> component tied to target component.</div>
+ <div>After drop to target, details of event appears.</div>
</metamer:testPageLink>
</ui:define>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml 2010-12-20 12:27:46 UTC (rev 20683)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml 2010-12-20 12:53:38 UTC (rev 20684)
@@ -60,36 +60,36 @@
<tr>
<td>
<a4j:outputPanel id="draggable1" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragBehaviorBean.dragValues[0]}" />
- <rich:dragBehavior event="mouseover"
- dragValue="#{richDragBehaviorBean.dragValues[0]}"
+ <h:outputText value="#{richDragSourceBean.dragValues[0]}" />
+ <rich:dragSource event="mouseover"
+ dragValue="#{richDragSourceBean.dragValues[0]}"
type="drg1" />
</a4j:outputPanel>
</td>
<td>
<a4j:outputPanel id="draggable2" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragBehaviorBean.dragValues[1]}" />
- <rich:dragBehavior event="mouseover" type="drg2" dragIndicator="indicator" dragValue="#{richDragBehaviorBean.dragValues[1]}" />
+ <h:outputText value="#{richDragSourceBean.dragValues[1]}" />
+ <rich:dragSource event="mouseover" type="drg2" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[1]}" />
</a4j:outputPanel>
</td>
<td>
<a4j:outputPanel id="draggable3" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragBehaviorBean.dragValues[2]}" />
- <rich:dragBehavior event="mouseover" type="drg3" dragIndicator="indicator" dragValue="#{richDragBehaviorBean.dragValues[2]}" />
+ <h:outputText value="#{richDragSourceBean.dragValues[2]}" />
+ <rich:dragSource event="mouseover" type="drg3" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[2]}" />
</a4j:outputPanel>
</td>
</tr>
</table>
<a4j:outputPanel id="droppable" layout="block" styleClass="droppable">
- <rich:dropBehavior event="mouseover"
- dropValue="#{richDropBehaviorBean.dropValue}"
- listener="#{richDropListenerBean.processDragging}"
+ <rich:dropTarget event="mouseover"
+ dropValue="#{richDropTargetBean.dropValue}"
+ dropListener="#{richDropListenerBean.processDragging}"
acceptedTypes="drg1, drg2"
render="droppedValues"
/>
- <h:dataTable id="droppedValues" var="droppedValue" value="#{richDropBehaviorBean.droppedEntries}">
+ <h:dataTable id="droppedValues" var="droppedValue" value="#{richDropTargetBean.droppedEntries}">
<h:column>
<h:outputText value="#{droppedValue}" />
</h:column>
Copied: modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/list.xhtml (from rev 20664, modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/list.xhtml)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/list.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/list.xhtml 2010-12-20 12:53:38 UTC (rev 20684)
@@ -0,0 +1,44 @@
+<?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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+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/list.xhtml">
+
+ <ui:define name="pageTitle">Rich Drag Source</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple" value="Simple">
+ <div>The 3 simple <b>rich:dragSource</b> components tied to target component.</div>
+ <div>Attributes are tied to first of components.</div>
+ <div>After drop to target, details of event appears.</div>
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Copied: modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml (from rev 20664, modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/simple.xhtml)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml 2010-12-20 12:53:38 UTC (rev 20684)
@@ -0,0 +1,124 @@
+<?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:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:a4j="http://richfaces.org/a4j">
+
+<!--
+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:param name="componentId" value="richTree" />
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ <f:event type="preRenderView"
+ listener="#{richTreeBean.preRenderView}" />
+ </f:metadata>
+ <h:outputStylesheet library="css" name="richDragBehavior.css" />
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dragIndicator id="indicator" />
+
+ <table>
+ <tr>
+ <td>
+ <a4j:outputPanel id="draggable1" layout="block" styleClass="draggable">
+ <h:outputText value="#{richDragSourceBean.dragValues[0]}" />
+ <rich:dragSource event="mouseover"
+ dragValue="#{richDragSourceBean.dragValues[0]}"
+
+ dragIndicator="#{richDragSourceBean.attributes['dragIndicator'].value}"
+ type="#{richDragSourceBean.attributes['type'].value}" />
+ </a4j:outputPanel>
+ </td>
+ <td>
+ <a4j:outputPanel id="draggable2" layout="block" styleClass="draggable">
+ <h:outputText value="#{richDragSourceBean.dragValues[1]}" />
+ <rich:dragSource event="mouseover" type="drg2" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[1]}" />
+ </a4j:outputPanel>
+ </td>
+ <td>
+ <a4j:outputPanel id="draggable3" layout="block" styleClass="draggable">
+ <h:outputText value="#{richDragSourceBean.dragValues[2]}" />
+ <rich:dragSource event="mouseover" type="drg3" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[2]}" />
+ </a4j:outputPanel>
+ </td>
+ </tr>
+ </table>
+
+ <a4j:outputPanel id="droppable" layout="block" styleClass="droppable">
+ <rich:dropTarget event="mouseover"
+ dropValue="#{richDropTargetBean.dropValue}"
+ dropListener="#{richDropListenerBean.processDragging}"
+ acceptedTypes="drg1, drg2"
+ render="droppedValues"
+ />
+
+ <h:dataTable id="droppedValues" var="droppedValue" value="#{richDropTargetBean.droppedEntries}">
+ <h:column>
+ <h:outputText value="#{droppedValue.key}" />
+ </h:column>
+ <h:column>
+ <h:outputText value="#{droppedValue.value}" />
+ </h:column>
+ </h:dataTable>
+ </a4j:outputPanel>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <a4j:outputPanel ajaxRendered="true">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="Drop Event:" rendered="#{not empty richDropListenerBean.dropEvent}" />
+ <h:panelGroup rendered="#{not empty richDropListenerBean.dropEvent}">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="clientId:" />
+ <h:outputText value="#{richDropListenerBean.dropEvent.component.clientId}" />
+
+ <h:outputLabel value="Drag Value:" />
+ <h:outputText value="#{richDropListenerBean.dropEvent.dragValue}" />
+
+ <h:outputLabel value="Drop Value:" />
+ <h:outputText value="#{richDropListenerBean.dropEvent.dropValue}" />
+ </h:panelGrid>
+ </h:panelGroup>
+ </h:panelGrid>
+ </a4j:outputPanel>
+
+ <metamer:attributes value="#{richDragSourceBean.attributes}" id="attributes" />
+ </ui:define>
+
+</ui:composition>
+</html>
\ No newline at end of file
Deleted: modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/list.xhtml 2010-12-20 12:27:46 UTC (rev 20683)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/list.xhtml 2010-12-20 12:53:38 UTC (rev 20684)
@@ -1,42 +0,0 @@
-<?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:ui="http://java.sun.com/jsf/facelets"
- xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
-
- <!--
-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/list.xhtml">
-
- <ui:define name="pageTitle">Rich Drop Behavior</ui:define>
-
- <ui:define name="links">
-
- <metamer:testPageLink id="simple" outcome="simple" value="Simple">
-
- </metamer:testPageLink>
-
- </ui:define>
-
- </ui:composition>
-
-</html>
Deleted: modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/simple.xhtml 2010-12-20 12:27:46 UTC (rev 20683)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/simple.xhtml 2010-12-20 12:53:38 UTC (rev 20684)
@@ -1,132 +0,0 @@
-<?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:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:a4j="http://richfaces.org/a4j">
-
-<!--
-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:param name="componentId" value="richTree" />
-
- <ui:define name="head">
- <f:metadata>
- <f:viewParam name="templates" value="#{templateBean.templates}">
- <f:converter converterId="templatesListConverter" />
- </f:viewParam>
- <f:event type="preRenderView"
- listener="#{richTreeBean.preRenderView}" />
- </f:metadata>
- <h:outputStylesheet library="css" name="richDragBehavior.css" />
- </ui:define>
-
- <ui:define name="outOfTemplateBefore">
- </ui:define>
-
- <ui:define name="component">
-
- <rich:dragIndicator id="indicator" />
-
- <table>
- <tr>
- <td>
- <a4j:outputPanel id="draggable1" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragBehaviorBean.dragValues[0]}" />
- <rich:dragBehavior event="mouseover"
- dragValue="#{richDragBehaviorBean.dragValues[0]}"
- type="drg1" />
- </a4j:outputPanel>
- </td>
- <td>
- <a4j:outputPanel id="draggable2" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragBehaviorBean.dragValues[1]}" />
- <rich:dragBehavior event="mouseover" type="drg2" dragIndicator="indicator" dragValue="#{richDragBehaviorBean.dragValues[1]}" />
- </a4j:outputPanel>
- </td>
- <td>
- <a4j:outputPanel id="draggable3" layout="block" styleClass="draggable">
- <h:outputText value="#{richDragBehaviorBean.dragValues[2]}" />
- <rich:dragBehavior event="mouseover" type="drg3" dragIndicator="indicator" dragValue="#{richDragBehaviorBean.dragValues[2]}" />
- </a4j:outputPanel>
- </td>
- </tr>
- </table>
-
- <a4j:outputPanel id="droppable" layout="block" styleClass="droppable">
- <rich:dropBehavior event="mouseover"
- dropValue="#{richDropBehaviorBean.dropValue}"
- listener="#{richDropListenerBean.processDragging}"
-
- acceptedTypes="#{richDragBehaviorBean.attributes['acceptedTypes'].value}"
- bypassUpdates="#{richDragBehaviorBean.attributes['bypassUpdates'].value}"
- data="#{richDragBehaviorBean.attributes['data'].value}"
- disabled="#{richDragBehaviorBean.attributes['disabled'].value}"
- execute="#{richDragBehaviorBean.attributes['execute'].value}"
- immediate="#{richDragBehaviorBean.attributes['immediate'].value}"
- limitRender="#{richDragBehaviorBean.attributes['limitRender'].value}"
- onbeforedomupdate="#{richDragBehaviorBean.attributes['onbeforedomupdate'].value}"
- onbegin="#{richDragBehaviorBean.attributes['onbegin'].value}"
- oncomplete="#{richDragBehaviorBean.attributes['oncomplete'].value}"
- onerror="#{richDragBehaviorBean.attributes['onerror'].value}"
- queueId="#{richDragBehaviorBean.attributes['queueId'].value}"
- render="#{richDragBehaviorBean.attributes['render'].value}"
- status="#{richDragBehaviorBean.attributes['status'].value}"
- />
-
- <h:dataTable id="droppedValues" var="droppedValue" value="#{richDropBehaviorBean.droppedEntries}">
- <h:column>
- <h:outputText value="#{droppedValue}" />
- </h:column>
- </h:dataTable>
- </a4j:outputPanel>
-
- </ui:define>
-
- <ui:define name="outOfTemplateAfter">
- <a4j:outputPanel ajaxRendered="true">
- <h:panelGrid columns="2">
- <h:outputLabel value="Drop Event:" rendered="#{not empty richDropListenerBean.dropEvent}" />
- <h:panelGroup rendered="#{not empty richDropListenerBean.dropEvent}">
- <h:panelGrid columns="2">
- <h:outputLabel value="clientId:" />
- <h:outputText value="#{richDropListenerBean.dropEvent.component.clientId}" />
-
- <h:outputLabel value="Drag Value:" />
- <h:outputText value="#{richDropListenerBean.dropEvent.dragValue}" />
-
- <h:outputLabel value="Drop Value:" />
- <h:outputText value="#{richDropListenerBean.dropEvent.dropValue}" />
- </h:panelGrid>
- </h:panelGroup>
- </h:panelGrid>
- </a4j:outputPanel>
-
- <metamer:attributes value="#{richDropBehaviorBean.attributes}" id="dropBehaviorAttributes" />
- </ui:define>
-
-</ui:composition>
-</html>
\ No newline at end of file
Copied: modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/list.xhtml (from rev 20664, modules/tests/metamer/trunk/application/src/main/webapp/components/richDragBehavior/list.xhtml)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/list.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/list.xhtml 2010-12-20 12:53:38 UTC (rev 20684)
@@ -0,0 +1,43 @@
+<?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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+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/list.xhtml">
+
+ <ui:define name="pageTitle">Rich Drop Target</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple" value="Simple">
+ <div>The simple <b>rich:dropTarget</b> component tied to target component.</div>
+ <div>After drop to target, details of event appears.</div>
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Copied: modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml (from rev 20664, modules/tests/metamer/trunk/application/src/main/webapp/components/richDropBehavior/simple.xhtml)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml 2010-12-20 12:53:38 UTC (rev 20684)
@@ -0,0 +1,132 @@
+<?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:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:a4j="http://richfaces.org/a4j">
+
+<!--
+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:param name="componentId" value="richTree" />
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ <f:event type="preRenderView"
+ listener="#{richTreeBean.preRenderView}" />
+ </f:metadata>
+ <h:outputStylesheet library="css" name="richDragBehavior.css" />
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dragIndicator id="indicator" />
+
+ <table>
+ <tr>
+ <td>
+ <a4j:outputPanel id="draggable1" layout="block" styleClass="draggable">
+ <h:outputText value="#{richDragSourceBean.dragValues[0]}" />
+ <rich:dragSource event="mouseover"
+ dragValue="#{richDragSourceBean.dragValues[0]}"
+ type="drg1" />
+ </a4j:outputPanel>
+ </td>
+ <td>
+ <a4j:outputPanel id="draggable2" layout="block" styleClass="draggable">
+ <h:outputText value="#{richDragSourceBean.dragValues[1]}" />
+ <rich:dragSource event="mouseover" type="drg2" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[1]}" />
+ </a4j:outputPanel>
+ </td>
+ <td>
+ <a4j:outputPanel id="draggable3" layout="block" styleClass="draggable">
+ <h:outputText value="#{richDragSourceBean.dragValues[2]}" />
+ <rich:dragSource event="mouseover" type="drg3" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[2]}" />
+ </a4j:outputPanel>
+ </td>
+ </tr>
+ </table>
+
+ <a4j:outputPanel id="droppable" layout="block" styleClass="droppable">
+ <rich:dropTarget event="mouseover"
+ dropValue="#{richDropTargetBean.dropValue}"
+ dropListener="#{richDropListenerBean.processDragging}"
+
+ acceptedTypes="#{richDragSourceBean.attributes['acceptedTypes'].value}"
+ bypassUpdates="#{richDragSourceBean.attributes['bypassUpdates'].value}"
+ data="#{richDragSourceBean.attributes['data'].value}"
+ disabled="#{richDragSourceBean.attributes['disabled'].value}"
+ execute="#{richDragSourceBean.attributes['execute'].value}"
+ immediate="#{richDragSourceBean.attributes['immediate'].value}"
+ limitRender="#{richDragSourceBean.attributes['limitRender'].value}"
+ onbeforedomupdate="#{richDragSourceBean.attributes['onbeforedomupdate'].value}"
+ onbegin="#{richDragSourceBean.attributes['onbegin'].value}"
+ oncomplete="#{richDragSourceBean.attributes['oncomplete'].value}"
+ onerror="#{richDragSourceBean.attributes['onerror'].value}"
+ queueId="#{richDragSourceBean.attributes['queueId'].value}"
+ render="#{richDragSourceBean.attributes['render'].value}"
+ status="#{richDragSourceBean.attributes['status'].value}"
+ />
+
+ <h:dataTable id="droppedValues" var="droppedValue" value="#{richDropTargetBean.droppedEntries}">
+ <h:column>
+ <h:outputText value="#{droppedValue}" />
+ </h:column>
+ </h:dataTable>
+ </a4j:outputPanel>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <a4j:outputPanel ajaxRendered="true">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="Drop Event:" rendered="#{not empty richDropListenerBean.dropEvent}" />
+ <h:panelGroup rendered="#{not empty richDropListenerBean.dropEvent}">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="clientId:" />
+ <h:outputText value="#{richDropListenerBean.dropEvent.component.clientId}" />
+
+ <h:outputLabel value="Drag Value:" />
+ <h:outputText value="#{richDropListenerBean.dropEvent.dragValue}" />
+
+ <h:outputLabel value="Drop Value:" />
+ <h:outputText value="#{richDropListenerBean.dropEvent.dropValue}" />
+ </h:panelGrid>
+ </h:panelGroup>
+ </h:panelGrid>
+ </a4j:outputPanel>
+
+ <metamer:attributes value="#{richDropTargetBean.attributes}" id="dropBehaviorAttributes" />
+ </ui:define>
+
+</ui:composition>
+</html>
\ No newline at end of file
14 years
JBoss Rich Faces SVN: r20683 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richSelect and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-12-20 07:27:46 -0500 (Mon, 20 Dec 2010)
New Revision: 20683
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java
Log:
* tests for rich:select fixed
* added testLimitRender for accordion
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java 2010-12-20 08:28:19 UTC (rev 20682)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java 2010-12-20 12:27:46 UTC (rev 20683)
@@ -28,6 +28,7 @@
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotSame;
import static org.testng.Assert.assertTrue;
import java.net.URL;
@@ -298,6 +299,26 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-9934")
+ public void testLimitRender() {
+ JQueryLocator timeLoc = jq("span[id$=requestTime]");
+
+// selenium.type(pjq("input[type=text][id$=renderInput]"), "@this");
+// selenium.waitForPageToLoad();
+
+ selenium.click(pjq("input[type=radio][name$=limitRenderInput][value=true]"));
+ selenium.waitForPageToLoad();
+
+ String time = selenium.getText(timeLoc);
+
+ guardXhr(selenium).click(inactiveHeaders[1]);
+ waitGui.failWith("Item 2 is not displayed.").until(isDisplayed.locator(itemContents[1]));
+
+ String newTime = selenium.getText(timeLoc);
+ assertNotSame(newTime, time, "Panel with ajaxRendered=true should not be rerendered.");
+ }
+
+ @Test
public void testOnclick() {
testFireEvent(Event.CLICK, accordion);
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java 2010-12-20 08:28:19 UTC (rev 20682)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java 2010-12-20 12:27:46 UTC (rev 20683)
@@ -73,7 +73,8 @@
@Test
public void testSelectWithMouse() {
- guardNoRequest(selenium).click(button);
+ guardNoRequest(selenium).mouseDown(button);
+ selenium.mouseUp(button);
assertTrue(selenium.isVisible(popup), "Popup should be displayed.");
for (int i = 0; i < 50; i++) {
@@ -173,11 +174,11 @@
AttributeLocator readonlyAttr = input.getAttribute(new Attribute("readonly"));
assertEquals(selenium.getAttribute(readonlyAttr), "readonly", "Input should be read-only");
- selenium.click(button);
+ selenium.mouseDown(button);
assertTrue(selenium.isVisible(popup), "Popup should be displayed.");
selenium.click(options.format(10));
- guardXhr(selenium).fireEvent(input, Event.BLUR);
+ selenium.fireEvent(input, Event.BLUR);
assertTrue(selenium.belongsClass(options.format(10), "rf-sel-sel"));
waitGui.failWith("Bean was not updated").until(textEquals.locator(output).text("Hawaii"));
@@ -361,8 +362,15 @@
}
@Test
- public void testOnselect() {
- testFireEvent(Event.SELECT, input);
+ public void testOnselectitem() {
+ selenium.type(pjq("input[type=text][id$=onselectitemInput]"), "metamerEvents += \"selectitem \"");
+ selenium.waitForPageToLoad();
+
+ selenium.click(button);
+ selenium.click(options.format(10));
+
+ waitGui.failWith("Attribute onchange does not work correctly").until(
+ new EventFiredCondition(new Event("selectitem")));
}
@Test
14 years
JBoss Rich Faces SVN: r20682 - management/design-4x/TabPanel.
by richfaces-svn-commits@lists.jboss.org
Author: Ochikvina
Date: 2010-12-20 03:28:19 -0500 (Mon, 20 Dec 2010)
New Revision: 20682
Added:
management/design-4x/TabPanel/tabline_bg.gif
Log:
RF-9412 -Added missed image.
Added: management/design-4x/TabPanel/tabline_bg.gif
===================================================================
(Binary files differ)
Property changes on: management/design-4x/TabPanel/tabline_bg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years
JBoss Rich Faces SVN: r20681 - branches.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-19 17:07:33 -0500 (Sun, 19 Dec 2010)
New Revision: 20681
Removed:
branches/RF-7654/
Log:
remove merged development branch
14 years
JBoss Rich Faces SVN: r20680 - trunk.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-19 17:06:42 -0500 (Sun, 19 Dec 2010)
New Revision: 20680
Modified:
trunk/
Log:
Removed merge tracking for "svnmerge" for
https://svn.jboss.org/repos/richfaces/branches/RF-7654
Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RF-7654:1-20678 /branches/RF-7817:1-19154 /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378
+ /branches/RF-7817:1-19154 /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378
14 years
JBoss Rich Faces SVN: r20679 - in trunk: cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model and 25 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-19 17:05:58 -0500 (Sun, 19 Dec 2010)
New Revision: 20679
Added:
trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/TagExtensionBase.java
trunk/core/api/src/main/java/org/ajax4jsf/javascript/JSWithDependencies.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/CustomValidator.java
trunk/examples/validator-demo/src/main/webapp/examples/ajax-validator.xhtml
trunk/examples/validator-demo/src/main/webapp/examples/client-validator.xhtml
trunk/ui/validator/ui/src/main/config/
trunk/ui/validator/ui/src/main/config/faces-config.xml
trunk/ui/validator/ui/src/main/config/messages.xml
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageRendererBase.java
trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/message.js
trunk/ui/validator/ui/src/main/resources/META-INF/richfaces/org.richfaces/message.library.properties
trunk/ui/validator/ui/src/main/templates/
trunk/ui/validator/ui/src/main/templates/message.template.xml
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/ClearMessageTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/DocumentReadyTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/SendMessageTest.java
trunk/ui/validator/ui/src/test/resources/1.html
Removed:
trunk/examples/validator-demo/src/main/java/org/richfaces/example/DataBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/GraphValidatorBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/LengthBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/MaxBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinMaxBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotEmptyBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotNullBean.java
trunk/examples/validator-demo/src/main/java/org/richfaces/example/Validable.java
trunk/examples/validator-demo/src/main/webapp/examples/ajaxValidation.xhtml
trunk/examples/validator-demo/src/main/webapp/examples/beanValidation.xhtml
trunk/examples/validator-demo/src/main/webapp/examples/graphValidation.xhtml
trunk/ui/validator/ui/src/main/config/faces-config.xml
trunk/ui/validator/ui/src/main/config/messages.xml
trunk/ui/validator/ui/src/main/java/org/richfaces/validator/ClientScriptServiceImpl.java
trunk/ui/validator/ui/src/main/java/org/richfaces/validator/ClientServiceConfigParser.java
trunk/ui/validator/ui/src/main/java/org/richfaces/validator/LibraryFunctionImplementation.java
trunk/ui/validator/ui/src/main/resources/META-INF/csv.taglib.xml
trunk/ui/validator/ui/src/main/resources/META-INF/faces-config.xml
trunk/ui/validator/ui/src/main/templates/message.template.xml
trunk/ui/validator/ui/src/test/java/org/richfaces/convert/
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/TestCriteria.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/ClearMessageTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/SendMessageTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/validator/ClientScriptServiceTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/validator/ServiceConfigParserTest.java
Modified:
trunk/
trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java
trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java
trunk/core/impl/src/main/java/org/richfaces/component/UIScripts.java
trunk/core/impl/src/main/resources/META-INF/resources/richfaces-event.js
trunk/core/impl/src/test/java/org/richfaces/component/UIViewResourceTest.java
trunk/examples/template/src/main/webapp/WEB-INF/web.xml
trunk/examples/validator-demo/src/main/java/org/richfaces/example/Bean.java
trunk/examples/validator-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/ui/pom.xml
trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ValidatorScriptBase.java
trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/csv.js
trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js
trunk/ui/validator/ui/src/test/java/org/richfaces/component/AjaxValidationTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/component/ClientValidationTest.java
trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/MockTestBase.java
trunk/ui/validator/ui/src/test/resources/org/richfaces/component/client-test.xhtml
trunk/ui/validator/ui/src/test/resources/org/richfaces/component/test.xhtml
Log:
Merged revisions 20630-20632,20646,20657,20674,20676-20677 via svnmerge from
https://svn.jboss.org/repos/richfaces/branches/RF-7654
.......
r20630 | alexsmirnov | 2010-12-16 17:09:52 -0800 (Thu, 16 Dec 2010) | 2 lines
CODING IN PROGRESS - issue RF-7654: rich:message/rich:messages
https://issues.jboss.org/browse/RF-7654
.......
r20631 | alexsmirnov | 2010-12-16 17:21:37 -0800 (Thu, 16 Dec 2010) | 2 lines
CODING IN PROGRESS - issue RF-7654: rich:message/rich:messages
https://issues.jboss.org/browse/RF-7654
.......
r20632 | alexsmirnov | 2010-12-16 17:27:58 -0800 (Thu, 16 Dec 2010) | 2 lines
CODING IN PROGRESS - issue RF-7654: rich:message/rich:messages
https://issues.jboss.org/browse/RF-7654
.......
r20646 | nbelaevski | 2010-12-17 06:15:05 -0800 (Fri, 17 Dec 2010) | 1 line
Removed duplicate files
.......
r20657 | pyaschenko | 2010-12-17 07:59:45 -0800 (Fri, 17 Dec 2010) | 1 line
http://jira.jboss.com/jira/browse/RF-9250
.......
r20674 | alexsmirnov | 2010-12-17 16:11:17 -0800 (Fri, 17 Dec 2010) | 2 lines
CODING IN PROGRESS - issue RF-7654: rich:message/rich:messages
https://issues.jboss.org/browse/RF-7654
.......
r20676 | alexsmirnov | 2010-12-17 16:39:32 -0800 (Fri, 17 Dec 2010) | 2 lines
CODING IN PROGRESS - issue RF-7654: rich:message/rich:messages
https://issues.jboss.org/browse/RF-7654
.......
r20677 | alexsmirnov | 2010-12-18 22:02:48 -0800 (Sat, 18 Dec 2010) | 2 lines
RESOLVED - issue RF-9222: CSV: development sample subtask
https://issues.jboss.org/browse/RF-9222
.......
Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RF-7654:1-20571 /branches/RF-7817:1-19154 /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378
+ /branches/RF-7654:1-20678 /branches/RF-7817:1-19154 /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/BehaviorBean.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -34,6 +34,7 @@
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.PropertyModel;
+
/**
* @author akolonitsky
* @since Jan 21, 2010
@@ -90,6 +91,7 @@
super.setExtension(extension);
}
- public static class BehaviorExtension extends ExtensionBeanBase {
+ public static class BehaviorExtension extends TagExtensionBase {
+
}
}
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ComponentBean.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -37,7 +37,6 @@
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.FacetModel;
import org.richfaces.cdk.model.PropertyModel;
-import org.richfaces.cdk.model.TagModel;
import com.google.common.collect.Lists;
@@ -144,10 +143,9 @@
super.setExtension(extension);
}
- public static class ComponentExtension extends ExtensionBeanBase {
+ public static class ComponentExtension extends TagExtensionBase {
private FacesId rendererType;
private List<EventModel> events = Lists.newArrayList();
- private List<TagModel> tags = Lists.newArrayList();
private FacesId family;
/**
@@ -207,25 +205,6 @@
public void setEvents(List<EventModel> events) {
this.events = events;
}
-
- /**
- * <p class="changed_added_4_0"></p>
- *
- * @return the tags
- */
- @XmlElement(name = "tag", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
- public List<TagModel> getTags() {
- return this.tags;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- *
- * @param tags the tags to set
- */
- public void setTags(List<TagModel> tags) {
- this.tags = tags;
- }
}
}
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ConverterBean.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -33,6 +33,7 @@
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.PropertyModel;
+
/**
* @author akolonitsky
* @since Jan 6, 2010
@@ -100,7 +101,7 @@
return super.getExtension();
}
- public static class ConverterExtension extends ExtensionBeanBase {
+ public static class ConverterExtension extends TagExtensionBase {
}
}
Copied: trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/TagExtensionBase.java (from rev 20657, branches/RF-7654/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/TagExtensionBase.java)
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/TagExtensionBase.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/TagExtensionBase.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -0,0 +1,36 @@
+package org.richfaces.cdk.xmlconfig.model;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.TagModel;
+
+import com.google.common.collect.Lists;
+
+public class TagExtensionBase extends ExtensionBeanBase {
+
+ private List<TagModel> tags = Lists.newArrayList();
+
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ *
+ * @return the tags
+ */
+ @XmlElement(name = "tag", namespace = ComponentLibrary.CDK_EXTENSIONS_NAMESPACE)
+ public List<TagModel> getTags() {
+ return this.tags;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ *
+ * @param tags the tags to set
+ */
+ public void setTags(List<TagModel> tags) {
+ this.tags = tags;
+ }
+
+}
\ No newline at end of file
Modified: trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ValidatorBean.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -33,6 +33,7 @@
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.model.PropertyModel;
+
/**
* @author akolonitsky
* @since Jan 13, 2010
@@ -91,7 +92,7 @@
super.setExtension(extension);
}
- public static class ValidatorExtension extends ExtensionBeanBase {
+ public static class ValidatorExtension extends TagExtensionBase {
}
}
Copied: trunk/core/api/src/main/java/org/ajax4jsf/javascript/JSWithDependencies.java (from rev 20677, branches/RF-7654/core/api/src/main/java/org/ajax4jsf/javascript/JSWithDependencies.java)
===================================================================
--- trunk/core/api/src/main/java/org/ajax4jsf/javascript/JSWithDependencies.java (rev 0)
+++ trunk/core/api/src/main/java/org/ajax4jsf/javascript/JSWithDependencies.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -0,0 +1,66 @@
+/*
+ * $Id$
+ * 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.ajax4jsf.javascript;
+
+import java.io.IOException;
+
+import org.richfaces.resource.ResourceKey;
+
+import com.google.common.collect.ImmutableList;
+
+/**
+ * <p class="changed_added_4_0">Wrapper object that adds dependencies to any object whether it implements {@link ScriptString} or not.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class JSWithDependencies extends ScriptStringBase implements ScriptWithDependencies {
+
+ private final Iterable<ResourceKey> resources;
+
+ private final Object wrapped;
+
+ public JSWithDependencies(Object wrapped,Iterable<ResourceKey> resources) {
+ this.wrapped = wrapped;
+ this.resources = ImmutableList.copyOf(resources);
+ }
+
+ public JSWithDependencies(Object wrapped,ResourceKey... resources) {
+ this.wrapped = wrapped;
+ this.resources = ImmutableList.copyOf(resources);
+ }
+ /* (non-Javadoc)
+ * @see org.richfaces.resource.ResourceLibrary#getResources()
+ */
+ public Iterable<ResourceKey> getResources() {
+ return resources;
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.javascript.ScriptString#appendScript(java.lang.Appendable)
+ */
+ public void appendScript(Appendable target) throws IOException {
+ ScriptUtils.appendScript(target, wrapped);
+ }
+
+}
Modified: trunk/core/impl/src/main/java/org/richfaces/component/UIScripts.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/component/UIScripts.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/core/impl/src/main/java/org/richfaces/component/UIScripts.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -50,7 +50,7 @@
private final List<Object> pageReadyScripts = Lists.newArrayList();
- private String target = "form";
+ private String target = "body";
/* (non-Javadoc)
* @see org.richfaces.component.ScriptsHolder#getScripts()
Modified: trunk/core/impl/src/main/resources/META-INF/resources/richfaces-event.js
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/richfaces-event.js 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/core/impl/src/main/resources/META-INF/resources/richfaces-event.js 2010-12-19 22:05:58 UTC (rev 20679)
@@ -61,6 +61,8 @@
* @type string
* */
EVENT_NAMESPACE_SEPARATOR : ".",
+
+ MESSAGE_EVENT_TYPE: "onmessage",
/**
* Attach an event handler to execute when the DOM is fully loaded.
Modified: trunk/core/impl/src/test/java/org/richfaces/component/UIViewResourceTest.java
===================================================================
--- trunk/core/impl/src/test/java/org/richfaces/component/UIViewResourceTest.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/core/impl/src/test/java/org/richfaces/component/UIViewResourceTest.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -29,10 +29,12 @@
"<html xmlns=\"http://www.w3.org/1999/xhtml\"\n" +
" xmlns:ui=\"http://java.sun.com/jsf/facelets\"\n" +
" xmlns:h=\"http://java.sun.com/jsf/html\">"+
+ "<h:body>\n"+
"<h:form id=\"helloForm\" >"+
" <h:inputText id=\"input\" value=\"#{test.value}\" />\n" +
" <h:commandButton id=\"command\" value=\"Ok\" action=\"#{test.action}\"/>\n" +
"</h:form>\n" +
+ "</h:body>\n" +
"</html>").
withResource(FacesEnvironment.FACES_CONFIG_XML, "org/richfaces/component/faces-config.xml").
start();
Modified: trunk/examples/template/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/examples/template/src/main/webapp/WEB-INF/web.xml 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/examples/template/src/main/webapp/WEB-INF/web.xml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,6 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>validator-demo</display-name>
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.richfaces.enableControlSkinning</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.richfaces.enableControlSkinningClasses</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+
+ <!-- Faces Servlet Mapping -->
+ <!--
+
+ This mapping identifies a jsp page as having JSF content. If a request
+ comes to the server for foo.faces, the container will send the request
+ to the FacesServlet, which will expect a corresponding foo.jsp page to
+ exist containing the content.
+ -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
Modified: trunk/examples/validator-demo/src/main/java/org/richfaces/example/Bean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/Bean.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/Bean.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,70 +1,22 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.example;
-
-import javax.validation.constraints.Pattern;
-
-
-/**
- * JSF bean with text property validation.
- */
-public class Bean {
-
- /**
- * Text property
- */
- private String email;
-
- private String creditCardNumber;
-
- /**
- * @return the creditCardNumber
- */
- @Pattern(regexp="\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d")
- public String getCreditCardNumber() {
- return creditCardNumber;
- }
-
- /**
- * @param creditCardNumber the creditCardNumber to set
- */
- public void setCreditCardNumber(String creditCardNumber) {
- this.creditCardNumber = creditCardNumber;
- }
-
- /**
- * @return the text
- */
-// @Email
-// @Pattern(regexp="^[a-zA-Z][\\w\\.-]*[a-zA-Z0-9](a)[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$")
- public String getEmail() {
- return email;
- }
-
- /**
- * @param text the text to set
- */
- public void setEmail(String text) {
- this.email = text;
- }
-
-}
\ No newline at end of file
+package org.richfaces.example;
+
+public class Bean {
+
+ public static final String FOO_VALUE = "fooValue";
+
+ private String value=FOO_VALUE;
+
+ /**
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+ /**
+ * @param value the value to set
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+}
Copied: trunk/examples/validator-demo/src/main/java/org/richfaces/example/CustomValidator.java (from rev 20677, branches/RF-7654/examples/validator-demo/src/main/java/org/richfaces/example/CustomValidator.java)
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/CustomValidator.java (rev 0)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/CustomValidator.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -0,0 +1,39 @@
+/*
+ * $Id$
+ * 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.example;
+
+import javax.faces.validator.LengthValidator;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class CustomValidator extends LengthValidator {
+
+ public CustomValidator() {
+ setMinimum(1);
+ setMaximum(3);
+ }
+}
Deleted: trunk/examples/validator-demo/src/main/java/org/richfaces/example/DataBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/DataBean.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/DataBean.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,49 +0,0 @@
-/**
- *
- */
-package org.richfaces.example;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.validation.Valid;
-import javax.validation.constraints.Max;
-
-
-/**
- * @author asmirnov
- *
- */
-public class DataBean {
-
- private final List<Validable> beans;
-
- /**
- * @return the beans
- */
- @Valid
- public List<Validable> getBeans() {
- return beans;
- }
-
- public DataBean() {
- beans = new ArrayList<Validable>(6);
- beans.add(new NotNullBean());
- beans.add(new NotEmptyBean());
- beans.add(new LengthBean());
- beans.add(new MinBean());
- beans.add(new MaxBean());
- beans.add(new MinMaxBean());
- }
-
- @Max(value=20,message="Total value should be less then 20")
- public int getTotal(){
- int total = 0;
- for (Validable bean : beans) {
- total += bean.getIntValue();
- }
- return total;
- }
-
-
-}
Deleted: trunk/examples/validator-demo/src/main/java/org/richfaces/example/GraphValidatorBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/GraphValidatorBean.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/GraphValidatorBean.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,99 +0,0 @@
-/**
- *
- */
-package org.richfaces.example;
-
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-
-
-/**
- * @author asmirnov
- *
- */
-public class GraphValidatorBean implements Cloneable {
-
- @Min(0)
- @Max(10)
- private int first ;
-
- @Min(value=5,message="Value {0} should be more than {value}")
- @Max(15)
- private int second ;
-
- @Min(0)
- @Max(20)
- private int third ;
-
- private String actionResult;
-
- /**
- * @return the actionResult
- */
- public String getActionResult() {
- return actionResult;
- }
-
- /**
- * @param actionResult the actionResult to set
- */
- public void setActionResult(String actionResult) {
- this.actionResult = actionResult;
- }
-
- /**
- * @return the first
- */
- public int getFirst() {
- return first;
- }
-
- /**
- * @param first the first to set
- */
- public void setFirst(int first) {
- this.first = first;
- }
-
- /**
- * @return the second
- */
- public int getSecond() {
- return second;
- }
-
- /**
- * @param second the second to set
- */
- public void setSecond(int second) {
- this.second = second;
- }
-
- /**
- * @return the third
- */
- public int getThird() {
- return third;
- }
-
- /**
- * @param third the third to set
- */
- public void setThird(int third) {
- this.third = third;
- }
-
- /**
- * @return total summ of the list values.
- */
- @Max(value=20,message="Total value should be less then 20")
- public int getSumm(){
- return first+second+third;
- }
-
- public String action() {
- // Persist your data here
- setActionResult("Data have been saved");
- return "ok";
- }
-}
Deleted: trunk/examples/validator-demo/src/main/java/org/richfaces/example/LengthBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/LengthBean.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/LengthBean.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,64 +0,0 @@
-/**
- *
- */
-package org.richfaces.example;
-
-import javax.validation.constraints.Size;
-
-
-/**
- * @author asmirnov
- *
- */
-public class LengthBean implements Validable {
-
- @Size(max=10,min=2,message="incorrect field length")
- private String text;
-
- private int intValue;
-
- /**
- * @return the text
- */
- public String getText() {
- return text;
- }
-
- /**
- * @param text the text to set
- */
- public void setText(String text) {
- this.text = text;
- }
-
- /**
- * @return the intValue
- */
- public int getIntValue() {
- return intValue;
- }
-
- /**
- * @param intValue the intValue to set
- */
- public void setIntValue(int intValue) {
- this.intValue = intValue;
- }
-
- public String getTextDescription() {
- return "Validate String Length, for a range 2-10 chars";
- }
-
- public String getIntDescription() {
- return "Integer Value, no restrictions";
- }
-
- public String getIntSummary() {
- return "Invalid user name";
- }
-
- public String getTextSummary() {
- return "Invalid user name";
- }
-
-}
Deleted: trunk/examples/validator-demo/src/main/java/org/richfaces/example/MaxBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/MaxBean.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/MaxBean.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,69 +0,0 @@
-/**
- *
- */
-package org.richfaces.example;
-
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Pattern;
-
-/**
- * @author asmirnov
- *
- */
-public class MaxBean implements Validable {
-
- private String text;
-
- @Max(10)
- private int intValue;
-
- /**
- * @return the text
- */
-// @CreditCardNumber
- @Pattern(regexp="\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d\\\\d")
- public String getText() {
- return text;
- }
-
- /**
- * @param text the text to set
- */
- public void setText(String text) {
- this.text = text;
- }
-
- /**
- * @return the intValue
- */
- public int getIntValue() {
- return intValue;
- }
-
- /**
- * @param intValue the intValue to set
- */
- public void setIntValue(int intValue) {
- this.intValue = intValue;
- }
-
- public String getTextDescription() {
- return "Text value, should be correct credit card number";
- }
-
- public String getIntDescription() {
- // TODO Auto-generated method stub
- return "Integer Value, less then 10";
- }
-
- public String getIntSummary() {
- // TODO Auto-generated method stub
- return "Invalid number of items";
- }
-
- public String getTextSummary() {
- // TODO Auto-generated method stub
- return "Invalid payment card";
- }
-
-}
Deleted: trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinBean.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinBean.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,66 +0,0 @@
-/**
- *
- */
-package org.richfaces.example;
-
-import javax.validation.constraints.Min;
-
-/**
- * @author asmirnov
- *
- */
-public class MinBean implements Validable {
-
- private String text;
-
- @Min(2)
- private int intValue;
-
- /**
- * @return the text
- */
- public String getText() {
- return text;
- }
-
- /**
- * @param text the text to set
- */
- public void setText(String text) {
- this.text = text;
- }
-
- /**
- * @return the intValue
- */
- public int getIntValue() {
- return intValue;
- }
-
- /**
- * @param intValue the intValue to set
- */
- public void setIntValue(int intValue) {
- this.intValue = intValue;
- }
-
- public String getTextDescription() {
- return "Text value, no restrictions";
- }
-
- public String getIntDescription() {
- // TODO Auto-generated method stub
- return "Integer Value, more then 1";
- }
-
- public String getIntSummary() {
- // TODO Auto-generated method stub
- return "Invalid rooms qty";
- }
-
- public String getTextSummary() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
Deleted: trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinMaxBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinMaxBean.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/MinMaxBean.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,68 +0,0 @@
-/**
- *
- */
-package org.richfaces.example;
-
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-
-/**
- * @author asmirnov
- *
- */
-public class MinMaxBean implements Validable {
-
- private String text;
-
- @Min(value=2,message="Value {0} should be more than {value}")
- @Max(10)
- private int intValue;
-
- /**
- * @return the text
- */
- public String getText() {
- return text;
- }
-
- /**
- * @param text the text to set
- */
- public void setText(String text) {
- this.text = text;
- }
-
- /**
- * @return the intValue
- */
- public int getIntValue() {
- return intValue;
- }
-
- /**
- * @param intValue the intValue to set
- */
- public void setIntValue(int intValue) {
- this.intValue = intValue;
- }
-
- public String getTextDescription() {
- return "Text Value, no restrictions";
- }
-
- public String getIntDescription() {
- // TODO Auto-generated method stub
- return "Integer Value, valid values from 2 to 10";
- }
-
- public String getIntSummary() {
- // TODO Auto-generated method stub
- return "Invalid price";
- }
-
- public String getTextSummary() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
Deleted: trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotEmptyBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotEmptyBean.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotEmptyBean.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,67 +0,0 @@
-/**
- *
- */
-package org.richfaces.example;
-
-import javax.validation.constraints.Size;
-
-
-/**
- * @author asmirnov
- *
- */
-public class NotEmptyBean implements Validable {
-
- @Size(min=1)
- private String text;
-
- private int intValue;
-
- /**
- * @return the text
- */
- public String getText() {
- return text;
- }
-
- /**
- * @param text the text to set
- */
- public void setText(String text) {
- this.text = text;
- }
-
- /**
- * @return the intValue
- */
- public int getIntValue() {
- return intValue;
- }
-
- /**
- * @param intValue the intValue to set
- */
- public void setIntValue(int intValue) {
- this.intValue = intValue;
- }
-
- public String getTextDescription() {
- return "Text value, Not Empty Validation";
- }
-
- public String getIntDescription() {
- // TODO Auto-generated method stub
- return "Integer Value, no restrictions";
- }
-
- public String getIntSummary() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getTextSummary() {
- // TODO Auto-generated method stub
- return "Invalid password";
- }
-
-}
Deleted: trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotNullBean.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotNullBean.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/NotNullBean.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,66 +0,0 @@
-/**
- *
- */
-package org.richfaces.example;
-
-import javax.validation.constraints.NotNull;
-
-/**
- * @author asmirnov
- *
- */
-public class NotNullBean implements Validable {
-
- @NotNull
- private String text;
-
- private int intValue;
-
- /**
- * @return the text
- */
- public String getText() {
- return text;
- }
-
- /**
- * @param text the text to set
- */
- public void setText(String text) {
- this.text = text;
- }
-
- /**
- * @return the intValue
- */
- public int getIntValue() {
- return intValue;
- }
-
- /**
- * @param intValue the intValue to set
- */
- public void setIntValue(int intValue) {
- this.intValue = intValue;
- }
-
- public String getTextDescription() {
- return "Text Value, Not Null Validation";
- }
-
- public String getIntDescription() {
- // TODO Auto-generated method stub
- return "Integer Value, no restrictions";
- }
-
- public String getIntSummary() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getTextSummary() {
- // TODO Auto-generated method stub
- return "Invalid address";
- }
-
-}
Deleted: trunk/examples/validator-demo/src/main/java/org/richfaces/example/Validable.java
===================================================================
--- trunk/examples/validator-demo/src/main/java/org/richfaces/example/Validable.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/examples/validator-demo/src/main/java/org/richfaces/example/Validable.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,21 +0,0 @@
-/**
- *
- */
-package org.richfaces.example;
-
-/**
- * @author asmirnov
- *
- */
-public interface Validable {
-
- public String getText();
-
- public String getTextDescription();
-
- public String getTextSummary();
-
- public int getIntValue();
-
- public String getIntSummary();
-}
Modified: trunk/examples/validator-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/examples/validator-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/examples/validator-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,6 +1,14 @@
<?xml version="1.0"?>
<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
+<managed-bean>
+ <managed-bean-name>test</managed-bean-name>
+ <managed-bean-class>org.richfaces.example.Bean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+</managed-bean>
+<validator>
+ <validator-id>custom</validator-id>
+ <validator-class>org.richfaces.example.CustomValidator</validator-class>
+</validator>
-
</faces-config>
Copied: trunk/examples/validator-demo/src/main/webapp/examples/ajax-validator.xhtml (from rev 20677, branches/RF-7654/examples/validator-demo/src/main/webapp/examples/ajax-validator.xhtml)
===================================================================
--- trunk/examples/validator-demo/src/main/webapp/examples/ajax-validator.xhtml (rev 0)
+++ trunk/examples/validator-demo/src/main/webapp/examples/ajax-validator.xhtml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -0,0 +1,16 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:csv="http://richfaces.org/csv">
+ <h:head><title>Ajax validator</title></h:head>
+ <h:body>
+ <h:form id="form">
+ <h:inputText id="text" value="#{test.value}">
+ <f:validator validatorId="custom" />
+ <csv:validator event="blur" />
+ </h:inputText>
+ <h:outputText id="out" value="#{test.value}"></h:outputText>
+ <csv:message id="uiMessage" for="text" />
+ </h:form>
+ </h:body>
+</html>
Deleted: trunk/examples/validator-demo/src/main/webapp/examples/ajaxValidation.xhtml
===================================================================
--- trunk/examples/validator-demo/src/main/webapp/examples/ajaxValidation.xhtml 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/examples/validator-demo/src/main/webapp/examples/ajaxValidation.xhtml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,37 +0,0 @@
-<!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:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:s="http://jboss.com/products/seam/taglib"
- xmlns:c="http://java.sun.com/jstl/core">
-<ui:composition template="/layout/template.xhtml">
- <ui:param name="title" value="<rich:ajaxValidator> usage" />
- <ui:param name="javaBean" value="org/richfaces/example/Bean.java" />
- <!-- Page header -->
- <ui:define name="header">
- <h1><rich:ajaxValidator> usage</h1>
- </ui:define>
- <!-- content -->
- <ui:define name="content">
- <h:form id="form">
- <h:panelGrid columns="3">
- <h:outputLabel for="email" value="Email Address:" />
- <h:inputText id="email" value="#{bean.email}" label="Email">
- <rich:ajaxValidator event="onkeyup" summary="Invalid Email address" profiles="javax.validation.groups.Default"/>
- </h:inputText>
- <rich:message for="email"/>
- <h:outputLabel for="card" value="Credit card number:" />
- <h:inputText id="card" value="#{bean.creditCardNumber}" label="Credit card">
- <rich:ajaxValidator event="onkeyup" summary="Invalid credit card number" profiles="javax.validation.groups.Default"/>
- </h:inputText>
- <rich:message for="card"/>
- </h:panelGrid>
- <h:commandButton value="Submit"></h:commandButton>
- <rich:messages/>
- </h:form>
- </ui:define>
-</ui:composition>
-</html>
\ No newline at end of file
Deleted: trunk/examples/validator-demo/src/main/webapp/examples/beanValidation.xhtml
===================================================================
--- trunk/examples/validator-demo/src/main/webapp/examples/beanValidation.xhtml 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/examples/validator-demo/src/main/webapp/examples/beanValidation.xhtml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,37 +0,0 @@
-<!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:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:s="http://jboss.com/products/seam/taglib"
- xmlns:c="http://java.sun.com/jstl/core">
-<ui:composition template="/layout/template.xhtml">
- <ui:param name="title" value="<rich:beanValidator> usage" />
- <ui:param name="javaBean" value="org/richfaces/example/Bean.java" />
- <!-- Page header -->
- <ui:define name="header">
- <h1><rich:beanValidator> usage</h1>
- </ui:define>
- <!-- content -->
- <ui:define name="content">
- <h:form id="form">
- <h:panelGrid columns="3">
- <h:outputLabel for="email" value="Email Address:" />
- <h:inputText id="email" value="#{bean.email}" label="Email">
- <rich:beanValidator summary="Invalid Email address" />
- </h:inputText>
- <rich:message for="email"/>
- <h:outputLabel for="card" value="Credit card number:" />
- <h:inputText id="card" value="#{bean.creditCardNumber}" label="Credit card">
- <rich:beanValidator summary="Invalid credit card number" profiles="javax.validation.groups.Default"/>
- </h:inputText>
- <rich:message for="card"/>
- </h:panelGrid>
- <h:commandButton value="Submit"></h:commandButton>
- <rich:messages/>
- </h:form>
- </ui:define>
-</ui:composition>
-</html>
Copied: trunk/examples/validator-demo/src/main/webapp/examples/client-validator.xhtml (from rev 20677, branches/RF-7654/examples/validator-demo/src/main/webapp/examples/client-validator.xhtml)
===================================================================
--- trunk/examples/validator-demo/src/main/webapp/examples/client-validator.xhtml (rev 0)
+++ trunk/examples/validator-demo/src/main/webapp/examples/client-validator.xhtml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -0,0 +1,16 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:csv="http://richfaces.org/csv">
+ <h:head><title>Client Side Validator</title></h:head>
+ <h:body>
+ <h:form id="form">
+ <h:inputText id="text" value="#{test.value}">
+ <f:validateLength minimum="1" maximum="3"/>
+ <csv:validator event="blur" />
+ </h:inputText>
+ <h:outputText id="out" value="#{test.value}"></h:outputText>
+ <csv:message id="uiMessage" for="text" />
+ </h:form>
+ </h:body>
+</html>
Deleted: trunk/examples/validator-demo/src/main/webapp/examples/graphValidation.xhtml
===================================================================
--- trunk/examples/validator-demo/src/main/webapp/examples/graphValidation.xhtml 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/examples/validator-demo/src/main/webapp/examples/graphValidation.xhtml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,59 +0,0 @@
-<!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:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:s="http://jboss.com/products/seam/taglib"
- xmlns:c="http://java.sun.com/jstl/core">
-<ui:composition template="/layout/template.xhtml">
- <ui:param name="title" value="<rich:graphValidator> usage" />
- <ui:param name="javaBean" value="org/richfaces/example/GraphValidatorBean.java" />
- <!-- Page header -->
- <ui:define name="header">
- <h1><rich:graphValidator> usage</h1>
- </ui:define>
- <!-- content -->
- <ui:define name="description">
- <p>In that sampe <rich:graphValidator> component appends JSR-303 or Hibernate validators to all enclosed input components
- that check restrictions for field values, and, in addition, validates whole bean.</p>
- <p>JSF bean fields are annotated with @Min/@Max restrictions and getter for the 'total' attribute is also annotated by the @Max</p>
- <p>As a result, even valid field values would make whole bean an invalid. For example, values '2','7','15' are valid for fields values but their sum exceed maximum total value '20'</p>
- <p>Validator assignes new values to a cloned bean instance hence model is not updated with invalid values.</p>
- </ui:define>
- <ui:define name="content">
- <h:form id="form">
- <rich:graphValidator value="#{graphValidatorBean}" id="validator" profiles="javax.validation.groups.Default">
- <h:panelGrid columns="4">
- <h:outputText value=""/>
- <h:outputText value="Input"/>
- <h:outputText value="Message"/>
- <h:outputText value="Model value"/>
-
- <h:outputLabel for="value0" value="First value, integer from 0 to 10:" />
- <h:inputText id="value0" value="#{graphValidatorBean.first}" label="First" />
- <rich:message for="value0"/>
- <h:outputText value="#{graphValidatorBean.first}"/>
-
- <h:outputLabel for="value1" value="Second value,integer from 5 to 15:" />
- <h:inputText id="value1" value="#{graphValidatorBean.second}" label="Second" />
- <rich:message for="value1"/>
- <h:outputText value="#{graphValidatorBean.second}"/>
-
- <h:outputLabel for="value2" value="Third value,integer from 0 to 20:" />
- <h:inputText id="value2" value="#{graphValidatorBean.third}" label="Third" />
- <rich:message for="value2"/>
- <h:outputText value="#{graphValidatorBean.third}"/>
-
- <h:outputLabel for="total" value="Total, should be no more then 20:" />
- <h:outputText id="total" value="#{graphValidatorBean.summ}"/>
- </h:panelGrid>
- <h:commandButton value="Submit" action="#{graphValidatorBean.action}"></h:commandButton>
- <h:outputText id="result" value="#{graphValidatorBean.actionResult}"/>
- </rich:graphValidator>
- <rich:messages/>
- </h:form>
- </ui:define>
-</ui:composition>
-</html>
\ No newline at end of file
Modified: trunk/ui/pom.xml
===================================================================
--- trunk/ui/pom.xml 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/pom.xml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -44,7 +44,7 @@
<module>output</module>
<module>input</module>
<module>dist</module>
- <module>dnd</module>
- <!--<module>validator</module>-->
+ <module>dnd</module>
+ <module>validator</module>
</modules>
</project>
Copied: trunk/ui/validator/ui/src/main/config (from rev 20657, branches/RF-7654/ui/validator/ui/src/main/config)
Deleted: trunk/ui/validator/ui/src/main/config/faces-config.xml
===================================================================
--- branches/RF-7654/ui/validator/ui/src/main/config/faces-config.xml 2010-12-17 15:59:45 UTC (rev 20657)
+++ trunk/ui/validator/ui/src/main/config/faces-config.xml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<faces-config version="2.0" metadata-complete="false"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
- xmlns="http://java.sun.com/xml/ns/javaee" xmlns:cdk="http://jboss.org/schema/richfaces/cdk/extensions"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <behavior>
- <behavior-id>org.richfaces.behavior.ClientValidator</behavior-id>
- <behavior-class>org.richfaces.component.behavior.ClientValidatorImpl</behavior-class>
- <behavior-extension>
- <cdk:tag>
- <cdk:tag-name>validator</cdk:tag-name>
- <cdk:tag-type>Facelets</cdk:tag-type>
- </cdk:tag>
- </behavior-extension>
- </behavior>
- <render-kit>
- <client-behavior-renderer>
- <client-behavior-renderer-type>org.richfaces.ClientValidatorRenderer</client-behavior-renderer-type>
- <client-behavior-renderer-class>org.richfaces.renderkit.html.ClientValidatorRenderer</client-behavior-renderer-class>
- </client-behavior-renderer>
- </render-kit>
- <faces-config-extension>
- <cdk:taglib>
- <cdk:shortName>csv</cdk:shortName>
- <cdk:uri>http://richfaces.org/csv</cdk:uri>
- </cdk:taglib>
- </faces-config-extension>
-
-</faces-config>
\ No newline at end of file
Copied: trunk/ui/validator/ui/src/main/config/faces-config.xml (from rev 20657, branches/RF-7654/ui/validator/ui/src/main/config/faces-config.xml)
===================================================================
--- trunk/ui/validator/ui/src/main/config/faces-config.xml (rev 0)
+++ trunk/ui/validator/ui/src/main/config/faces-config.xml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="2.0" metadata-complete="false"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:cdk="http://jboss.org/schema/richfaces/cdk/extensions"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <behavior>
+ <behavior-id>org.richfaces.behavior.ClientValidator</behavior-id>
+ <behavior-class>org.richfaces.component.behavior.ClientValidatorImpl</behavior-class>
+ <behavior-extension>
+ <cdk:tag>
+ <cdk:tag-name>validator</cdk:tag-name>
+ <cdk:tag-type>Facelets</cdk:tag-type>
+ </cdk:tag>
+ </behavior-extension>
+ </behavior>
+ <render-kit>
+ <client-behavior-renderer>
+ <client-behavior-renderer-type>org.richfaces.ClientValidatorRenderer</client-behavior-renderer-type>
+ <client-behavior-renderer-class>org.richfaces.renderkit.html.ClientValidatorRenderer</client-behavior-renderer-class>
+ </client-behavior-renderer>
+ </render-kit>
+ <faces-config-extension>
+ <cdk:taglib>
+ <cdk:shortName>csv</cdk:shortName>
+ <cdk:uri>http://richfaces.org/csv</cdk:uri>
+ </cdk:taglib>
+ </faces-config-extension>
+
+</faces-config>
\ No newline at end of file
Deleted: trunk/ui/validator/ui/src/main/config/messages.xml
===================================================================
--- branches/RF-7654/ui/validator/ui/src/main/config/messages.xml 2010-12-17 15:59:45 UTC (rev 20657)
+++ trunk/ui/validator/ui/src/main/config/messages.xml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<faces-config version="2.0" metadata-complete="false"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
- xmlns="http://java.sun.com/xml/ns/javaee" xmlns:cdk="http://jboss.org/schema/richfaces/cdk/extensions"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <component>
- <component-type>org.richfaces.Message</component-type>
- <component-class>org.richfaces.component.html.HtmlMessage</component-class>
- <component-extension>
- <cdk:generate>true</cdk:generate>
- <cdk:base-class>javax.faces.component.UIMessage</cdk:base-class>
- <cdk:component-family>javax.faces.Message</cdk:component-family>
- <cdk:renderer-type>org.richfaces.MessageRenderer</cdk:renderer-type>
- <cdk:tag>
- <cdk:tag-name>message</cdk:tag-name>
- <cdk:tag-type>Facelets</cdk:tag-type>
- </cdk:tag>
- </component-extension>
- </component>
-</faces-config>
Copied: trunk/ui/validator/ui/src/main/config/messages.xml (from rev 20657, branches/RF-7654/ui/validator/ui/src/main/config/messages.xml)
===================================================================
--- trunk/ui/validator/ui/src/main/config/messages.xml (rev 0)
+++ trunk/ui/validator/ui/src/main/config/messages.xml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<faces-config version="2.0" metadata-complete="false"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:cdk="http://jboss.org/schema/richfaces/cdk/extensions"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <component>
+ <component-type>org.richfaces.Message</component-type>
+ <component-class>org.richfaces.component.html.HtmlMessage</component-class>
+ <component-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:base-class>javax.faces.component.UIMessage</cdk:base-class>
+ <cdk:component-family>javax.faces.Message</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.MessageRenderer</cdk:renderer-type>
+ <cdk:tag>
+ <cdk:tag-name>message</cdk:tag-name>
+ <cdk:tag-type>Facelets</cdk:tag-type>
+ </cdk:tag>
+ </component-extension>
+ </component>
+</faces-config>
Copied: trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageRendererBase.java (from rev 20657, branches/RF-7654/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageRendererBase.java)
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageRendererBase.java (rev 0)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/MessageRendererBase.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -0,0 +1,198 @@
+/*
+ * $Id$
+ * 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.renderkit;
+
+import java.io.IOException;
+import java.util.Iterator;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.application.FacesMessage.Severity;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.Renderer;
+
+import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.application.ServiceTracker;
+import org.richfaces.javascript.JavaScriptService;
+import org.richfaces.renderkit.util.RendererUtils;
+
+import com.google.common.base.Predicate;
+import com.google.common.base.Strings;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.Lists;
+import com.google.common.collect.UnmodifiableIterator;
+
+/**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class MessageRendererBase extends Renderer {
+
+ private static final ImmutableMap<Severity, SeverityAttributes> SEVERITY_MAP = ImmutableMap
+ .of(FacesMessage.SEVERITY_INFO,
+ attrs("info", "inf", null),
+ FacesMessage.SEVERITY_WARN,
+ attrs("warn","wrn", null),
+ FacesMessage.SEVERITY_ERROR,
+ attrs("error","err", null),
+ FacesMessage.SEVERITY_FATAL,
+ attrs("fatal","ftl",null));
+
+ protected Iterator<FacesMessage> getMessages(FacesContext context, String forClientId, UIComponent component) {
+
+ Iterator<FacesMessage> msgIter;
+
+ if (forClientId != null) {
+
+ if (forClientId.length() != 0) {
+
+ UIComponent result = RendererUtils.getInstance().findComponentFor(component, forClientId);
+ if (result == null) {
+ msgIter = Iterators.emptyIterator();
+ } else {
+ msgIter = context.getMessages(result.getClientId(context));
+ }
+
+ } else {
+ msgIter = context.getMessages(null);
+ }
+
+ } else {
+ msgIter = context.getMessages();
+ }
+
+ return msgIter;
+ }
+
+ /**
+ * <p class="changed_added_4_0">TODO - make Generator aware of Iterator.</p>
+ * @param context
+ * @param component
+ * @return
+ */
+ protected Iterable<FacesMessage> getVisibleMessages(FacesContext context, UIComponent component) {
+ String forId = getFor(component);
+ Iterator<FacesMessage> messages = getMessages(context, forId, component);
+ UnmodifiableIterator<FacesMessage> filteredMessages =
+ Iterators.filter(messages, getMessagesFilter(context, component));
+ return Lists.newArrayList(filteredMessages);
+
+ }
+
+ private Predicate<FacesMessage> getMessagesFilter(FacesContext context, UIComponent component) {
+
+ Object levelName = component.getAttributes().get("level");
+ final Severity level =
+ (Severity) (FacesMessage.VALUES_MAP.containsKey(levelName) ? FacesMessage.VALUES_MAP.get(levelName)
+ : FacesMessage.SEVERITY_INFO);
+ return new Predicate<FacesMessage>() {
+ public boolean apply(FacesMessage input) {
+ return input.getSeverity().compareTo(level) >= 0;
+ }
+ };
+ }
+
+ private String getFor(UIComponent component) {
+ return (String) component.getAttributes().get("for");
+ }
+
+ protected void encodeMessage(FacesContext facesContext, UIComponent component, Object msg) throws IOException {
+ // TODO fix generator to properly detect iteration variable type
+ FacesMessage message = (FacesMessage) msg;
+ ResponseWriter responseWriter = facesContext.getResponseWriter();
+ responseWriter.writeText(message.getSummary(),"value");
+ }
+
+ protected void encodeScript(FacesContext facesContext, UIComponent component) throws IOException {
+ JavaScriptService javaScriptService = ServiceTracker.getService(JavaScriptService.class);
+ JSFunction messageObject = new JSObject("RichFaces.ui.Message", component.getClientId(facesContext));
+ String forId = (String) component.getAttributes().get("for");
+ if(!Strings.isNullOrEmpty(forId)){
+ UIComponent target = RendererUtils.getInstance().findComponentFor(component, forId);
+ if(null != target){
+ messageObject.addParameter(ImmutableMap.<String, String>of("forComponentId",target.getClientId(facesContext)));
+ }
+ }
+// RendererUtils.getInstance().writeScript(facesContext, component, messageObject);
+ javaScriptService.addPageReadyScript(facesContext, messageObject);
+ }
+
+ protected String getMsgClass(FacesContext facesContext, UIComponent component, Object msg) throws IOException{
+ FacesMessage message = (FacesMessage) msg;
+ SeverityAttributes severityAttributes = SEVERITY_MAP.get(message.getSeverity());
+ String styleClass = buildSeverityAttribute(component, severityAttributes.skinClass, severityAttributes.classAttribute, ' ');
+ return styleClass;
+ }
+
+ protected String getMsgStyle(FacesContext facesContext, UIComponent component, Object msg) throws IOException{
+ FacesMessage message = (FacesMessage) msg;
+ SeverityAttributes severityAttributes = SEVERITY_MAP.get(message.getSeverity());
+ String style = buildSeverityAttribute(component, severityAttributes.skinStyle, severityAttributes.styleAttribute, ';');
+ return style;
+ }
+
+ private String buildSeverityAttribute(UIComponent component, String skinValue, String attrName, char delimiter) {
+ StringBuilder style = new StringBuilder();
+ if(null != skinValue){
+ style.append(skinValue).append(delimiter);
+ }
+ Object componentStyle = component.getAttributes().get(attrName);
+ if(null != componentStyle){
+ style.append(componentStyle);
+ }
+ return style.toString();
+ }
+
+ static SeverityAttributes attrs(String attPrefix, String skinSuffix,String skinStyle) {
+ SeverityAttributes attrs =
+ new SeverityAttributes(attPrefix+"Style", attPrefix+"Class", "rf-msg-"+skinSuffix, skinStyle,
+ null, null);
+ return attrs;
+ }
+
+ private static final class SeverityAttributes {
+ private final String styleAttribute;
+ private final String classAttribute;
+ private final String skinStyle;
+ private final String skinClass;
+ private final String labelStyleAttribute;
+ private final String labelClassAttribute;
+
+ private SeverityAttributes(String styleAttribute2, String classAttribute2, String markerStyleAttribute2,
+ String markerClassAttribute2, String labelStyleAttribute2, String labelClassAttribute2) {
+ this.styleAttribute = styleAttribute2;
+ this.classAttribute = classAttribute2;
+ this.skinStyle = markerStyleAttribute2;
+ this.skinClass = markerClassAttribute2;
+ this.labelStyleAttribute = labelStyleAttribute2;
+ this.labelClassAttribute = labelClassAttribute2;
+ }
+ }
+}
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ValidatorScriptBase.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ValidatorScriptBase.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ValidatorScriptBase.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -8,22 +8,22 @@
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";
- protected static final String EOL = ";\n";
- protected static final String CLIENT_ID = "clientId";
- protected static final JSReference CLIENT_ID_LITERAL = new JSReference(CLIENT_ID);
- protected static final String SOURCE_ID = "sourceId";
- protected static final JSReference SOURCE_ID_LITERAL = new JSReference(SOURCE_ID);
- 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,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);
+ public static final String ELEMENT = "element";
+ public static final JSReference ELEMENT_LITERAL = new JSReference(ELEMENT);
+ public static final String EVENT = "event";
+ public static final JSReference EVENT_LITERAL = new JSReference(EVENT);
+ public static final String DISABLE_AJAX = "disableAjax";
+ public static final String EOL = ";\n";
+ public static final String CLIENT_ID = "clientId";
+ public static final JSReference CLIENT_ID_LITERAL = new JSReference(CLIENT_ID);
+ public static final String SOURCE_ID = "sourceId";
+ public static final JSReference SOURCE_ID_LITERAL = new JSReference(SOURCE_ID);
+ public static final NullConverterScript NULL_CONVERTER_SCRIPT = new NullConverterScript();
+ public static final String CSV_NAMESPACE = "RichFaces.csv.";
+ public static final String VALUE_FUNCTION_NAME = CSV_NAMESPACE+"getValue";
+ public static final JSFunction GET_VALUE_FUNCTION = new JSFunction(VALUE_FUNCTION_NAME,CLIENT_ID_LITERAL,ELEMENT_LITERAL);
+ public static final JSFunction SEND_ERROR_FUNCTION = new JSFunction(CSV_NAMESPACE+"sendMessage",CLIENT_ID_LITERAL,new JSReference("e"));
+ public static final JSFunction CLEAR_ERROR_FUNCTION = new JSFunction(CSV_NAMESPACE+"clearMessage",CLIENT_ID_LITERAL);
private boolean bodyProcessed = false;
Deleted: trunk/ui/validator/ui/src/main/java/org/richfaces/validator/ClientScriptServiceImpl.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/validator/ClientScriptServiceImpl.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/validator/ClientScriptServiceImpl.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,74 +0,0 @@
-/**
- *
- */
-package org.richfaces.validator;
-
-import java.util.Map;
-
-import javax.faces.application.Resource;
-import javax.faces.application.ResourceHandler;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.component.util.Strings;
-
-/**
- * @author asmirnov
- *
- */
-public class ClientScriptServiceImpl implements ClientScriptService {
-
- private static final String TEXT_JAVASCRIPT = "text/javascript";
-
- private static final String ORG_RICHFACES_CSV = "org.richfaces.csv";
-
- private final Map<Class<?>, LibraryFunction> defaultMapping;
-
- public ClientScriptServiceImpl(Map<Class<?>, LibraryFunction> defaultMapping) {
- this.defaultMapping = defaultMapping;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.validator.ClientScriptService#getScript(java.lang.Class)
- */
- public LibraryFunction getScript(FacesContext facesContext, Class<?> javaClass) throws ScriptNotFoundException {
- if (null == facesContext || null == javaClass) {
- throw new NullPointerException();
- }
- LibraryFunction function;
- try {
- function = getScriptResource(facesContext, javaClass);
- } catch (ScriptNotFoundException e) {
- if (defaultMapping.containsKey(javaClass)) {
- function = defaultMapping.get(javaClass);
- } else {
- function = getScriptFromAnnotation(javaClass);
- }
- }
- return function;
- }
-
- private LibraryFunction getScriptFromAnnotation(Class<?> javaClass) throws ScriptNotFoundException {
- if (javaClass.isAnnotationPresent(ClientSideScript.class)) {
- ClientSideScript clientSideScript = javaClass.getAnnotation(ClientSideScript.class);
- return new LibraryFunctionImplementation(clientSideScript.library(), clientSideScript.resource(), clientSideScript.function());
- } else {
- throw new ScriptNotFoundException();
- }
- }
-
- private LibraryFunction getScriptResource(FacesContext facesContext, Class<?> javaClass)
- throws ScriptNotFoundException {
- ResourceHandler resourceHandler = facesContext.getApplication().getResourceHandler();
- String resourceName = javaClass.getSimpleName() + ".js";
- Resource facesResource = resourceHandler.createResource(resourceName, ORG_RICHFACES_CSV, TEXT_JAVASCRIPT);
- if (null != facesResource) {
- final String functionName = Strings.firstToLowerCase(javaClass.getSimpleName());
- return new LibraryFunctionImplementation(ORG_RICHFACES_CSV,resourceName, functionName);
- } else {
- throw new ScriptNotFoundException();
- }
- }
-
-}
Deleted: trunk/ui/validator/ui/src/main/java/org/richfaces/validator/ClientServiceConfigParser.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/validator/ClientServiceConfigParser.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/validator/ClientServiceConfigParser.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,67 +0,0 @@
-/**
- *
- */
-package org.richfaces.validator;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Map;
-
-import javax.faces.FacesException;
-import javax.xml.bind.JAXB;
-
-import org.richfaces.validator.model.ClientSideScripts;
-import org.richfaces.validator.model.Component;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableMap.Builder;
-import com.google.common.collect.Maps;
-
-/**
- * @author asmirnov
- *
- */
-public final class ClientServiceConfigParser {
-
- private ClientServiceConfigParser() {
- }
-
- public static Map<Class<?>, LibraryFunction> parseConfig(String name) {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- if (null == loader) {
- loader = ClientServiceConfigParser.class.getClassLoader();
- }
- Builder<Class<?>, LibraryFunction> resultBuilder = ImmutableMap.builder();
- try {
- Enumeration<URL> resources = loader.getResources(name);
- while (resources.hasMoreElements()) {
- URL url = (URL) resources.nextElement();
- resultBuilder.putAll(parse(loader, url));
- }
- } catch (IOException e) {
- return Collections.emptyMap();
- }
- return resultBuilder.build();
- }
-
- static Map<Class<?>, LibraryFunction> parse(ClassLoader loader, URL url) {
- Map<Class<?>, LibraryFunction> result = Maps.newHashMap();
- try {
- ClientSideScripts clientSideScripts = JAXB.unmarshal(url, ClientSideScripts.class);
- for (Component component : clientSideScripts.getComponent()) {
- Class<?> componentClass = loader.loadClass(component.getType());
- LibraryFunctionImplementation function = new LibraryFunctionImplementation(component.getLibrary(),
- component.getResource(), component.getFunction());
- result.put(componentClass, function);
- }
- } catch (ClassNotFoundException e) {
- throw new FacesException("Class for component not found",e);
- } catch (Exception e) {
- throw new FacesException("Error parsing config file "+url,e);
- }
- return result;
- }
-
-}
Deleted: trunk/ui/validator/ui/src/main/java/org/richfaces/validator/LibraryFunctionImplementation.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/validator/LibraryFunctionImplementation.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/validator/LibraryFunctionImplementation.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,24 +0,0 @@
-package org.richfaces.validator;
-
-final class LibraryFunctionImplementation implements LibraryFunction {
- private final LibraryResource library;
- private final String functionName;
-
- LibraryFunctionImplementation(LibraryResource library, String functionName) {
- this.library = library;
- this.functionName = functionName;
- }
-
- LibraryFunctionImplementation(String library, String resource, String functionName) {
- this.library = new LibraryResource(library, resource);
- this.functionName = functionName;
- }
-
- public LibraryResource getResource() {
- return library;
- }
-
- public String getName() {
- return functionName;
- }
-}
\ No newline at end of file
Deleted: trunk/ui/validator/ui/src/main/resources/META-INF/csv.taglib.xml
===================================================================
--- trunk/ui/validator/ui/src/main/resources/META-INF/csv.taglib.xml 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/validator/ui/src/main/resources/META-INF/csv.taglib.xml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,15 +0,0 @@
-<?xml-stylesheet type="text/xsl" href=""?>
-<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
- version="2.0">
- <namespace>http://richfaces.org/csv</namespace>
-
- <tag>
- <tag-name>validator</tag-name>
- <behavior>
- <behavior-id>org.richfaces.behavior.ClientValidator</behavior-id>
- </behavior>
- </tag>
-
-</facelet-taglib>
Deleted: trunk/ui/validator/ui/src/main/resources/META-INF/faces-config.xml
===================================================================
--- trunk/ui/validator/ui/src/main/resources/META-INF/faces-config.xml 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/validator/ui/src/main/resources/META-INF/faces-config.xml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<faces-config version="2.0" metadata-complete="false" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:cdk="http://jboss.org/schema/richfaces/cdk/extensions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-<behavior>
- <behavior-id>org.richfaces.behavior.ClientValidator</behavior-id>
- <behavior-class>org.richfaces.component.behavior.ClientValidatorImpl</behavior-class>
-</behavior>
-<render-kit>
- <client-behavior-renderer>
- <client-behavior-renderer-type>org.richfaces.ClientValidatorRenderer</client-behavior-renderer-type>
- <client-behavior-renderer-class>org.richfaces.renderkit.html.ClientValidatorRenderer</client-behavior-renderer-class>
- </client-behavior-renderer>
-</render-kit>
-</faces-config>
\ No newline at end of file
Modified: trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/csv.js
===================================================================
--- trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/csv.js 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/csv.js 2010-12-19 22:05:58 UTC (rev 20679)
@@ -22,18 +22,15 @@
$.extend(rf.csv, {
RE_DIGITS: /^-?\d+$/,
RE_FLOAT: /^(-?\d+)?(\.(\d+)?(e[+-]?\d+)?)?$/,
- MESSAGE_EVENT_NAME: "onmessage."+rf.Event.RICH_NAMESPACE,
// Messages API
getMessage :function(facesMessage,values){
return {detail:_interpolateMessage(facesMessage.detail,values),summary:_interpolateMessage(facesMessage.summary,values)};
},
sendMessage: function (componentId, message) {
- rf.Event.fireById(document, rf.csv.MESSAGE_EVENT_NAME, message);
- rf.Event.fireById(componentId, rf.csv.MESSAGE_EVENT_NAME, message);
+ rf.Event.fire(window.document, rf.Event.MESSAGE_EVENT_TYPE, {'sourceId':componentId, 'message':message});
},
clearMessage: function (componentId) {
- rf.Event.fireById(document, rf.csv.MESSAGE_EVENT_NAME, message);
- rf.Event.fireById(componentId, rf.csv.MESSAGE_EVENT_NAME, message);
+ rf.Event.fire(window.document, rf.Event.MESSAGE_EVENT_TYPE, {'sourceId':componentId, 'message':''});
},
getValue: function (clientId, element){
var value;
@@ -97,66 +94,4 @@
}
});
- /*
- // 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
Copied: trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/message.js (from rev 20657, branches/RF-7654/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/message.js)
===================================================================
--- trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/message.js (rev 0)
+++ trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/message.js 2010-12-19 22:05:58 UTC (rev 20679)
@@ -0,0 +1,77 @@
+(function($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ // Constructor definition
+ rf.ui.Base = function(componentId, options, defaultOptions) {
+ this.namespace = "."+rf.Event.createNamespace(this.name, componentId);
+ // call constructor of parent class
+ $super.constructor.call(this, componentId);
+ this.options = $.extend(this.options, defaultOptions, options);
+ this.attachToDom();
+ this.__bindEventHandlers();
+ };
+
+ // Extend component class and add protected methods from parent class to our container
+ rf.BaseComponent.extend(rf.ui.Base);
+
+ // define super class link
+ var $super = rf.ui.Base.$super;
+
+ $.extend(rf.ui.Base.prototype, {
+ __bindEventHandlers: function () {
+ },
+ destroy: function () {
+ rf.Event.unbind(this.id, this.namespace);
+ $super.destroy.call(this);
+ }
+ });
+
+})(jQuery, window.RichFaces || (window.RichFaces={}));
+
+(function($, rf) {
+
+ // Constructor definition
+ rf.ui.Message = function(componentId, options) {
+ // call constructor of parent class
+ $super.constructor.call(this, componentId, options, defaultOptions);
+ };
+
+ // Extend component class and add protected methods from parent class to our container
+ rf.ui.Base.extend(rf.ui.Message);
+
+ // define super class link
+ var $super = rf.ui.Message.$super;
+
+ var defaultOptions = {
+
+ };
+
+ var componentHash = {};
+ var componentIndex = 0;
+
+ var onMessage = function (event, element, data) {
+ if (!this.options.forComponentId) {
+ var index = componentHash[data.sourceId];
+ if (typeof index != undefined) {
+ $(rf.getDomElement(this.id+index)).remove();
+ }
+ var content = content = $(rf.getDomElement(this.id));
+
+ componentIndex ++;
+ if (data.message) content.append('<li id="'+this.id+componentIndex+'">'+data.message.summary+'</li>');
+ componentHash[data.sourceId] = componentIndex;
+
+ } else if (this.options.forComponentId==data.sourceId) {
+ rf.getDomElement(this.id).innerHTML = data.message ? '<li>'+data.message.summary+'</li>' : '';
+ }
+ }
+
+ $.extend(rf.ui.Message.prototype, {
+ name: "Message",
+ __bindEventHandlers: function () {
+ rf.Event.bind(window.document, rf.Event.MESSAGE_EVENT_TYPE+this.namespace, onMessage, this);
+ }
+ });
+
+})(jQuery, window.RichFaces || (window.RichFaces={}));
\ No newline at end of file
Modified: trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js
===================================================================
--- trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js 2010-12-19 22:05:58 UTC (rev 20679)
@@ -11,7 +11,6 @@
$.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);
@@ -30,8 +29,7 @@
return {message:message};
},
sendMessage: function (componentId, message) {
- rf.Event.fireById(document, MESSAGE_EVENT_NAME, message);
- rf.Event.fireById(componentId, MESSAGE_EVENT_NAME, message);
+ rf.Event.fire(window.document, rf.Event.MESSAGE_EVENT_TYPE, {'sourceId':componentId, 'message':message});
},
// Converters API
addConverter: function (converterFunctions) {
@@ -87,66 +85,4 @@
}
});
- /*
- // 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
Copied: trunk/ui/validator/ui/src/main/resources/META-INF/richfaces/org.richfaces/message.library.properties (from rev 20677, branches/RF-7654/ui/validator/ui/src/main/resources/META-INF/richfaces/org.richfaces/message.library.properties)
===================================================================
--- trunk/ui/validator/ui/src/main/resources/META-INF/richfaces/org.richfaces/message.library.properties (rev 0)
+++ trunk/ui/validator/ui/src/main/resources/META-INF/richfaces/org.richfaces/message.library.properties 2010-12-19 22:05:58 UTC (rev 20679)
@@ -0,0 +1 @@
+resources=jquery.js, richfaces.js, richfaces-event.js, richfaces-base-component.js, org.richfaces:message.js
\ No newline at end of file
Copied: trunk/ui/validator/ui/src/main/templates (from rev 20657, branches/RF-7654/ui/validator/ui/src/main/templates)
Deleted: trunk/ui/validator/ui/src/main/templates/message.template.xml
===================================================================
--- branches/RF-7654/ui/validator/ui/src/main/templates/message.template.xml 2010-12-17 15:59:45 UTC (rev 20657)
+++ trunk/ui/validator/ui/src/main/templates/message.template.xml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-JBoss, Home of Professional Open Source
-Copyright ${year}, Red Hat, Inc. and individual contributors
-by the @authors tag. See the copyright.txt in the distribution for a
-full listing of individual contributors.
-
-
-This is free software; you can redistribute it and/or modify it
-under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of
-the License, or (at your option) any later version.
-
-
-This software is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-
-You should have received a copy of the GNU Lesser General Public
-License along with this software; if not, write to the Free
-Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-02110-1301 USA, or see the FSF site: http://www.fsf.org.
--->
-<cdk:root xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el" xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
- xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite" xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
- xmlns:xi="http://www.w3.org/2001/XInclude">
- <cc:interface>
- <cdk:class>org.richfaces.renderkit.html.HtmlMessageRenderer</cdk:class>
- <cdk:superclass>org.richfaces.renderkit.MessageRendererBase</cdk:superclass>
- <cdk:component-family>javax.faces.Message</cdk:component-family>
- <cdk:renderer-type>org.richfaces.MessageRenderer</cdk:renderer-type>
- <cdk:resource-dependency library="org.richfaces" name="base-component.reslib" />
- <cdk:resource-dependency library="org.richfaces" name="message.js" />
- </cc:interface>
- <cc:implementation>
- <span id="#{clientId}" class="rf-msg #{component.attributes['styleClass']}" cdk:passThroughWithExclusions="id class">
- <ul id="#{clientId}:Content" >
- <c:forEach var="msg" items="#{getVisibleMessages(facesContext,component)}">
- <li><cdk:call>encodeMessage(facesContext,component,msg)</cdk:call></li>
- </c:forEach>
- </ul>
- </span>
- </cc:implementation>
-</cdk:root>
Copied: trunk/ui/validator/ui/src/main/templates/message.template.xml (from rev 20657, branches/RF-7654/ui/validator/ui/src/main/templates/message.template.xml)
===================================================================
--- trunk/ui/validator/ui/src/main/templates/message.template.xml (rev 0)
+++ trunk/ui/validator/ui/src/main/templates/message.template.xml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- JBoss, Home of Professional Open Source Copyright ${year}, Red Hat,
+ Inc. and individual contributors by the @authors tag. See the copyright.txt
+ in the distribution for a full listing of individual contributors. This is
+ free software; you can redistribute it and/or modify it under the terms of
+ the GNU Lesser General Public License as published by the Free Software Foundation;
+ either version 2.1 of the License, or (at your option) any later version.
+ This software is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ details. You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the
+ FSF site: http://www.fsf.org. -->
+<cdk:root xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el"
+ xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core" xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite"
+ xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.HtmlMessageRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.MessageRendererBase</cdk:superclass>
+ <cdk:component-family>javax.faces.Message</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.MessageRenderer</cdk:renderer-type>
+ <cdk:resource-dependency library="org.richfaces"
+ name="message.reslib" />
+ </cc:interface>
+ <cc:implementation>
+ <ul id="#{clientId}" class="rf-msg #{component.attributes['styleClass']}"
+ cdk:passThroughWithExclusions="id class">
+ <c:forEach var="msg"
+ items="#{getVisibleMessages(facesContext,component)}">
+ <li class="#{getMsgClass(facesContext,component,msg)}" style="#{getMsgStyle(facesContext,component,msg)}">
+ <cdk:call>encodeMessage(facesContext,component,msg)</cdk:call>
+ </li>
+ </c:forEach>
+ <cdk:call>encodeScript(facesContext,component)</cdk:call>
+ </ul>
+ </cc:implementation>
+</cdk:root>
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/component/AjaxValidationTest.java
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/component/AjaxValidationTest.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/component/AjaxValidationTest.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -44,7 +44,7 @@
@Test
public void testRequest() throws Exception {
HtmlPage page = requestPage();
- HtmlInput input = hetInput(page);
+ HtmlInput input = getInput(page);
assertNotNull(input);
}
@@ -66,14 +66,14 @@
private void submitValueAndCheckMesage(String value, Matcher<String> matcher) throws Exception {
HtmlPage page = requestPage();
- HtmlInput input = hetInput(page);
+ HtmlInput input = getInput(page);
input.setValueAttribute(value);
- input.fireEvent("keyup");
- HtmlElement message = page.getElementById("form:message");
+ input.fireEvent("blur");
+ HtmlElement message = page.getElementById("uiMessage");
assertThat(message.getTextContent(), matcher);
// System.out.println(page.asXml());
}
- private HtmlInput hetInput(HtmlPage page) {
+ private HtmlInput getInput(HtmlPage page) {
HtmlForm htmlForm = page.getFormByName("form");
assertNotNull(htmlForm);
HtmlInput input = htmlForm.getInputByName("form:text");
@@ -82,7 +82,7 @@
private HtmlPage requestPage() throws MalformedURLException, IOException {
HtmlPage page = environment.getPage("/test.jsf");
-// System.out.println(page.asXml());
+ System.out.println(page.asXml());
return page;
}
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/component/ClientValidationTest.java
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/component/ClientValidationTest.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/component/ClientValidationTest.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -45,17 +45,17 @@
@Test
public void testRequest() throws Exception {
HtmlPage page = requestPage();
- HtmlInput input = hetInput(page);
+ HtmlInput input = getInput(page);
assertNotNull(input);
}
- @Test @Ignore
+ @Test
public void testSubmitTooShortValue() throws Exception {
submitValueAndCheckMesage("",containsString("Error"));
}
- @Test @Ignore
+ @Test
public void testSubmitTooLongValue() throws Exception {
submitValueAndCheckMesage("123456",containsString("Error"));
}
@@ -67,14 +67,15 @@
private void submitValueAndCheckMesage(String value, Matcher<String> matcher) throws Exception {
HtmlPage page = requestPage();
- HtmlInput input = hetInput(page);
- input.setValueAttribute(value);
- input.fireEvent("keyup");
- HtmlElement message = page.getElementById("form:message");
+ HtmlInput input = getInput(page);
+ page = (HtmlPage) input.setValueAttribute(value);
+ input.fireEvent("blur");
+ System.out.println(page.asXml());
+ HtmlElement message = page.getElementById("uiMessage");
assertThat(message.getTextContent(), matcher);
-// System.out.println(page.asXml());
}
- private HtmlInput hetInput(HtmlPage page) {
+
+ private HtmlInput getInput(HtmlPage page) {
HtmlForm htmlForm = page.getFormByName("form");
assertNotNull(htmlForm);
HtmlInput input = htmlForm.getInputByName("form:text");
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/MockTestBase.java
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/MockTestBase.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/MockTestBase.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -21,14 +21,15 @@
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();
+ public final Qunit qunit;
+
protected final RunParameters criteria;
protected MockFacesEnvironment facesEnvironment;
protected UIComponent component;
public MockTestBase(RunParameters criteria) {
this.criteria = criteria;
+ this.qunit = createQunitPage().build();
}
@Before
@@ -59,6 +60,11 @@
return criteria.getOptions();
}
+ protected org.jboss.test.qunit.Qunit.Builder createQunitPage() {
+ return Qunit.builder().loadJsfResource("jquery.js").loadJsfResource("richfaces.js")
+ .loadJsfResource("richfaces-event.js").loadJsfResource("csv.js", "org.richfaces");
+ }
+
protected abstract String getJavaScriptFunctionName();
protected static List<RunParameters[]> options(RunParameters ...criterias){
Deleted: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/TestCriteria.java
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/TestCriteria.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/TestCriteria.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,33 +0,0 @@
-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;
- }
-
-}
Copied: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message (from rev 20657, branches/RF-7654/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message)
Deleted: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/ClearMessageTest.java
===================================================================
--- branches/RF-7654/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/ClearMessageTest.java 2010-12-17 15:59:45 UTC (rev 20657)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/ClearMessageTest.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,59 +0,0 @@
-/*
- * $Id$
- * 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.javascript.client.message;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-
-/**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
-public class ClearMessageTest extends MessageTestBase {
-
- private static final String ERROR_MESSAGE = "Error";
-
- @Test
- public void testClear() throws Exception {
- sendMessage();
- HtmlElement htmlElement = getMessageContentElement();
- String text = htmlElement.asText();
- assertFalse(text.contains(ERROR_MESSAGE));
- }
-
- @Override
- protected String getMessageContent() {
-
- return "<li>Error</li>";
- }
- @Override
- protected String getJavaScriptFunctionName() {
- return "clearMessage";
- }
-}
Copied: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/ClearMessageTest.java (from rev 20657, branches/RF-7654/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/ClearMessageTest.java)
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/ClearMessageTest.java (rev 0)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/ClearMessageTest.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -0,0 +1,60 @@
+/*
+ * $Id$
+ * 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.javascript.client.message;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class ClearMessageTest extends MessageTestBase {
+
+ private static final String ERROR_MESSAGE = "Error";
+
+ @Test
+ public void testClear() throws Exception {
+ setUpMessage();
+ sendMessage();
+ HtmlElement htmlElement = getMessageContentElement();
+ String text = htmlElement.asText();
+ assertFalse(text.contains(ERROR_MESSAGE));
+ }
+
+ @Override
+ protected String getMessageContent() {
+
+ return "<li>Error</li>";
+ }
+ @Override
+ protected String getJavaScriptFunctionName() {
+ return "clearMessage";
+ }
+}
Copied: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/DocumentReadyTest.java (from rev 20677, branches/RF-7654/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/DocumentReadyTest.java)
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/DocumentReadyTest.java (rev 0)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/DocumentReadyTest.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -0,0 +1,59 @@
+/*
+ * $Id$
+ * 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.javascript.client.message;
+
+import static org.junit.Assert.*;
+
+import org.jboss.test.qunit.Qunit.Builder;
+import org.junit.Test;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.javascript.host.Event;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class DocumentReadyTest extends MessageTestBase {
+
+ @Override
+ protected Builder createQunitPage() {
+ return super.createQunitPage().loadContent("$(document).ready(function(){"+MESSAGE_INIT+"});");
+ }
+
+ @Test
+ public void testSend() throws Exception {
+ sendMessage();
+ HtmlElement htmlElement = getMessageContentElement();
+ String text = htmlElement.asText();
+ assertTrue(text.contains(getErrorMessage().getSummary()));
+ }
+
+ @Test
+ public void testUnload() throws Exception {
+ sendMessage();
+ qunit.getPage().getDocumentElement().fireEvent(Event.TYPE_UNLOAD);
+ }
+}
Deleted: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java
===================================================================
--- branches/RF-7654/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java 2010-12-17 15:59:45 UTC (rev 20657)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,63 +0,0 @@
-package org.richfaces.javascript.client.message;
-
-import static org.junit.Assert.*;
-
-import org.ajax4jsf.javascript.JSFunction;
-import org.jboss.test.qunit.Qunit;
-import org.jboss.test.qunit.Qunit.Builder;
-import org.junit.Rule;
-import org.richfaces.javascript.Message;
-
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-
-public class MessageTestBase {
-
- @Rule
- public final Qunit qunit;
-
- public static final String COMPONENT = "component";
-
- public static final String MY_MESSAGE = "myMessage";
-
- public MessageTestBase() {
- this.qunit = createQunitPage().build();
- }
-
- public void setUpMessage(){
- qunit.runScript("new RichFaces.ui.Message(\"" + MY_MESSAGE + "\", {forComponentId:\"" + COMPONENT + "\"})");
- }
-
- protected Builder createQunitPage() {
- return Qunit.builder().loadJsfResource("jquery.js").loadJsfResource("richfaces.js")
- .loadJsfResource("richfaces-event.js").loadJsfResource("richfaces-base-component.js").
- loadJsfResource("csv.js", "org.richfaces").loadJsfResource("message.js", "org.richfaces").content("<div id=\"" + MY_MESSAGE + "\" ><ul id=\"" + MY_MESSAGE + ":Content\">"+getMessageContent()+"</ul></div>");
- }
-
-
- protected String getMessageContent() {
- return "";
- }
-
- protected Object sendMessage() {
- setUpMessage();
- JSFunction clientSideFunction = new JSFunction("RichFaces.csv." + getJavaScriptFunctionName(),COMPONENT,getErrorMessage());
- return qunit.runScript(clientSideFunction.toScript());
-
- }
- protected String getJavaScriptFunctionName() {
- return "sendMessage";
- }
-
- protected Message getErrorMessage() {
- return new Message(2,"error","script error");
- }
-
- protected HtmlElement getMessageContentElement() {
- HtmlPage page = qunit.getPage();
- HtmlElement htmlElement = page.getElementById(MY_MESSAGE+":Content");
- assertNotNull(htmlElement);
- return htmlElement;
- }
-
-}
Copied: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java (from rev 20657, branches/RF-7654/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java)
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java (rev 0)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -0,0 +1,71 @@
+package org.richfaces.javascript.client.message;
+
+import static org.junit.Assert.*;
+
+import org.ajax4jsf.javascript.JSFunction;
+import org.jboss.test.qunit.Qunit;
+import org.jboss.test.qunit.Qunit.Builder;
+import org.junit.Rule;
+import org.richfaces.javascript.Message;
+
+import com.gargoylesoftware.htmlunit.BrowserVersion;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+public class MessageTestBase {
+
+ @Rule
+ public final Qunit qunit;
+
+ public static final String COMPONENT = "form:component";
+
+ public static final String MY_MESSAGE = "form:uiMessage";
+
+ public static final String MESSAGE_INIT = "new RichFaces.ui.Message(\"" + MY_MESSAGE + "\", {forComponentId:\"" + COMPONENT + "\"})";
+
+ public MessageTestBase() {
+ this.qunit = createQunitPage().build();
+ }
+
+ public void setUpMessage(){
+ qunit.runScript(MESSAGE_INIT);
+ }
+
+ protected Builder createQunitPage() {
+ return Qunit.builder().emulate(BrowserVersion.FIREFOX_3_6).loadJsfResource("jquery.js").loadJsfResource("richfaces.js")
+ .loadJsfResource("richfaces-event.js").loadJsfResource("richfaces-base-component.js").
+ loadJsfResource("csv.js", "org.richfaces").loadJsfResource("message.js", "org.richfaces").content(/*"<form id=\"form\" name=\"form\" method=\"post\" action=\"/client-test.jsf\" enctype=\"application/x-www-form-urlencoded\">\n" + */
+ " <input type=\"hidden\" name=\"form\" value=\"form\"/>\n" +
+ " <input id=\"form:text\" type=\"text\" name=\"form:text\" value=\"fooValue\" onblur=\"form_3Atext_3Av("form:text",this,event)\"/>\n" +
+ " <span id=\"form:out\">\n" +
+ " fooValue\n" +
+ " </span><div id=\"foo\" ><ul id=\"" + MY_MESSAGE + "\">"+getMessageContent()+"</ul></div><input type=\"hidden\" name=\"javax.faces.ViewState\" id=\"javax.faces.ViewState\" value=\"4262028796446907996:-2607792463910755035\" autocomplete=\"off\"/>\n"
+ /*+ " </form>"*/);
+ }
+
+
+ protected String getMessageContent() {
+ return "";
+ }
+
+ protected Object sendMessage() {
+ JSFunction clientSideFunction = new JSFunction("RichFaces.csv." + getJavaScriptFunctionName(),COMPONENT,getErrorMessage());
+ return qunit.runScript(clientSideFunction.toScript());
+
+ }
+ protected String getJavaScriptFunctionName() {
+ return "sendMessage";
+ }
+
+ protected Message getErrorMessage() {
+ return new Message(2,"error","script error");
+ }
+
+ protected HtmlElement getMessageContentElement() {
+ HtmlPage page = qunit.getPage();
+ HtmlElement htmlElement = page.getElementById(MY_MESSAGE);
+ assertNotNull(htmlElement);
+ return htmlElement;
+ }
+
+}
Deleted: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/SendMessageTest.java
===================================================================
--- branches/RF-7654/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/SendMessageTest.java 2010-12-17 15:59:45 UTC (rev 20657)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/SendMessageTest.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,47 +0,0 @@
-/*
- * $Id$
- * 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.javascript.client.message;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-
-/**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
-public class SendMessageTest extends MessageTestBase {
-
- @Test
- public void testSend() throws Exception {
- sendMessage();
- HtmlElement htmlElement = getMessageContentElement();
- String text = htmlElement.asText();
- assertTrue(text.contains(getErrorMessage().getSummary()));
- }
-
-}
Copied: trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/SendMessageTest.java (from rev 20657, branches/RF-7654/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/SendMessageTest.java)
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/SendMessageTest.java (rev 0)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/SendMessageTest.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -0,0 +1,48 @@
+/*
+ * $Id$
+ * 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.javascript.client.message;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class SendMessageTest extends MessageTestBase {
+
+ @Test
+ public void testSend() throws Exception {
+ setUpMessage();
+ sendMessage();
+ HtmlElement htmlElement = getMessageContentElement();
+ String text = htmlElement.asText();
+ assertTrue(text.contains(getErrorMessage().getSummary()));
+ }
+
+}
Deleted: trunk/ui/validator/ui/src/test/java/org/richfaces/validator/ClientScriptServiceTest.java
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/validator/ClientScriptServiceTest.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/validator/ClientScriptServiceTest.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,121 +0,0 @@
-/**
- *
- */
-package org.richfaces.validator;
-
-import static org.easymock.EasyMock.expect;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-
-import java.util.Map;
-
-import javax.faces.application.Resource;
-import javax.faces.application.ResourceHandler;
-import javax.validation.constraints.Max;
-
-import org.jboss.test.faces.mock.Environment;
-import org.jboss.test.faces.mock.Environment.Feature;
-import org.jboss.test.faces.mock.Mock;
-import org.jboss.test.faces.mock.MockController;
-import org.jboss.test.faces.mock.MockFacesEnvironment;
-import org.jboss.test.faces.mock.MockTestRunner;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import com.google.common.collect.ImmutableMap;
-
-/**
- * @author asmirnov
- *
- */
-(a)RunWith(MockTestRunner.class)
-public class ClientScriptServiceTest {
-
- private static final String TEXT_JAVASCRIPT = "text/javascript";
-
- private static final String ORG_RICHFACES_CSV = "org.richfaces.csv";
-
- private static final String RESOURCE_NAME = ValidatorWithFacesResource.class.getSimpleName() + ".js";
-
- @Mock
- @Environment({ Feature.APPLICATION })
- private MockFacesEnvironment environment;
-
- @Mock
- private ResourceHandler resourceHandler;
-
- private MockController controller;
-
- @Mock
- private Resource resource;
-
- @Mock
- private LibraryFunction function;
-
- private ClientScriptServiceImpl serviceImpl;
-
- /**
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- expect(environment.getApplication().getResourceHandler()).andStubReturn(resourceHandler);
- Map<Class<?>, LibraryFunction> defaultMapping = ImmutableMap
- .<Class<?>, LibraryFunction> of(Max.class, function);
- serviceImpl = new ClientScriptServiceImpl(defaultMapping);
- }
-
- /**
- * @throws java.lang.Exception
- */
- @After
- public void tearDown() throws Exception {
- controller.verify();
- }
-
- /**
- * Test method for {@link org.richfaces.validator.ClientScriptServiceImpl#getScript(FacesContext, java.lang.Class)}.
- *
- * @throws Exception
- */
- @Test
- public void testGetScriptAsJsfResource() throws Exception {
- LibraryFunction script = getScript(resource, ValidatorWithFacesResource.class);
- assertEquals(RESOURCE_NAME, script.getResource().getResourceName());
- assertEquals(ORG_RICHFACES_CSV, script.getResource().getLibrary());
- assertEquals("validatorWithFacesResource", script.getName());
- }
-
- @Test
- public void testGetScriptFromAnnotation() throws Exception {
- LibraryFunction script = getScript(null, ValidatorWithFacesResource.class);
- assertEquals("baz.js", script.getResource().getResourceName());
- assertEquals("bar", script.getResource().getLibrary());
- assertEquals("foo", script.getName());
- }
-
- @Test
- public void testGetScriptFromDefaultMapping() throws Exception {
- LibraryFunction script = getScript(null, Max.class);
- assertSame(function, script);
- }
-
- @Test
- public void testGetScriptOverrideAnnotation() throws Exception {
- Map<Class<?>, LibraryFunction> defaultMapping = ImmutableMap.<Class<?>, LibraryFunction> of(
- ValidatorWithFacesResource.class, function);
- serviceImpl = new ClientScriptServiceImpl(defaultMapping);
- LibraryFunction script = getScript(null, ValidatorWithFacesResource.class);
- assertSame(function, script);
- }
-
- private LibraryFunction getScript(Resource resource, Class<?> serverSideType) throws ScriptNotFoundException {
- expect(resourceHandler.createResource(serverSideType.getSimpleName() + ".js", ORG_RICHFACES_CSV, TEXT_JAVASCRIPT)).andReturn(resource);
- controller.replay();
- LibraryFunction script = serviceImpl.getScript(environment.getFacesContext(), serverSideType);
- return script;
- }
-
-}
Deleted: trunk/ui/validator/ui/src/test/java/org/richfaces/validator/ServiceConfigParserTest.java
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/validator/ServiceConfigParserTest.java 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/validator/ServiceConfigParserTest.java 2010-12-19 22:05:58 UTC (rev 20679)
@@ -1,43 +0,0 @@
-package org.richfaces.validator;
-
-import static org.junit.Assert.*;
-
-import java.util.Map;
-
-import javax.faces.FacesException;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ServiceConfigParserTest {
-
- @Before
- public void setUp() throws Exception {
- }
-
- @After
- public void tearDown() throws Exception {
- }
-
- @Test
- public void testParseConfig() {
- Map<Class<?>, LibraryFunction> parseConfig = ClientServiceConfigParser.parseConfig("csv.xml");
- assertEquals(2, parseConfig.size());
- assertTrue(parseConfig.containsKey(String.class));
- LibraryFunction libraryFunction = parseConfig.get(String.class);
- assertEquals("stringConverter", libraryFunction.getName());
- assertEquals("csv.js", libraryFunction.getResource().getResourceName());
- assertEquals("org.richfaces", libraryFunction.getResource().getLibrary());
- }
-
- @Test(expected=FacesException.class)
- public void testParseBadConfig() {
- Map<Class<?>, LibraryFunction> parseConfig = ClientServiceConfigParser.parseConfig("badcsv.xml");
- }
- @Test()
- public void testParseNoConfig() {
- Map<Class<?>, LibraryFunction> parseConfig = ClientServiceConfigParser.parseConfig("non-exists-csv.xml");
- assertEquals(0, parseConfig.size());
- }
-}
Copied: trunk/ui/validator/ui/src/test/resources/1.html (from rev 20657, branches/RF-7654/ui/validator/ui/src/test/resources/1.html)
===================================================================
--- trunk/ui/validator/ui/src/test/resources/1.html (rev 0)
+++ trunk/ui/validator/ui/src/test/resources/1.html 2010-12-19 22:05:58 UTC (rev 20679)
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script type="text/javascript" src="jquery.js"></script>
+ <script type="text/javascript" src="richfaces.js"></script>
+ <script type="text/javascript" src="richfaces-event.js"></script>
+ <script type="text/javascript" src="richfaces-base-component.js"></script>
+ <script type="text/javascript" src="richfaces-csv.js"></script>
+ <script type="text/javascript" src="richfaces-message.js"></script>
+ </head>
+ <body>
+ <form>
+ Global Message Component:<br />
+ <div id="myMessage1" style="border:1px dotted #000000; margin:4px; padding:2px;">
+ <ul id="myMessage1Content"></ul>
+ <script type="text/javascript">
+ new RichFaces.ui.Message("myMessage1", {});
+ </script>
+ </div>
+ <br />
+ Message Component for component1:<br />
+ <div id="myMessage2" style="border:1px dotted #000000; margin:4px; padding:2px;">
+ <ul id="myMessage2Content"></ul>
+ <script type="text/javascript">
+ new RichFaces.ui.Message("myMessage2", {forComponentId:"component1"});
+ </script>
+
+ </div>
+ <br />
+ Message Component for component2:<br />
+ <div id="myMessage3" style="border:1px dotted #000000; margin:4px; padding:2px;">
+ <ul id="myMessage3Content"></ul>
+ <script type="text/javascript">
+ new RichFaces.ui.Message("myMessage3", {forComponentId:"component2"});
+ </script>
+
+ </div>
+ <br />
+ <input type="button" value="send message for component1" onclick = "RichFaces.Event.fire(window.document, 'onmessage', {componentId:'component1', message:'Message for component1'});" />
+ <input type="button" value="send message for component2" onclick = "RichFaces.Event.fire(window.document, 'onmessage', {componentId:'component2', message:'Message for component2'});" />
+ <br />
+ <input type="button" value="clear message for component1" onclick = "RichFaces.Event.fire(window.document, 'onmessage', {componentId:'component1', message:''});" />
+ <input type="button" value="clear message for component2" onclick = "RichFaces.Event.fire(window.document, 'onmessage', {componentId:'component2', message:''});" />
+
+ </form>
+ </body>
+</html>
Modified: trunk/ui/validator/ui/src/test/resources/org/richfaces/component/client-test.xhtml
===================================================================
--- trunk/ui/validator/ui/src/test/resources/org/richfaces/component/client-test.xhtml 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/validator/ui/src/test/resources/org/richfaces/component/client-test.xhtml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -7,10 +7,10 @@
<h:form id="form">
<h:inputText id="text" value="#{test.value}">
<f:validateLength minimum="1" maximum="3"/>
- <csv:validator event="keyup" />
+ <csv:validator event="blur" />
</h:inputText>
<h:outputText id="out" value="#{test.value}"></h:outputText>
- <h:message id="message" for="text" />
</h:form>
+ <csv:message id="uiMessage" for="text" />
</h:body>
</html>
Modified: trunk/ui/validator/ui/src/test/resources/org/richfaces/component/test.xhtml
===================================================================
--- trunk/ui/validator/ui/src/test/resources/org/richfaces/component/test.xhtml 2010-12-19 21:40:36 UTC (rev 20678)
+++ trunk/ui/validator/ui/src/test/resources/org/richfaces/component/test.xhtml 2010-12-19 22:05:58 UTC (rev 20679)
@@ -7,10 +7,10 @@
<h:form id="form">
<h:inputText id="text" value="#{test.value}">
<f:validator validatorId="custom" />
- <csv:validator event="keyup" />
+ <csv:validator event="blur" />
</h:inputText>
<h:outputText id="out" value="#{test.value}"></h:outputText>
- <h:message id="message" for="text" />
</h:form>
+ <csv:message id="uiMessage" for="text" />
</h:body>
</html>
14 years
JBoss Rich Faces SVN: r20678 - trunk.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-19 16:40:36 -0500 (Sun, 19 Dec 2010)
New Revision: 20678
Modified:
trunk/
Log:
Initialized merge tracking via "svnmerge" with revisions "1-20571" from
https://svn.jboss.org/repos/richfaces/branches/RF-7654
Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RF-7817:1-19154 /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378
+ /branches/RF-7654:1-20571 /branches/RF-7817:1-19154 /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378
14 years