JBoss Rich Faces SVN: r21075 - trunk/ui/output/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-01-19 05:31:30 -0500 (Wed, 19 Jan 2011)
New Revision: 21075
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java
Log:
RF-10205 Taglib: remove attributes iconFolder and iconFolderDisabled from menuGroup
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 2011-01-19 10:27:27 UTC (rev 21074)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java 2011-01-19 10:31:30 UTC (rev 21075)
@@ -27,12 +27,6 @@
public abstract String getIconDisabled();
@Attribute
- public abstract String getIconFolder();
-
- @Attribute
- public abstract String getIconFolderDisabled();
-
- @Attribute
public abstract String getLabel();
@Attribute
13 years, 11 months
JBoss Rich Faces SVN: r21074 - trunk/ui/output/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-01-19 05:27:27 -0500 (Wed, 19 Jan 2011)
New Revision: 21074
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuItem.java
Log:
RF-10201 Taglib: menuItem and menuGroup's attribute value should be hidden
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 2011-01-19 10:00:54 UTC (rev 21073)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuGroup.java 2011-01-19 10:27:27 UTC (rev 21074)
@@ -52,8 +52,11 @@
public abstract String getVerticalOffset();
@Attribute
- public abstract String getHorizontalOffset();
+ public abstract String getHorizontalOffset();
+ @Attribute(hidden = true)
+ public abstract Object getValue();
+
@Attribute(events = @EventName("show"))
public abstract String getOnshow();
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuItem.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuItem.java 2011-01-19 10:00:54 UTC (rev 21073)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuItem.java 2011-01-19 10:27:27 UTC (rev 21074)
@@ -31,6 +31,9 @@
@Attribute
public abstract boolean isDisabled();
+ @Attribute(hidden = true)
+ public abstract Object getValue();
+
public enum Facets {
icon,
iconDisabled
13 years, 11 months
JBoss Rich Faces SVN: r21073 - in modules/tests/metamer/trunk: application/src/main/java/org/richfaces/tests/metamer/bean and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-19 05:00:54 -0500 (Wed, 19 Jan 2011)
New Revision: 21073
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionItemBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java
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/RichToggleControlBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinner.java
Log:
* refactoring because panels were moved to CDK
* Attributes refactored since pn.faces-config.xml doesn't exist anymore
* refactoring of spinner test
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java 2011-01-19 09:51:32 UTC (rev 21072)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java 2011-01-19 10:00:54 UTC (rev 21073)
@@ -45,6 +45,7 @@
import javax.el.ELContext;
import javax.el.ExpressionFactory;
import javax.el.MethodExpression;
+import javax.faces.FacesException;
import javax.faces.bean.ManagedBean;
import javax.faces.component.UIComponent;
import javax.faces.component.behavior.BehaviorBase;
@@ -103,6 +104,8 @@
Attribute newAttr = new Attribute(a);
attributes.put(newAttr.getName(), newAttr);
}
+ } else if (!loadFromClass && !richfacesAttributes.containsKey(componentClass)) {
+ throw new FacesException("Componnent " + componentClass.getName() + " is not included in faces-config.xml.");
} else {
logger.debug("retrieving attributes of " + componentClass.getName() + " from class descriptor");
loadAttributesFromClass(componentClass);
@@ -631,68 +634,65 @@
private void loadRichFacesComponents() {
richfacesAttributes = new HashMap<Class<?>, List<Attribute>>();
- final String[] files = {"META-INF/faces-config.xml", "META-INF/pn.faces-config.xml"};
+ try {
+ ClassLoader cl = UIStatus.class.getClassLoader();
+ Enumeration<URL> fileUrls = cl.getResources("META-INF/faces-config.xml");
+ URL configFile = null;
- for (String file : files) {
- try {
- ClassLoader cl = UIStatus.class.getClassLoader();
- Enumeration<URL> fileUrls = cl.getResources(file);
- URL configFile = null;
-
- while (fileUrls.hasMoreElements()) {
- URL url = fileUrls.nextElement();
- if (url.getPath().contains("richfaces-components-ui")) {
- configFile = url;
- }
+ while (fileUrls.hasMoreElements()) {
+ URL url = fileUrls.nextElement();
+ if (url.getPath().contains("richfaces-components-ui")) {
+ configFile = url;
}
+ }
- JAXBContext context = JAXBContext.newInstance(FacesConfigHolder.class);
- FacesConfigHolder facesConfigHolder = (FacesConfigHolder) context.createUnmarshaller().unmarshal(configFile);
- List<Component> components = facesConfigHolder.getComponents();
- List<Behavior> behaviors = facesConfigHolder.getBehaviors();
+ JAXBContext context = JAXBContext.newInstance(FacesConfigHolder.class);
+ FacesConfigHolder facesConfigHolder = (FacesConfigHolder) context.createUnmarshaller().unmarshal(configFile);
+ List<Component> components = facesConfigHolder.getComponents();
+ List<Behavior> behaviors = facesConfigHolder.getBehaviors();
- for (Component c : components) {
- if (c.getAttributes() == null) {
- continue;
- }
+ for (Component c : components) {
+ if (c.getAttributes() == null) {
+ continue;
+ }
- // remove hidden attributes
- Iterator<Attribute> i = c.getAttributes().iterator();
- while (i.hasNext()) {
- Attribute a = i.next();
- if (a.isHidden() || "id".equals(a.getName()) || "binding".equals(a.getName())) {
- i.remove();
- }
+ // remove hidden attributes
+ Iterator<Attribute> i = c.getAttributes().iterator();
+ while (i.hasNext()) {
+ Attribute a = i.next();
+ if (a.isHidden() || "id".equals(a.getName()) || "binding".equals(a.getName())) {
+ i.remove();
}
+ }
- richfacesAttributes.put(c.getComponentClass(), c.getAttributes());
- logger.info("attributes for component " + c.getComponentClass().getName() + " loaded");
+ richfacesAttributes.put(c.getComponentClass(), c.getAttributes());
+ logger.info("attributes for component " + c.getComponentClass().getName() + " loaded");
+ }
+
+ for (Behavior b : behaviors) {
+ if (b.getAttributes() == null) {
+ continue;
}
- for (Behavior b : behaviors) {
- if (b.getAttributes() == null) {
- continue;
+ // remove hidden attributes
+ Iterator<Attribute> i = b.getAttributes().iterator();
+ while (i.hasNext()) {
+ Attribute a = i.next();
+ if (a.isHidden() || "id".equals(a.getName()) || "binding".equals(a.getName())) {
+ i.remove();
}
-
- // remove hidden attributes
- Iterator<Attribute> i = b.getAttributes().iterator();
- while (i.hasNext()) {
- Attribute a = i.next();
- if (a.isHidden() || "id".equals(a.getName()) || "binding".equals(a.getName())) {
- i.remove();
- }
- }
-
- richfacesAttributes.put(b.getBehaviorClass(), b.getAttributes());
- logger.info("attributes for behavior " + b.getBehaviorClass().getName() + " loaded");
}
- } catch (IOException ex) {
- logger.error("Input/output error.", ex);
- } catch (JAXBException ex) {
- logger.error("XML reading error.", ex);
+ richfacesAttributes.put(b.getBehaviorClass(), b.getAttributes());
+ logger.info("attributes for behavior " + b.getBehaviorClass().getName() + " loaded");
}
+
+ } catch (IOException ex) {
+ logger.error("Input/output error.", ex);
+ } catch (JAXBException ex) {
+ logger.error("XML reading error.", ex);
}
+
}
@XmlRootElement(name = "faces-config", namespace = "http://java.sun.com/xml/ns/javaee")
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionBean.java 2011-01-19 09:51:32 UTC (rev 21072)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionBean.java 2011-01-19 10:00:54 UTC (rev 21073)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionItemBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionItemBean.java 2011-01-19 09:51:32 UTC (rev 21072)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionItemBean.java 2011-01-19 10:00:54 UTC (rev 21073)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -27,8 +27,7 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
-import org.richfaces.component.AbstractAccordionItem;
-
+import org.richfaces.component.UIAccordionItem;
import org.richfaces.tests.metamer.Attributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -55,7 +54,7 @@
logger = LoggerFactory.getLogger(getClass());
logger.debug("initializing bean " + getClass().getName());
- attributes = Attributes.getComponentAttributesFromFacesConfig(AbstractAccordionItem.class, getClass());
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIAccordionItem.class, getClass());
attributes.setAttribute("header", "Item 1");
attributes.setAttribute("name", "item1");
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.java 2011-01-19 09:51:32 UTC (rev 21072)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.java 2011-01-19 10:00:54 UTC (rev 21073)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -53,7 +53,7 @@
logger = LoggerFactory.getLogger(getClass());
logger.debug("initializing bean " + getClass().getName());
- attributes = Attributes.getComponentAttributesFromClass(UICollapsiblePanel.class, getClass());
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UICollapsiblePanel.class, getClass());
attributes.setAttribute("rendered", true);
attributes.setAttribute("header", "collapsible panel header");
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuBean.java 2011-01-19 09:51:32 UTC (rev 21072)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuBean.java 2011-01-19 10:00:54 UTC (rev 21073)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -27,7 +27,7 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
-import org.richfaces.component.html.HtmlPanelMenu;
+import org.richfaces.component.UIPanelMenu;
import org.richfaces.event.ItemChangeEvent;
import org.richfaces.tests.metamer.Attributes;
import org.slf4j.Logger;
@@ -56,7 +56,7 @@
logger.debug("initializing bean " + getClass().getName());
// loading from Class to work around RF-10161
- attributes = Attributes.getComponentAttributesFromClass(HtmlPanelMenu.class, getClass());
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIPanelMenu.class, getClass());
attributes.setAttribute("rendered", true);
attributes.setAttribute("style", "width: 200px;");
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java 2011-01-19 09:51:32 UTC (rev 21072)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java 2011-01-19 10:00:54 UTC (rev 21073)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -27,7 +27,7 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
-import org.richfaces.component.html.HtmlPanelMenuGroup;
+import org.richfaces.component.UIPanelMenuGroup;
import org.richfaces.tests.metamer.Attributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -53,15 +53,15 @@
public void init() {
logger = LoggerFactory.getLogger(getClass());
logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromClass(HtmlPanelMenuGroup.class, getClass());
-
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIPanelMenuGroup.class, getClass());
+
attributes.setAttribute("rendered", true);
-
+
// already defined in source directly
attributes.remove("name");
attributes.remove("label");
-
+
// attributes should be hidden
attributes.remove("panelMenu");
attributes.remove("parentItem");
@@ -77,7 +77,7 @@
public void setAttributes(Attributes attributes) {
this.attributes = attributes;
}
-
+
public void changeExpandListener(Object event) {
// TODO ajax or server expansion doesn't work yet
throw new UnsupportedOperationException("needs to be implemented in Metamer");
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java 2011-01-19 09:51:32 UTC (rev 21072)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java 2011-01-19 10:00:54 UTC (rev 21073)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -27,7 +27,7 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
-import org.richfaces.component.html.HtmlPanelMenuItem;
+import org.richfaces.component.UIPanelMenuItem;
import org.richfaces.tests.metamer.Attributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -53,15 +53,15 @@
public void init() {
logger = LoggerFactory.getLogger(getClass());
logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromClass(HtmlPanelMenuItem.class, getClass());
-
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIPanelMenuItem.class, getClass());
+
attributes.setAttribute("rendered", true);
-
+
// already defined in source directly
attributes.remove("name");
attributes.remove("label");
-
+
// attributes should be hidden
attributes.remove("panelMenu");
attributes.remove("parentItem");
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 2011-01-19 09:51:32 UTC (rev 21072)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTabPanelBean.java 2011-01-19 10:00:54 UTC (rev 21073)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -53,7 +53,7 @@
logger = LoggerFactory.getLogger(getClass());
logger.debug("initializing bean " + getClass().getName());
- attributes = Attributes.getComponentAttributesFromClass(UITabPanel.class, getClass());
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UITabPanel.class, getClass());
attributes.setAttribute("activeItem", "tab1");
attributes.setAttribute("rendered", true);
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToggleControlBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToggleControlBean.java 2011-01-19 09:51:32 UTC (rev 21072)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToggleControlBean.java 2011-01-19 10:00:54 UTC (rev 21073)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java 2011-01-19 09:51:32 UTC (rev 21072)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java 2011-01-19 10:00:54 UTC (rev 21073)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinner.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinner.java 2011-01-19 09:51:32 UTC (rev 21072)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinner.java 2011-01-19 10:00:54 UTC (rev 21073)
@@ -464,8 +464,7 @@
@Test
public void testRendered() {
- JQueryLocator renderedInput = pjq("input[type=radio][name$=renderedInput][value=false]");
- selenium.click(renderedInput);
+ selenium.click(pjq("input[type=radio][name$=renderedInput][value=false]"));
selenium.waitForPageToLoad();
assertFalse(selenium.isElementPresent(spinner), "Spinner should not be rendered when rendered=false.");
13 years, 11 months
JBoss Rich Faces SVN: r21072 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-19 04:51:32 -0500 (Wed, 19 Jan 2011)
New Revision: 21072
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableSimple.java
Log:
fixed the compilation failure (the forgotten testing line of code)
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableSimple.java 2011-01-19 09:50:52 UTC (rev 21071)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTable/TestCollapsibleSubTableSimple.java 2011-01-19 09:51:32 UTC (rev 21072)
@@ -33,7 +33,6 @@
import org.jboss.test.selenium.request.RequestType;
import org.richfaces.ExpandMode;
-import org.richfaces.component.UICollapsibleSubTable;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.richfaces.tests.metamer.model.Employee;
@@ -93,8 +92,6 @@
assertTrue(configurationMen.subtable.hasVisibleRows());
assertTrue(configurationWomen.subtable.hasVisibleRows());
-
- new UICollapsibleSubTable().getCaptionClass();
}
@Test
13 years, 11 months
JBoss Rich Faces SVN: r21071 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richTree and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-19 04:50:52 -0500 (Wed, 19 Jan 2011)
New Revision: 21071
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
Log:
rich:tree - sample cleaning before automation
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2011-01-19 09:49:59 UTC (rev 21070)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2011-01-19 09:50:52 UTC (rev 21071)
@@ -80,21 +80,13 @@
attributes.get("toggleType").setValue("ajax");
attributes.get("selectionType").setValue("ajax");
- // FIXME attributes not in taglib
- attributes.setAttribute("iconLeaf", null);
- attributes.setAttribute("iconExpanded", null);
- attributes.setAttribute("iconCollapsed", null);
- attributes.setAttribute("handleClass", null);
- attributes.setAttribute("iconClass", null);
- attributes.setAttribute("labelClass", null);
- attributes.setAttribute("nodeClass", null);
- attributes.setAttribute("execute", null);
- attributes.setAttribute("render", null);
- attributes.setAttribute("toggleNodeEvent", null);
-
- // hidden attributes
+ // attributes which needs to be tested another way
attributes.remove("selectionChangeListener");
attributes.remove("toggleListener");
+ attributes.remove("value");
+ attributes.remove("var");
+ attributes.remove("rowKeyVar");
+ attributes.remove("stateVar");
for (CompactDiscXmlDescriptor descriptor : model.getCompactDiscs()) {
createCompactDisc(descriptor);
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java 2011-01-19 09:49:59 UTC (rev 21070)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java 2011-01-19 09:50:52 UTC (rev 21071)
@@ -54,17 +54,10 @@
for (int i = 0; i < attributes.length; i++) {
attributes[i] = Attributes.getComponentAttributesFromFacesConfig(UITreeNode.class, getClass());
-
-
attributes[i].get("rendered").setValue(true);
-
- // FIXME attributes not in taglib
- attributes[i].setAttribute("iconLeaf", null);
- attributes[i].setAttribute("iconExpanded", null);
- attributes[i].setAttribute("iconCollapsed", null);
- attributes[i].setAttribute("handleClass", null);
- attributes[i].setAttribute("iconClass", null);
- attributes[i].setAttribute("labelClass", null);
+
+ // attributes which needs to be tested another way
+ attributes[i].remove("type");
}
}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2011-01-19 09:49:59 UTC (rev 21070)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2011-01-19 09:50:52 UTC (rev 21071)
@@ -244,7 +244,7 @@
<metamer:attributes value="#{richTreeBean.attributes}" id="attributes" />
</fieldset>
<fieldset>
- <legend>rich:treeNode type="company"</legend>
+ <legend>rich:treeNode type="country"</legend>
<metamer:attributes value="#{richTreeNodeBean.attributes[0]}" id="treeNode1Attributes" />
</fieldset>
<fieldset>
13 years, 11 months
JBoss Rich Faces SVN: r21070 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richTree and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-19 04:49:59 -0500 (Wed, 19 Jan 2011)
New Revision: 21070
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeModel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeModelAdaptorAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeModelRecursiveAdaptorAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeHandle.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeIcon.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeModel.java
Log:
rich:tree - created model and attributes of tree and its nodes (RFPL-935)
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeAttributes.java 2011-01-19 09:49:59 UTC (rev 21070)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * 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.ftest.richTree;
+
+import org.richfaces.component.SwitchType;
+import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TreeAttributes extends AbstractComponentAttributes {
+ public void setData(String data) {
+ setProperty("data", data);
+ }
+
+ public void setExecute(String execute) {
+ setProperty("execute", execute);
+ }
+
+ public void setIconCollapsed(String iconCollapsed) {
+ setProperty("iconCollapsed", iconCollapsed);
+ }
+
+ public void setIconExpanded(String iconExpanded) {
+ setProperty("iconExpanded", iconExpanded);
+ }
+
+ public void setIconLeaf(String iconLeaf) {
+ setProperty("iconLeaf", iconLeaf);
+ }
+
+ public void setImmediate(Boolean immediate) {
+ setProperty("immediate", immediate);
+ }
+
+ public void setKeepSaved(Boolean keepSaved) {
+ setProperty("keepSaved", keepSaved);
+ }
+
+ public void setLang(String lang) {
+ setProperty("lang", lang);
+ }
+
+ public void setLimitRender(String limitRender) {
+ setProperty("limitRender", limitRender);
+ }
+
+ public void setRender(String render) {
+ setProperty("render", render);
+ }
+
+ public void setRendered(Boolean rendered) {
+ setProperty("rendered", rendered);
+ }
+
+ public void setSelectionType(SwitchType selectionType) {
+ setProperty("selectionType", selectionType);
+ }
+
+ public void setStatus(String status) {
+ setProperty("status", status);
+ }
+
+ public void setTitle(String title) {
+ setProperty("title", title);
+ }
+
+ public void setToggleNodeEvent(String toggleNodeEvent) {
+ setProperty("toggleNodeEvent", toggleNodeEvent);
+ }
+
+ public void setToggleType(SwitchType toggleType) {
+ setProperty("toggleType", toggleType);
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeModel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeModel.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeModel.java 2011-01-19 09:49:59 UTC (rev 21070)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * 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.ftest.richTree;
+
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.locator.reference.ReferencedLocator.ref;
+
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.locator.reference.ReferencedLocator;
+import org.richfaces.tests.metamer.ftest.model.AbstractModel;
+import org.richfaces.tests.metamer.ftest.model.ModelIterable;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TreeModel extends AbstractModel<JQueryLocator> {
+
+ static JQueryLocator treeNode = jq("> div.rf-td-nd");
+
+ public TreeModel(JQueryLocator root) {
+ super(root);
+ }
+
+ public TreeModel(String name, JQueryLocator root) {
+ super(name, root);
+ }
+
+ ReferencedLocator<JQueryLocator> node = ref(root, treeNode.getRawLocator());
+
+ public Iterable<TreeNodeModel> getNodes() {
+ return new ModelIterable<JQueryLocator, TreeNodeModel>(node.getAllOccurrences(), TreeNodeModel.class);
+ }
+
+ public JQueryLocator getNode(int index) {
+ return node.getNthOccurence(index);
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeModelAdaptorAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeModelAdaptorAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeModelAdaptorAttributes.java 2011-01-19 09:49:59 UTC (rev 21070)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * 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.ftest.richTree;
+
+import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TreeModelAdaptorAttributes extends AbstractComponentAttributes {
+ public void setRendered(Boolean rendered) {
+ setProperty("rendered", rendered);
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeModelRecursiveAdaptorAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeModelRecursiveAdaptorAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeModelRecursiveAdaptorAttributes.java 2011-01-19 09:49:59 UTC (rev 21070)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * 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.ftest.richTree;
+
+import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TreeModelRecursiveAdaptorAttributes extends AbstractComponentAttributes {
+ public void setRendered(Boolean rendered) {
+ setProperty("rendered", rendered);
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeAttributes.java 2011-01-19 09:49:59 UTC (rev 21070)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * 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.ftest.richTree;
+
+import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TreeNodeAttributes extends AbstractComponentAttributes {
+ public void setDir(String dir) {
+ setProperty("dir", dir);
+ }
+
+ public void setExpanded(Boolean expanded) {
+ setProperty("expanded", expanded);
+ }
+
+ public void setIconCollapsed(String iconCollapsed) {
+ setProperty("iconCollapsed", iconCollapsed);
+ }
+
+ public void setIconExpanded(String iconExpanded) {
+ setProperty("iconExpanded", iconExpanded);
+ }
+
+ public void setIconLeaf(String iconLeaf) {
+ setProperty("iconLeaf", iconLeaf);
+ }
+
+ public void setImmediate(Boolean immediate) {
+ setProperty("immediate", immediate);
+ }
+
+ public void setLang(String lang) {
+ setProperty("lang", lang);
+ }
+
+ public void setRendered(Boolean rendered) {
+ setProperty("rendered", rendered);
+ }
+
+ public void setTitle(String title) {
+ setProperty("title", title);
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeHandle.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeHandle.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeHandle.java 2011-01-19 09:49:59 UTC (rev 21070)
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * 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.ftest.richTree;
+
+import org.jboss.test.selenium.framework.AjaxSelenium;
+import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.model.AbstractModel;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TreeNodeHandle extends AbstractModel<JQueryLocator> {
+
+ AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
+
+ String classHandleLeaf = "rf-trn-hnd-lf";
+ String classHandleExpanded = "rf-trn-hnd-exp";
+ String classHandleCollapsed = "rf-trn-hnd-colps";
+
+ public TreeNodeHandle(JQueryLocator root) {
+ super(root);
+ }
+
+ public boolean isExpanded() {
+ return selenium.belongsClass(this, classHandleExpanded);
+ }
+
+ public boolean isCollapsed() {
+ return selenium.belongsClass(this, classHandleCollapsed);
+ }
+
+ public boolean isLeaf() {
+ return selenium.belongsClass(this, classHandleLeaf);
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeIcon.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeIcon.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeIcon.java 2011-01-19 09:49:59 UTC (rev 21070)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * 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.ftest.richTree;
+
+import org.jboss.test.selenium.framework.AjaxSelenium;
+import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.model.AbstractModel;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TreeNodeIcon extends AbstractModel<JQueryLocator> {
+
+ AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
+
+ String classIconLeaf = "rf-trn-ico-lf";
+ String classIconExpanded = "rf-trn-ico-exp";
+ String classIconCollapsed = "rf-trn-ico-colps";
+
+ public TreeNodeIcon(JQueryLocator root) {
+ super(root);
+ }
+
+ public boolean isExpanded() {
+ return selenium.belongsClass(this, classIconExpanded);
+ }
+
+ public boolean isCollapsed() {
+ return selenium.belongsClass(this, classIconCollapsed);
+ }
+
+ public boolean isLeaf() {
+ return selenium.belongsClass(this, classIconLeaf);
+ }
+
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeModel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeModel.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeModel.java 2011-01-19 09:49:59 UTC (rev 21070)
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * 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.ftest.richTree;
+
+import static org.jboss.test.selenium.locator.reference.ReferencedLocator.ref;
+
+import org.jboss.test.selenium.framework.AjaxSelenium;
+import org.jboss.test.selenium.framework.AjaxSeleniumProxy;
+import org.jboss.test.selenium.locator.ExtendedLocator;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.locator.reference.ReferencedLocator;
+import org.richfaces.tests.metamer.ftest.model.AbstractModel;
+import org.richfaces.tests.metamer.ftest.model.ModelIterable;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TreeNodeModel extends AbstractModel<JQueryLocator> {
+
+ AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
+
+ ReferencedLocator<JQueryLocator> subnodes = ref(root, TreeModel.treeNode.getRawLocator());
+
+ String classNodeExpanded = "rf-tr-nd-exp";
+ String classNodeLeaf = "rf-tr-nd-lf";
+ String classNodeCollapsed = "rf-tr-nd-lf";
+ String classSelected = "rf-trn-sel";
+
+ ReferencedLocator<JQueryLocator> treeNode = ref(root, "> div.rf-trn");
+ ReferencedLocator<JQueryLocator> handle = ref(treeNode, "> span.rf-trn-hnd");
+ ReferencedLocator<JQueryLocator> content = ref(treeNode, "> span.rf-trn-cnt");
+ ReferencedLocator<JQueryLocator> icon = ref(content, "> span.rf-trn-ico");
+ ReferencedLocator<JQueryLocator> label = ref(content, "> span.rf-trn-lbl");
+
+ public TreeNodeModel(JQueryLocator root) {
+ super(root);
+ }
+
+ public Iterable<TreeNodeModel> getNodes() {
+ return new ModelIterable<JQueryLocator, TreeNodeModel>(subnodes.getAllOccurrences(), TreeNodeModel.class);
+ }
+
+ public JQueryLocator getNode(int index) {
+ return subnodes.getNthOccurence(index);
+ }
+
+ public TreeNodeHandle getHandle() {
+ return new TreeNodeHandle(handle.getReferenced());
+ }
+
+ public TreeNodeIcon getIcon() {
+ return new TreeNodeIcon(icon.getReferenced());
+ }
+
+ public ExtendedLocator<JQueryLocator> getLabel() {
+ return label;
+ }
+
+ public boolean isSelected() {
+ return selenium.belongsClass(root.getLocator(), classSelected);
+ }
+
+ public boolean isExpanded() {
+ return selenium.belongsClass(root.getLocator(), classNodeExpanded);
+ }
+
+ public boolean isCollapsed() {
+ return selenium.belongsClass(root.getLocator(), classNodeCollapsed);
+ }
+
+ public boolean isLeaf() {
+ return selenium.belongsClass(root.getLocator(), classNodeLeaf);
+ }
+
+ public String getLabelText() {
+ return selenium.getText(label);
+ }
+}
13 years, 11 months
JBoss Rich Faces SVN: r21069 - modules/tests/metamer/trunk/application/src/main/webapp/resources/css.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-19 04:49:05 -0500 (Wed, 19 Jan 2011)
New Revision: 21069
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/common.ecss
Log:
phases panel size stabilized (scroller added for overflowing)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/resources/css/common.ecss
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/resources/css/common.ecss 2011-01-19 08:06:08 UTC (rev 21068)
+++ modules/tests/metamer/trunk/application/src/main/webapp/resources/css/common.ecss 2011-01-19 09:49:05 UTC (rev 21069)
@@ -20,6 +20,12 @@
border-color: '#{a4jSkin.panelBorderColor}';
}
+.phases-list {
+ font-size: 0.7em;
+ height: 130px;
+ overflow: auto;
+}
+
a img {
border: 0px;
}
13 years, 11 months
JBoss Rich Faces SVN: r21068 - trunk/examples/richfaces-showcase/src/main/webapp/richfaces/fileUpload/samples.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2011-01-19 03:06:08 -0500 (Wed, 19 Jan 2011)
New Revision: 21068
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/fileUpload/samples/imgUpload-sample.xhtml
Log:
not existent attribute removed.
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/fileUpload/samples/imgUpload-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/fileUpload/samples/imgUpload-sample.xhtml 2011-01-19 07:55:42 UTC (rev 21067)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/fileUpload/samples/imgUpload-sample.xhtml 2011-01-19 08:06:08 UTC (rev 21068)
@@ -21,8 +21,7 @@
<h:form>
<h:panelGrid columns="2" columnClasses="top,top">
<rich:fileUpload fileUploadListener="#{fileUploadBean.listener}"
- maxFilesQuantity="#{fileUploadBean.uploadsAvailable}" id="upload"
- acceptedTypes="jpg, gif, png, bmp">
+ id="upload" acceptedTypes="jpg, gif, png, bmp">
<a4j:ajax event="uploadcomplete" execute="@none" render="info" />
</rich:fileUpload>
<h:panelGroup id="info">
13 years, 11 months
JBoss Rich Faces SVN: r21067 - in branches/RF-9797/ui/validator/ui/src/main: java/org/richfaces/validator and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2011-01-19 02:55:42 -0500 (Wed, 19 Jan 2011)
New Revision: 21067
Modified:
branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientOnlyScript.java
branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValidatorServiceImpl.java
branches/RF-9797/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js
Log:
CODING IN PROGRESS - issue RF-9797: CSV: make client code compatible with the current wiki document
https://issues.jboss.org/browse/RF-9797
Length validator working.
Modified: branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientOnlyScript.java
===================================================================
--- branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientOnlyScript.java 2011-01-19 01:02:11 UTC (rev 21066)
+++ branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientOnlyScript.java 2011-01-19 07:55:42 UTC (rev 21067)
@@ -68,15 +68,10 @@
protected void appendConverter(Appendable target, LibraryScriptFunction converter) throws IOException {
target.append('{').append("f").append(':').append(converter.getName()).append(',');
- target.append(PARAMS).append(':').append('{');
+ target.append(PARAMS).append(':');ScriptUtils.appendScript(target, converter.getParameters());
+ target.append(',');
target.append(MESSAGE).append(':');ScriptUtils.appendScript(target, converter.getMessage());
- for(Map.Entry<String, ? extends Object> entry: converter.getParameters().entrySet()){
- target.append(',');
- target.append(entry.getKey()).append(':');
- ScriptUtils.appendScript(target, entry.getValue());
- }
target.append('}');
- target.append('}');
}
protected void appendAjaxParameter(Appendable target) throws IOException {
Modified: branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValidatorServiceImpl.java
===================================================================
--- branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValidatorServiceImpl.java 2011-01-19 01:02:11 UTC (rev 21066)
+++ branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValidatorServiceImpl.java 2011-01-19 07:55:42 UTC (rev 21067)
@@ -40,7 +40,18 @@
if (component instanceof DoubleRangeValidator) {
messageId = DoubleRangeValidator.NOT_IN_RANGE_MESSAGE_ID;
} else if (component instanceof LengthValidator) {
- messageId = LengthValidator.MAXIMUM_MESSAGE_ID;
+ LengthValidator validator = (LengthValidator) component;
+ if(validator.getMaximum() >0){
+ if(validator.getMinimum()>0){
+ messageId = DoubleRangeValidator.NOT_IN_RANGE_MESSAGE_ID;
+ } else {
+ messageId = LengthValidator.MAXIMUM_MESSAGE_ID;
+ }
+ } else if( validator.getMinimum()>0){
+ messageId = LengthValidator.MINIMUM_MESSAGE_ID;
+ } else {
+ messageId = DoubleRangeValidator.NOT_IN_RANGE_MESSAGE_ID;// What to use for that case ( no min/max set, validator always pass ).
+ }
} else if (component instanceof LongRangeValidator) {
messageId = LongRangeValidator.NOT_IN_RANGE_MESSAGE_ID;
} else if (component instanceof RegexValidator) {
Modified: branches/RF-9797/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js
===================================================================
--- branches/RF-9797/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js 2011-01-19 01:02:11 UTC (rev 21066)
+++ branches/RF-9797/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js 2011-01-19 07:55:42 UTC (rev 21067)
@@ -8,8 +8,7 @@
var RE_MESSAGE_PATTERN = /\{(\d+)\}/g;
- var __interpolateMessage = function (customMessage, values) {
- var message = customMessage || "";
+ var __interpolateMessage = function (message, values) {
if (message) {
var msgObject = message.replace(RE_MESSAGE_PATTERN,"\n$1\n").split("\n");
var value;
@@ -17,9 +16,10 @@
value = values[msgObject[i]];
msgObject[i] = typeof value == "undefined" ? "" : value;
}
- message = msgObject.join('');
+ return msgObject.join('');
+ } else {
+ return "";
}
- return message;
}
var _interpolateFacesMessage = function(msg,id,value){
@@ -56,6 +56,9 @@
var message = customMessage ? {detail:customMessage,summary:customMessage} : _messages[messageId] || {detail:"",summary:""};
return {detail:__interpolateMessage(message.detail,values),summary:__interpolateMessage(message.summary,values)};
},
+ interpolateMessage: function(message,values){
+ return {detail:__interpolateMessage(message.detail,values),summary:__interpolateMessage(message.summary,values)};
+ },
sendMessage: function (componentId, message) {
rf.Event.fire(window.document, rf.Event.MESSAGE_EVENT_TYPE, {'sourceId':componentId, 'message':message});
},
@@ -66,9 +69,9 @@
if (converter) {
try {
if (converter.f)
- convertedValue = converter.f(value, converter.p);
+ convertedValue = converter.f(value,id,converter.p,converter.m);
} catch (e){
- rf.csv.sendMessage(id, _interpolateFacesMessage(e,id,value));
+ rf.csv.sendMessage(id, e);
return false;
}
} else {
@@ -81,11 +84,11 @@
for (i=0;i<validators.length;i++) {
validatorFunction = validators[i].f;
if (validatorFunction) {
- validatorFunction(convertedValue, validators[i].p);
+ validatorFunction(convertedValue,id, validators[i].p,validators[i].m);
}
}
} catch (e) {
- rf.csv.sendMessage(id, _interpolateFacesMessage(e,id,value));
+ rf.csv.sendMessage(id, e);
return false;
}
}
@@ -123,32 +126,32 @@
* Converters implementation
*/
$.extend(rf.csv, {
- "convertBoolean": function (value, params) {
+ "convertBoolean": function (value,label,params,msg) {
var result; value = $.trim(value).toLowerCase();
result = value=='true' ? true : value.length<1 ? null : false;
return result;
},
- "convertByte": function (value, params) {
+ "convertByte": function (value,label,params,msg) {
var result; value = $.trim(value);
if (!rf.csv.RE_DIGITS.test(value) || (result=parseInt(value,10))<-128 || result>127) {
- throw rf.csv.getMessage(params.m, 'BYTE_CONVERTER_BYTE', [value, 0, params.componentId]);
+ throw rf.csv.getMessage(msg, 'BYTE_CONVERTER_BYTE', [value, 0, params.componentId]);
}
return result;
},
- "convertNumber": function (value, params) {
+ "convertNumber": function (value,label,params,msg) {
var result; value=$.trim(value);
if (isNaN(value)) {
- throw rf.csv.getMessage(params.m, 'NUMBER_CONVERTER_NUMBER', [value, 0, params.componentId]);
+ throw rf.csv.getMessage(msg, 'NUMBER_CONVERTER_NUMBER', [value, 0, params.componentId]);
} else {
result = parseInt(value, 10);
}
return result;
},
- "convertShort": function (value, params) {
+ "convertShort": function (value,label,params,msg) {
var result; value = $.trim(value);
if (!rf.csv.RE_DIGITS.test(value) || (result=parseInt(value,10))<-32768 || result>32767) {
- throw rf.csv.getMessage(params.m, 'SHORT_CONVERTER_SHORT', [value, 0, params.componentId]);
+ throw rf.csv.getMessage(msg, 'SHORT_CONVERTER_SHORT', [value, 0, params.componentId]);
}
return result;
}
@@ -158,15 +161,15 @@
* Validators implementation
*/
$.extend(rf.csv, {
- "validateLongRange": function (value, params) {
+ "validateLongRange": function (value,label,params,msg) {
var type = typeof value;
if (type != "number") {
if (type != "string") {
- throw rf.csv.getMessage(params.m, 'LONG_RANGE_VALIDATOR_TYPE', [componentId, ""]);
+ throw rf.csv.getMessage(msg, 'LONG_RANGE_VALIDATOR_TYPE', [componentId, ""]);
} else {
value = $.trim(value);
if (!rf.csv.RE_DIGITS.test(value) || (value = parseInt(value, 10))==NaN) {
- throw rf.csv.getMessage(params.m, 'LONG_RANGE_VALIDATOR_TYPE', [componentId, ""]);
+ throw rf.csv.getMessage(msg, 'LONG_RANGE_VALIDATOR_TYPE', [componentId, ""]);
}
}
}
@@ -176,28 +179,28 @@
if (isMaxSet && value > params.maximum) {
if (isMinSet) {
- throw rf.csv.getMessage(params.m, 'LONG_RANGE_VALIDATOR_NOT_IN_RANGE', [params.minimum, params.maximum, componentId]);
+ throw rf.csv.getMessage(msg, 'LONG_RANGE_VALIDATOR_NOT_IN_RANGE', [params.minimum, params.maximum, componentId]);
} else {
- throw rf.csv.getMessage(params.m, 'LONG_RANGE_VALIDATOR_MAXIMUM', [params.maximum, componentId]);
+ throw rf.csv.getMessage(msg, 'LONG_RANGE_VALIDATOR_MAXIMUM', [params.maximum, componentId]);
}
}
if (isMinSet && value < params.minimum) {
if (isMaxSet) {
- throw rf.csv.getMessage(params.m, 'LONG_RANGE_VALIDATOR_NOT_IN_RANGE', [params.minimum, params.maximum, componentId]);
+ throw rf.csv.getMessage(msg, 'LONG_RANGE_VALIDATOR_NOT_IN_RANGE', [params.minimum, params.maximum, componentId]);
} else {
- throw rf.csv.getMessage(params.m, 'LONG_RANGE_VALIDATOR_MINIMUM', [params.minimum, componentId]);
+ throw rf.csv.getMessage(msg, 'LONG_RANGE_VALIDATOR_MINIMUM', [params.minimum, componentId]);
}
}
},
- "validateDoubleRange": function (value, params) {
+ "validateDoubleRange": function (value,label,params,msg) {
var type = typeof value;
if (type != "number") {
if (type != "string") {
- throw rf.csv.getMessage(params.m, 'DOUBLE_RANGE_VALIDATOR_TYPE', [componentId, ""]);
+ throw rf.csv.getMessage(msg, 'DOUBLE_RANGE_VALIDATOR_TYPE', [componentId, ""]);
} else {
value = $.trim(value);
if (!rf.csv.RE_FLOAT.test(value) || (value = parseFloat(value))==NaN) {
- throw rf.csv.getMessage(params.m, 'DOUBLE_RANGE_VALIDATOR_TYPE', [componentId, ""]);
+ throw rf.csv.getMessage(msg, 'DOUBLE_RANGE_VALIDATOR_TYPE', [componentId, ""]);
}
}
}
@@ -207,45 +210,48 @@
if (isMaxSet && value > params.maximum) {
if (isMinSet) {
- throw rf.csv.getMessage(params.m, 'DOUBLE_RANGE_VALIDATOR_NOT_IN_RANGE', [params.minimum, params.maximum, componentId]);
+ throw rf.csv.getMessage(msg, 'DOUBLE_RANGE_VALIDATOR_NOT_IN_RANGE', [params.minimum, params.maximum, componentId]);
} else {
- throw rf.csv.getMessage(params.m, 'DOUBLE_RANGE_VALIDATOR_MAXIMUM', [params.maximum, componentId]);
+ throw rf.csv.getMessage(msg, 'DOUBLE_RANGE_VALIDATOR_MAXIMUM', [params.maximum, componentId]);
}
}
if (isMinSet && value < params.minimum) {
if (isMaxSet) {
- throw rf.csv.getMessage(params.m, 'DOUBLE_RANGE_VALIDATOR_NOT_IN_RANGE', [params.minimum, params.maximum, componentId]);
+ throw rf.csv.getMessage(msg, 'DOUBLE_RANGE_VALIDATOR_NOT_IN_RANGE', [params.minimum, params.maximum, componentId]);
} else {
- throw rf.csv.getMessage(params.m, 'DOUBLE_RANGE_VALIDATOR_MINIMUM', [params.minimum, componentId]);
+ throw rf.csv.getMessage(msg, 'DOUBLE_RANGE_VALIDATOR_MINIMUM', [params.minimum, componentId]);
}
}
},
- "validateLength": function (value, params) {
- if (params.maximum && value.length > params.maximum) {
- throw params.m;
+ "validateLength": function (value,label,params,msg) {
+ var isMinSet = typeof params.minimum == "number" && params.minimum >0;
+ var isMaxSet = typeof params.maximum == "number" && params.maximum >0;
+
+ if (isMaxSet && value.length > params.maximum) {
+ throw rf.csv.interpolateMessage(msg,isMinSet?[params.minimum,params.maximum,label]:[params.maximum,label]);
}
- if (params.minimum && value.length < params.minimum) {
- throw params.m
+ if (isMinSet && value.length < params.minimum) {
+ throw rf.csv.interpolateMessage(msg,isMaxSet?[params.minimum,params.maximum,label]:[params.minimum,label]);
}
},
- "validateRegex": function (value, params) {
+ "validateRegex": function (value,label,params,msg) {
if (typeof params.pattern != "string" || params.pattern.length == 0) {
- throw rf.csv.getMessage(params.m, 'REGEX_VALIDATOR_PATTERN_NOT_SET', []);
+ throw rf.csv.getMessage(msg, 'REGEX_VALIDATOR_PATTERN_NOT_SET', []);
}
var re;
try {
re = new RegExp(params.pattern);
} catch (e) {
- throw rf.csv.getMessage(params.m, 'REGEX_VALIDATOR_MATCH_EXCEPTION', []);
+ throw rf.csv.getMessage(msg, 'REGEX_VALIDATOR_MATCH_EXCEPTION', []);
}
if (!re.test(value)){
- throw rf.csv.getMessage(params.m, 'REGEX_VALIDATOR_NOT_MATCHED', [params.pattern]);
+ throw rf.csv.getMessage(msg, 'REGEX_VALIDATOR_NOT_MATCHED', [params.pattern]);
}
},
- "validateRequired": function (value, params) {
+ "validateRequired": function (value,label,params,msg) {
if (value.length==0) {
- throw rf.csv.getMessage(params.m, 'UIINPUT_REQUIRED', [componentId]);
+ throw rf.csv.getMessage(msg, 'UIINPUT_REQUIRED', [componentId]);
}
}
});
13 years, 11 months
JBoss Rich Faces SVN: r21066 - trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-01-18 20:02:11 -0500 (Tue, 18 Jan 2011)
New Revision: 21066
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
Log:
https://issues.jboss.org/browse/RF-10187
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java 2011-01-19 00:38:15 UTC (rev 21065)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java 2011-01-19 01:02:11 UTC (rev 21066)
@@ -50,7 +50,9 @@
protected static final String FIRST_ROW_CLASS_KEY = "firstRowClass";
- protected static final String CELL_CLASS_KEY = "cellClass";
+ protected static final String CELL_CLASS_KEY = "cellClass";
+
+ private static final String CELL_ELEMENT_KEY = "cellElement";
public void encodeColumn(FacesContext context, ResponseWriter writer, UIColumn component, RowHolder rowHolder) throws IOException {
String parentId = rowHolder.getParentClientId();
@@ -89,8 +91,8 @@
}
public void encodeColumnStart(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
- writer.startElement(HtmlConstants.TD_ELEM, component);
- getUtils().encodeId(context, component);
+ writer.startElement(getCellElement(context, parentId), component);
+ writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, component.getContainerClientId(context), HtmlConstants.ID_ATTRIBUTE);
String cellClass = getCellClass(context, parentId);
cellClass = concatClasses(cellClass, component.getAttributes().get(COLUMN_CLASS));
encodeStyleClass(writer, context, component, HtmlConstants.STYLE_CLASS_ATTR, cellClass);
@@ -111,7 +113,7 @@
}
public void encodeColumnEnd(ResponseWriter writer, FacesContext context, String parentId) throws IOException {
- writer.endElement(HtmlConstants.TD_ELEM);
+ writer.endElement(getCellElement(context, parentId));
}
public void encodeFirstRowStart(ResponseWriter writer, FacesContext context, String parentId, int currentRow, UIComponent component) throws IOException {
@@ -146,10 +148,20 @@
return get(context, id + CELL_CLASS_KEY);
}
- protected String getFacetElement(FacesContext context, String id, String facetName) {
- return HtmlConstants.TD_ELEM;
+ protected String getCellElement(FacesContext context, String id) {
+ String elementName = get(context, id + CELL_ELEMENT_KEY);
+
+ if (elementName == null) {
+ elementName = HtmlConstants.TD_ELEM;
+ }
+
+ return elementName;
}
+ protected void setCellElement(FacesContext context, String id, String element) {
+ put(context, id + CELL_ELEMENT_KEY, element);
+ }
+
protected void saveRowStyles(FacesContext context, String id, String firstRowClass, String rowClass, String cellClass) {
put(context, id + FIRST_ROW_CLASS_KEY, firstRowClass);
put(context, id + ROW_CLASS_KEY, rowClass);
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2011-01-19 00:38:15 UTC (rev 21065)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2011-01-19 01:02:11 UTC (rev 21066)
@@ -353,6 +353,11 @@
boolean encodeThead = containsThead();
if ((header != null && header.isRendered()) || isEncodeHeaders) {
+
+ String id = dataTable.getClientId(facesContext);
+
+ setCellElement(facesContext, id, HtmlConstants.TH_ELEM);
+
boolean partialUpdateEncoded = false;
String clientId = dataTable.getClientId(facesContext);
@@ -425,6 +430,8 @@
partialEnd(facesContext);
}
}
+
+ setCellElement(facesContext, id, null);
}
}
@@ -432,7 +439,7 @@
protected void encodeColumnFacet(FacesContext context, ResponseWriter writer, UIDataTableBase dataTableBase, String facetName, int colCount, String cellClass) throws IOException {
int tColCount = 0;
String id = dataTableBase.getClientId(context);
- String element = getFacetElement(context, id, facetName);
+ String element = getCellElement(context, id);
Iterator<UIComponent> headers = dataTableBase.columns();
@@ -480,7 +487,7 @@
UIComponent footer, String facetName, String rowClass, String cellClass, boolean encodePartialUpdate) throws IOException {
boolean isColumnGroup = (footer instanceof Row);
- String element = getFacetElement(facesContext, id, facetName);
+ String element = getCellElement(facesContext, id);
boolean partialUpdateEncoded = false;
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2011-01-19 00:38:15 UTC (rev 21065)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2011-01-19 01:02:11 UTC (rev 21066)
@@ -394,11 +394,6 @@
return "rf-dt-b";
}
- @Override
- protected String getFacetElement(FacesContext context, String id, String facetName) {
- return facetName.equals(UIDataTableBase.HEADER) ? HtmlConstants.TH_ELEM : HtmlConstants.TD_ELEM;
- }
-
public EncodeStrategy getHiddenContainerStrategy(UIDataTableBase dataTableBase) {
return new DataTableHiddenEncodeStrategy();
}
13 years, 11 months