JBoss Rich Faces SVN: r22068 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richMenuGroup and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-03-07 07:09:27 -0500 (Mon, 07 Mar 2011)
New Revision: 22068
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuGroup/TestRichMenuGroup.java
Log:
tests for drop down menu and menu group fixed
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java 2011-03-07 06:44:44 UTC (rev 22067)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDropDownMenu/TestRichDropDownMenu.java 2011-03-07 12:09:27 UTC (rev 22068)
@@ -34,6 +34,7 @@
import org.jboss.test.selenium.css.CssProperty;
import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.encapsulated.JavaScript;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.waiting.EventFiredCondition;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
@@ -82,7 +83,7 @@
assertFalse(selenium.isVisible(menuItem41), "Menu item \"Save\" should not be visible on the page.");
assertFalse(selenium.isDisplayed(groupList), "Submenu should not be expanded.");
- guardNoRequest(selenium).mouseOver(group);
+ guardNoRequest(selenium).getEval(new JavaScript("window.jQuery('" + group.getRawLocator() + "').mouseenter()"));
assertTrue(selenium.isDisplayed(groupList), "Submenu should be expanded.");
assertTrue(selenium.isElementPresent(menuItem41), "Menu item \"Save\" should be present on the page.");
@@ -119,7 +120,7 @@
selenium.waitForPageToLoad();
selenium.mouseOver(fileMenuLabel);
- selenium.mouseOut(fileMenuLabel);
+ selenium.getEval(new JavaScript("window.jQuery('" + fileMenuLabel.getRawLocator() + "').mouseleave()"));
assertTrue(selenium.isDisplayed(fileMenuList), "Menu should be expanded.");
waitFor(3000);
assertFalse(selenium.isDisplayed(fileMenuList), "Menu should not be expanded.");
@@ -181,9 +182,9 @@
selenium.waitForPageToLoad();
selenium.mouseOver(fileMenuLabel);
- selenium.mouseOver(group);
+ selenium.getEval(new JavaScript("window.jQuery('" + group.getRawLocator() + "').mouseenter()"));
waitGui.interval(2000).withDelay(true).failWith("Menu group was not opened.").until(isDisplayed.locator(groupList));
- selenium.mouseOut(group);
+ selenium.getEval(new JavaScript("window.jQuery('" + group.getRawLocator() + "').mouseleave()"));
waitGui.failWith("Attribute ongrouphide does not work correctly").until(new EventFiredCondition(new Event("grouphide")));
}
@@ -194,7 +195,7 @@
selenium.waitForPageToLoad();
selenium.mouseOver(fileMenuLabel);
- selenium.mouseOver(group);
+ selenium.getEval(new JavaScript("window.jQuery('" + group.getRawLocator() + "').mouseenter()"));
waitGui.interval(2000).withDelay(true).failWith("Menu group was not opened.").until(isDisplayed.locator(group));
waitGui.failWith("Attribute ongroupshow does not work correctly").until(new EventFiredCondition(new Event("groupshow")));
@@ -206,7 +207,7 @@
selenium.waitForPageToLoad();
selenium.mouseOver(fileMenuLabel);
- selenium.mouseOut(fileMenuLabel);
+ selenium.getEval(new JavaScript("window.jQuery('" + fileMenuLabel.getRawLocator() + "').mouseleave()"));
waitGui.failWith("Attribute onhide does not work correctly").until(new EventFiredCondition(new Event("hide")));
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuGroup/TestRichMenuGroup.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuGroup/TestRichMenuGroup.java 2011-03-07 06:44:44 UTC (rev 22067)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuGroup/TestRichMenuGroup.java 2011-03-07 12:09:27 UTC (rev 22068)
@@ -32,6 +32,7 @@
import java.net.URL;
import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.encapsulated.JavaScript;
import org.jboss.test.selenium.locator.Attribute;
import org.jboss.test.selenium.locator.AttributeLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
@@ -82,7 +83,7 @@
assertFalse(selenium.isVisible(menuItem41), "Menu item \"Save\" should not be visible on the page.");
assertFalse(selenium.isDisplayed(groupList), "Submenu should not be expanded.");
- guardNoRequest(selenium).mouseOver(group);
+ guardNoRequest(selenium).getEval(new JavaScript("window.jQuery('" + group.getRawLocator() + "').mouseenter()"));
assertTrue(selenium.isDisplayed(groupList), "Submenu should be expanded.");
assertTrue(selenium.isElementPresent(menuItem41), "Menu item \"Save\" should be present on the page.");
@@ -196,9 +197,9 @@
selenium.mouseOver(fileMenuLabel);
waitGui.failWith("Menu was not open.").until(isDisplayed.locator(fileMenuList));
- selenium.mouseOver(group);
+ selenium.getEval(new JavaScript("window.jQuery('" + group.getRawLocator() + "').mouseenter()"));
waitGui.failWith("Submenu was not open").until(isDisplayed.locator(groupList));
- selenium.mouseOut(group);
+ selenium.getEval(new JavaScript("window.jQuery('" + group.getRawLocator() + "').mouseleave()"));
waitGui.failWith("Attribute onhide does not work correctly").until(new EventFiredCondition(new Event("hide")));
}
@@ -250,7 +251,7 @@
selenium.mouseOver(fileMenuLabel);
waitGui.failWith("Menu was not open.").until(isDisplayed.locator(fileMenuList));
- selenium.mouseOver(group);
+ selenium.getEval(new JavaScript("window.jQuery('" + group.getRawLocator() + "').mouseenter()"));
waitGui.failWith("Submenu was not open").until(isDisplayed.locator(groupList));
waitGui.failWith("Attribute onhide does not work correctly").until(new EventFiredCondition(new Event("show")));
15 years, 1 month
JBoss Rich Faces SVN: r22067 - in modules/docs/trunk/Component_Reference/src/main/docbook/en-US: skinning and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2011-03-07 01:44:44 -0500 (Mon, 07 Mar 2011)
New Revision: 22067
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/tabl-richextendedDataTable.xml
Log:
Skinning reference for extendedDataTable
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2011-03-04 22:55:38 UTC (rev 22066)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2011-03-07 06:44:44 UTC (rev 22067)
@@ -1092,12 +1092,10 @@
</itemizedlist>
</section>
- <!--TODO not in CR1
<section id="sect-Component_Reference-richextendedDataTable-Style_classes_and_skin_parameters">
<title>Style classes and skin parameters</title>
<xi:include href="skinning/tabl-richextendedDataTable.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</section>
- -->
</section>
<!--<rich:dataGrid>-->
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/tabl-richextendedDataTable.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/tabl-richextendedDataTable.xml 2011-03-04 22:55:38 UTC (rev 22066)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/skinning/tabl-richextendedDataTable.xml 2011-03-07 06:44:44 UTC (rev 22067)
@@ -17,339 +17,175 @@
</row>
</thead>
<tbody>
+
<row>
- <entry>
+ <entry morerows="1">
<variablelist>
<varlistentry>
- <term><classname>.extdt-empty-cell</classname></term>
+ <term><classname>.rf-edt</classname></term>
<listitem>
<para>
- This class defines the styles for empty cells.
+ This class defines styles for the table.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry><literal>tableBorderWidth</literal>, <literal>tableBorderColor</literal></entry>
- <entry><literal>border-bottom</literal></entry>
+ <entry><para><parameter>tableBorderWidth</parameter>, <parameter>tableBorderColor</parameter></para></entry>
+ <entry><para><property>border</property></para></entry>
</row>
-
<row>
- <entry>
- <variablelist>
- <varlistentry>
- <term><classname>.extdt-table-layout</classname></term>
- <listitem>
- <para>
- This class defines the styles for the table layout.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </entry>
- <entry><literal>tableBackgroundColor</literal></entry>
- <entry><literal>background-color</literal></entry>
+ <entry><para><parameter>tableBackgroundColor</parameter></para></entry>
+ <entry><para><property>background-color</property></para></entry>
</row>
<row>
- <entry morerows="3">
- <variablelist>
- <varlistentry>
- <term><classname>.extdt-cell</classname></term>
- <listitem>
- <para>
- This class defines the styles for the table cells.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </entry>
- <entry><literal>tableBorderWidth</literal>, <literal>tableBorderColor</literal></entry>
- <entry><literal>border-right, border-bottom</literal></entry>
- </row>
- <row>
- <entry><literal>generalSizeFont</literal></entry>
- <entry><literal>font-size</literal></entry>
- </row>
- <row>
- <entry><literal>generalTextColor</literal></entry>
- <entry><literal>color</literal></entry>
- </row>
- <row>
- <entry><literal>generalFamilyFont</literal></entry>
- <entry><literal>font-family</literal></entry>
- </row>
-
- <row>
<entry>
<variablelist>
<varlistentry>
- <term><classname>.extdt-header</classname></term>
+ <term><classname>.rich-edt-hdr</classname></term>
<listitem>
<para>
- This class defines the styles for a table header row.
+ This class defines styles for a header.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry><literal>headerBackgroundColor</literal></entry>
- <entry><literal>background-color</literal></entry>
+ <entry spanname="noskin">No skin parameters.</entry>
</row>
-
+
<row>
- <entry>
- <variablelist>
- <varlistentry>
- <term><classname>.extdt-header-continue</classname></term>
- <listitem>
- <para>
- This class defines the styles for all header lines after the first.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </entry>
- <entry><literal>headerBackgroundColor</literal></entry>
- <entry><literal>background-color</literal></entry>
- </row>
-
- <row>
<entry morerows="4">
<variablelist>
<varlistentry>
- <term><classname>.extdt-headercell</classname></term>
+ <term><classname>.rf-edt-tbl-hdr</classname></term>
<listitem>
<para>
- This class defines the styles for the header cells.
+ This class defines styles for the table header.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry><literal>tableBorderWidth</literal>, <literal>tableBorderColor</literal></entry>
- <entry><literal>border-right, border-bottom</literal></entry>
+ <entry><para><parameter>tableBorderWidth</parameter>, <parameter>tableBorderColor</parameter></para></entry>
+ <entry><para><property>border-bottom</property></para></entry>
</row>
<row>
- <entry><literal>headerTextColor</literal></entry>
- <entry><literal>color</literal></entry>
+ <entry><para><parameter>tableHeaderTextColor</parameter></para></entry>
+ <entry><para><property>color</property></para></entry>
</row>
<row>
- <entry><literal>headerWeightFont</literal></entry>
- <entry><literal>font-weight</literal></entry>
+ <entry><para><parameter>generalFamilyFont</parameter></para></entry>
+ <entry><para><property>font-family</property></para></entry>
</row>
<row>
- <entry><literal>generalSizeFont</literal></entry>
- <entry><literal>font-size</literal></entry>
+ <entry><para><parameter>generalSizeFont</parameter></para></entry>
+ <entry><para><property>font-size</property></para></entry>
</row>
<row>
- <entry><literal>generalFamilyFont</literal></entry>
- <entry><literal>font-family</literal></entry>
+ <entry><para><parameter>tableHeaderTextColor</parameter></para></entry>
+ <entry><para><property>color</property></para></entry>
</row>
<row>
<entry>
<variablelist>
<varlistentry>
- <term><classname>.extdt-subheader</classname></term>
+ <term><classname>.rich-edt-b</classname></term>
<listitem>
<para>
- This class defines the styles for a column sub-header.
+ This class defines styles for the body of the table.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry><literal>additionalBackgroundColor</literal></entry>
- <entry><literal>background-color</literal></entry>
+ <entry spanname="noskin">No skin parameters.</entry>
</row>
<row>
- <entry morerows="1">
+ <entry>
<variablelist>
<varlistentry>
- <term><classname>.extdt-table-filterrow</classname></term>
+ <term><classname>.rich-edt-spcr</classname></term>
<listitem>
<para>
- This class defines the styles for the filter row.
+ This class defines a spacer for <productname>Internet Explorer 7</productname> compatibility.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry><literal>additionalBackgroundColor</literal></entry>
- <entry><literal>background-color</literal></entry>
+ <entry spanname="noskin">No skin parameters.</entry>
</row>
- <row>
- <entry><literal>tableBorderWidth</literal>, <literal>tableBorderColor</literal></entry>
- <entry><literal>border-top</literal></entry>
- </row>
<row>
- <entry morerows="3">
+ <entry morerows="1">
<variablelist>
<varlistentry>
- <term><classname>.extdt-subheadercell</classname></term>
+ <term><classname>.rich-edt-ftr</classname></term>
<listitem>
<para>
- This class defines the styles for a column sub-header cell.
+ This class defines styles for a footer.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry><literal>tableBorderWidth</literal>, <literal>tableBorderColor</literal></entry>
- <entry><literal>border-right</literal></entry>
+ <entry><para><parameter>tableBorderWidth</parameter>, <parameter>tableBorderColor</parameter></para></entry>
+ <entry><para><property>border-top</property></para></entry>
</row>
<row>
- <entry><literal>generalTextColor</literal></entry>
- <entry><literal>color</literal></entry>
+ <entry><para><parameter>tableFooterBackgroundColor</parameter></para></entry>
+ <entry><para><property>background-color</property></para></entry>
</row>
+
<row>
- <entry><literal>generalSizeFont</literal></entry>
- <entry><literal>font-size</literal></entry>
- </row>
- <row>
- <entry><literal>generalFamilyFont</literal></entry>
- <entry><literal>font-family</literal></entry>
- </row>
-
- <row>
- <entry morerows="5">
+ <entry morerows="1">
<variablelist>
<varlistentry>
- <term><classname>.extdt-caption</classname></term>
+ <term><classname>.rf-edt-tbl-ftr</classname></term>
<listitem>
<para>
- This class defines styles for a table caption.
+ This class defines styles for the table footer.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry><literal>tableBorderWidth, tableBorderColor</literal></entry>
- <entry><literal>border-right, border-bottom</literal></entry>
+ <entry><para><parameter>tableBorderWidth</parameter>, <parameter>tableBorderColor</parameter></para></entry>
+ <entry><para><property>border-top</property></para></entry>
</row>
<row>
- <entry><literal>generalTextColor</literal></entry>
- <entry><literal>color</literal></entry>
+ <entry><para><parameter>tableFooterBackgroundColor</parameter></para></entry>
+ <entry><para><property>background-color</property></para></entry>
</row>
- <row>
- <entry><literal>headerWeightFont</literal></entry>
- <entry><literal>font-weight</literal></entry>
- </row>
- <row>
- <entry><literal>generalSizeFont</literal></entry>
- <entry><literal>font-size</literal></entry>
- </row>
- <row>
- <entry><literal>generalFamilyFont</literal></entry>
- <entry><literal>font-family</literal></entry>
- </row>
- <row>
- <entry><literal>additionalBackgroundColor</literal></entry>
- <entry><literal>bakcground-color</literal></entry>
- </row>
<row>
- <entry morerows="4">
+ <entry>
<variablelist>
<varlistentry>
- <term><classname>.extdt-footercell</classname></term>
+ <term><classname>.rich-edt-ftr-fzn</classname></term>
<listitem>
<para>
- This class defines styles for a footer cell.
+ This class defines styles for a frozen footer.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry><literal>tableBorderWidth, tableBorderColor</literal></entry>
- <entry><literal>border-right, border-bottom</literal></entry>
+ <entry spanname="noskin">No skin parameters.</entry>
</row>
- <row>
- <entry><literal>generalTextColor</literal></entry>
- <entry><literal>color</literal></entry>
- </row>
- <row>
- <entry><literal>headerWeightFont</literal></entry>
- <entry><literal>font-weight</literal></entry>
- </row>
- <row>
- <entry><literal>generalSizeFont</literal></entry>
- <entry><literal>font-size</literal></entry>
- </row>
- <row>
- <entry><literal>generalFamilyFont</literal></entry>
- <entry><literal>font-family</literal></entry>
- </row>
<row>
- <entry morerows="3">
- <variablelist>
- <varlistentry>
- <term><classname>.extdt-subfooter</classname></term>
- <listitem>
- <para>
- This class defines the styles for a column footer.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </entry>
- <entry><literal>tableBorderWidth</literal>, <literal>tableBorderColor</literal></entry>
- <entry><literal>border-right</literal>, <literal>border-bottom</literal></entry>
- </row>
- <row>
- <entry><literal>generalTextColor</literal></entry>
- <entry><literal>color</literal></entry>
- </row>
- <row>
- <entry><literal>generalSizeFont</literal></entry>
- <entry><literal>font-size</literal></entry>
- </row>
- <row>
- <entry><literal>generalFamilyFont</literal></entry>
- <entry><literal>font-family</literal></entry>
- </row>
-
- <row>
- <entry morerows="3">
- <variablelist>
- <varlistentry>
- <term><classname>.extdt-subfootercell</classname></term>
- <listitem>
- <para>
- This class defines the styles for a column footer cell.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </entry>
- <entry><literal>tableBorderWidth</literal>, <literal>tableBorderColor</literal></entry>
- <entry><literal>border-right</literal>, <literal>border-bottom</literal></entry>
- </row>
- <row>
- <entry><literal>generalTextColor</literal></entry>
- <entry><literal>color</literal></entry>
- </row>
- <row>
- <entry><literal>generalSizeFont</literal></entry>
- <entry><literal>font-size</literal></entry>
- </row>
- <row>
- <entry><literal>generalFamilyFont</literal></entry>
- <entry><literal>font-family</literal></entry>
- </row>
-
- <row>
<entry>
<variablelist>
<varlistentry>
- <term><classname>.rich-extdt</classname></term>
+ <term><classname>.rich-edt-cnt</classname></term>
<listitem>
<para>
- This class defines styles for the table.
+ This class defines styles for the table content.
</para>
</listitem>
</varlistentry>
@@ -362,10 +198,10 @@
<entry>
<variablelist>
<varlistentry>
- <term><classname>.rich-extdt-caption</classname></term>
+ <term><classname>.rich-edt-ftr-cnt</classname></term>
<listitem>
<para>
- This class defines styles for a "caption" facet element.
+ This class defines styles for the content of a footer.
</para>
</listitem>
</varlistentry>
@@ -378,10 +214,10 @@
<entry>
<variablelist>
<varlistentry>
- <term><classname>.rich-extdt-header</classname></term>
+ <term><classname>.rich-edt-rsz</classname></term>
<listitem>
<para>
- This class defines styles for a table header row.
+ This class defines styles for the table resizer.
</para>
</listitem>
</varlistentry>
@@ -394,10 +230,10 @@
<entry>
<variablelist>
<varlistentry>
- <term><classname>.rich-extdt-header-continue</classname></term>
+ <term><classname>.rich-edt-rsz-cntr</classname></term>
<listitem>
<para>
- This class defines styles for all header lines after the first.
+ This class defines styles for the resize container.
</para>
</listitem>
</varlistentry>
@@ -410,42 +246,48 @@
<entry>
<variablelist>
<varlistentry>
- <term><classname>.rich-extdt-subheader</classname></term>
+ <term><classname>.rich-edt-rsz-mkr</classname></term>
<listitem>
<para>
- This class defines styles for a column sub-header.
+ This class defines styles for the resize marker.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry spanname="noskin">No skin parameters.</entry>
+ <entry><para><parameter>generalTextColor</parameter></para></entry>
+ <entry><para><property>border-left</property></para></entry>
</row>
-
+
<row>
- <entry>
+ <entry morerows="1">
<variablelist>
<varlistentry>
- <term><classname>.rich-extdt-footer</classname></term>
+ <term><classname>.rf-edt-rord</classname></term>
<listitem>
<para>
- This class defines styles for a footer row.
+ This class defines styles for the re-order functionality.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry spanname="noskin">No skin parameters.</entry>
+ <entry><para><parameter>tableBorderWidth</parameter>, <parameter>tableBorderColor</parameter></para></entry>
+ <entry><para><property>border</property></para></entry>
</row>
+ <row>
+ <entry><para><parameter>tableHeaderBackgroundColor</parameter> / <parameter>tableBackgroundColor</parameter></para></entry>
+ <entry><para><property>background-color</property></para></entry>
+ </row>
<row>
<entry>
<variablelist>
<varlistentry>
- <term><classname>.rich-extdt-footer-continue</classname></term>
+ <term><classname>.rich-edt-rord-mkr</classname></term>
<listitem>
<para>
- This class defines styles for all footer lines after the first.
+ This class defines styles for the re-order marker.
</para>
</listitem>
</varlistentry>
@@ -453,143 +295,183 @@
</entry>
<entry spanname="noskin">No skin parameters.</entry>
</row>
-
+
<row>
- <entry>
+ <entry morerows="1">
<variablelist>
<varlistentry>
- <term><classname>.rich-extdt-subfooter</classname></term>
+ <term><classname>.rf-edt-c</classname></term>
<listitem>
<para>
- This class defines styles for a column sub-footer.
+ This class defines styles for a table cell.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry spanname="noskin">No skin parameters.</entry>
+ <entry><para><parameter>tableBorderWidth</parameter>, <parameter>tableBorderColor</parameter></para></entry>
+ <entry><para><property>border-bottom</property></para></entry>
</row>
-
<row>
- <entry>
+ <entry><para><parameter>tableBorderWidth</parameter>, <parameter>tableBorderColor</parameter></para></entry>
+ <entry><para><property>border-right</property></para></entry>
+ </row>
+
+ <row>
+ <entry morerows="1">
<variablelist>
<varlistentry>
- <term><classname>.rich-extdt-headercell</classname></term>
+ <term><classname>.rf-edt-hdr-c</classname></term>
<listitem>
<para>
- This class defines styles for a header cell.
+ This class defines styles for a table header cell.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry spanname="noskin">No skin parameters.</entry>
+ <entry><para><parameter>tableBorderWidth</parameter>, <parameter>tableBorderColor</parameter></para></entry>
+ <entry><para><property>border-bottom</property></para></entry>
</row>
-
<row>
- <entry>
+ <entry><para><parameter>tableBorderWidth</parameter>, <parameter>tableBorderColor</parameter></para></entry>
+ <entry><para><property>border-right</property></para></entry>
+ </row>
+
+ <row>
+ <entry morerows="1">
<variablelist>
<varlistentry>
- <term><classname>.rich-extdt-subheadercell</classname></term>
+ <term><classname>.rf-edt-ftr-c</classname></term>
<listitem>
<para>
- This class defines styles for a sub-header cell.
+ This class defines styles for a table footer cell.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry spanname="noskin">No skin parameters.</entry>
+ <entry><para><parameter>tableBorderWidth</parameter>, <parameter>tableBorderColor</parameter></para></entry>
+ <entry><para><property>border-bottom</property></para></entry>
</row>
-
<row>
+ <entry><para><parameter>tableBorderWidth</parameter>, <parameter>tableBorderColor</parameter></para></entry>
+ <entry><para><property>border-right</property></para></entry>
+ </row>
+
+ <row>
<entry>
<variablelist>
<varlistentry>
- <term><classname>.rich-extdt-cell</classname></term>
+ <term><classname>.rf-edt-ftr-emp</classname></term>
<listitem>
<para>
- This class defines styles for a table cell.
+ This class defines styles for an empty footer cell.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry spanname="noskin">No skin parameters.</entry>
+ <entry><para><parameter>tableBorderWidth</parameter>, <parameter>tableBorderColor</parameter></para></entry>
+ <entry><para><property>border-right</property></para></entry>
</row>
-
+
<row>
- <entry>
+ <entry morerows="1">
<variablelist>
<varlistentry>
- <term><classname>.rich-extdt-row</classname></term>
+ <term><classname>.rf-edt-c-cnt</classname></term>
<listitem>
<para>
- This class defines styles for a table row.
+ This class defines styles for the contents of a cell.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry spanname="noskin">No skin parameters.</entry>
+ <entry><para><parameter>generalFamilyFont</parameter></para></entry>
+ <entry><para><property>font-family</property></para></entry>
</row>
-
<row>
- <entry>
+ <entry><para><parameter>generalSizeFont</parameter></para></entry>
+ <entry><para><property>font-size</property></para></entry>
+ </row>
+
+ <row>
+ <entry morerows="2">
<variablelist>
<varlistentry>
- <term><classname>.rich-extdt-firstrow</classname></term>
+ <term><classname>.rf-edt-hdr-c-cnt</classname></term>
<listitem>
<para>
- This class defines styles for a table's first row.
+ This class defines styles for the contents of a header cell.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry spanname="noskin">No skin parameters.</entry>
+ <entry><para><parameter>generalFamilyFont</parameter></para></entry>
+ <entry><para><property>font-family</property></para></entry>
</row>
-
<row>
- <entry>
+ <entry><para><parameter>generalSizeFont</parameter></para></entry>
+ <entry><para><property>font-size</property></para></entry>
+ </row>
+ <row>
+ <entry><para><parameter>tableHeaderTextColor</parameter></para></entry>
+ <entry><para><property>color</property></para></entry>
+ </row>
+
+ <row>
+ <entry morerows="2">
<variablelist>
<varlistentry>
- <term><classname>.rich-extdt-footercell</classname></term>
+ <term><classname>.rf-edt-ftr-c-cnt</classname></term>
<listitem>
<para>
- This class defines styles for a footer cell.
+ This class defines styles for the contents of a footer cell.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry spanname="noskin">No skin parameters.</entry>
+ <entry><para><parameter>generalFamilyFont</parameter></para></entry>
+ <entry><para><property>font-family</property></para></entry>
</row>
-
<row>
+ <entry><para><parameter>generalSizeFont</parameter></para></entry>
+ <entry><para><property>font-size</property></para></entry>
+ </row>
+ <row>
+ <entry><para><parameter>generalTextColor</parameter></para></entry>
+ <entry><para><property>color</property></para></entry>
+ </row>
+
+ <row>
<entry>
<variablelist>
<varlistentry>
- <term><classname>.rich-extdt-subfootercell</classname></term>
+ <term><classname>.rf-edt-r-sel</classname></term>
<listitem>
<para>
- This class defines styles for a sub-footer cell.
+ This class defines styles for the selected row.
</para>
</listitem>
</varlistentry>
</variablelist>
</entry>
- <entry spanname="noskin">No skin parameters.</entry>
+ <entry><para><parameter>tableBorderWidth</parameter>, <parameter>tableBorderColor</parameter></para></entry>
+ <entry><para><property>border-right</property></para></entry>
</row>
<row>
<entry>
<variablelist>
<varlistentry>
- <term><classname>.rich-extdt-group-cell</classname></term>
+ <term><classname>.rich-edt-r-act</classname></term>
<listitem>
<para>
- This class defines styles for a grouping row cell.
+ This class defines styles for the active row.
</para>
</listitem>
</varlistentry>
@@ -597,6 +479,7 @@
</entry>
<entry spanname="noskin">No skin parameters.</entry>
</row>
+
</tbody>
</tgroup>
</table>
15 years, 1 month
JBoss Rich Faces SVN: r22066 - in branches/4.0.X: examples/validator-demo/src/main/java/org/richfaces/example and 12 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2011-03-04 17:55:38 -0500 (Fri, 04 Mar 2011)
New Revision: 22066
Added:
branches/4.0.X/examples/validator-demo/src/main/java/org/richfaces/example/PasswordValidationBean.java
branches/4.0.X/examples/validator-demo/src/main/webapp/examples/passwordValidation.xhtml
branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.richfaces.showcase/
branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.richfaces.showcase/test.xhtml
branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.richfaces.showcase/test1.xhtml
branches/4.0.X/examples/validator-demo/src/main/webapp/richfaces/
branches/4.0.X/examples/validator-demo/src/main/webapp/richfaces/graphValidator/
branches/4.0.X/examples/validator-demo/src/main/webapp/richfaces/graphValidator/samples/
Removed:
branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/validator/ClonedObjectResolver.java
Modified:
branches/4.0.X/examples/template/src/main/webapp/layout/pagesList.xhtml
branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/el/ValueDescriptor.java
branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/el/ValueExpressionAnalayser.java
branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/validator/GraphValidatorState.java
branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/component/AbstractGraphValidator.java
branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/el/CapturingELContext.java
branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/el/ValueExpressionAnalayserImpl.java
branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java
branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/ELTestBase.java
branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureEL.java
branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java
Log:
Nick's code reviewed.
RESOLVED - issue RF-10610: BeanValidator ignores javax.faces.el.CompositeComponentExpressionHolder
https://issues.jboss.org/browse/RF-10610
https://issues.jboss.org/browse/RF-10456
Modified: branches/4.0.X/examples/template/src/main/webapp/layout/pagesList.xhtml
===================================================================
--- branches/4.0.X/examples/template/src/main/webapp/layout/pagesList.xhtml 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/examples/template/src/main/webapp/layout/pagesList.xhtml 2011-03-04 22:55:38 UTC (rev 22066)
@@ -8,7 +8,7 @@
<h:form>
<h:dataTable value="#{pages.xhtmlPages}" var="page">
<h:column>
- <h:outputLink value="#{page.url}" >#{page.title}</h:outputLink>
+ <h:outputLink value="#{page.url}" ><h:outputText value="#{page.title}" escape="false"/></h:outputLink>
</h:column>
</h:dataTable>
</h:form>
Added: branches/4.0.X/examples/validator-demo/src/main/java/org/richfaces/example/PasswordValidationBean.java
===================================================================
--- branches/4.0.X/examples/validator-demo/src/main/java/org/richfaces/example/PasswordValidationBean.java (rev 0)
+++ branches/4.0.X/examples/validator-demo/src/main/java/org/richfaces/example/PasswordValidationBean.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -0,0 +1,49 @@
+package org.richfaces.example;
+
+import java.io.Serializable;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import javax.faces.context.FacesContext;
+import javax.validation.constraints.AssertTrue;
+import javax.validation.constraints.Size;
+
+@ManagedBean
+@SessionScoped
+public class PasswordValidationBean implements Cloneable, Serializable{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1952428504080910113L;
+ @Size(min = 5, max = 15, message = "Wrong size for password")
+ private String password="";
+ @Size(min = 5, max = 15, message = "Wrong size for confirmation")
+ private String confirm="";
+
+ @AssertTrue(message = "Different passwords entered!")
+ public boolean isPasswordsEquals() {
+ return password.equals(confirm);
+ }
+
+ public void storeNewPassword() {
+ FacesContext.getCurrentInstance().addMessage(null,
+ new FacesMessage(FacesMessage.SEVERITY_INFO, "Succesfully changed!", "Succesfully changed!"));
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public void setConfirm(String confirm) {
+ this.confirm = confirm;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public String getConfirm() {
+ return confirm;
+ }
+}
Property changes on: branches/4.0.X/examples/validator-demo/src/main/java/org/richfaces/example/PasswordValidationBean.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/4.0.X/examples/validator-demo/src/main/webapp/examples/passwordValidation.xhtml
===================================================================
--- branches/4.0.X/examples/validator-demo/src/main/webapp/examples/passwordValidation.xhtml (rev 0)
+++ branches/4.0.X/examples/validator-demo/src/main/webapp/examples/passwordValidation.xhtml 2011-03-04 22:55:38 UTC (rev 22066)
@@ -0,0 +1,91 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition 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:rich="http://richfaces.org/csv"
+ xmlns:rc="http://java.sun.com/jsf/composite/org.richfaces.showcase"
+ template="/layout/template.xhtml">
+ <ui:param name="title" value="<csv:graphValidator> password validation" />
+ <!-- Page header -->
+ <ui:define name="header">
+ <style>
+.red {
+ color: red;
+}
+
+.green {
+ color: green;
+}
+</style>
+ <h1><csv:graphValidator> usage, password validation</h1>
+ </ui:define>
+ <!-- content -->
+ <ui:define name="content">
+ <h:panelGrid columns="2">
+ <f:facet name="head">
+ <h:outputText value="Actual values in the model"/>
+ </f:facet>
+ <h:outputText value="Password:"/><h:outputText value="#{passwordValidationBean.password}"/>
+ <h:outputText value="Confirmation:"/><h:outputText value="#{passwordValidationBean.confirm}"/>
+ </h:panelGrid>
+ <h:form>
+ Simple
+ <rich:graphValidator value="#{passwordValidationBean}" id="gv">
+ <rich:messages />
+ <h:panelGrid columns="3">
+ <h:outputText value="Enter new password:" />
+ <h:inputSecret value="#{passwordValidationBean.password}"
+ id="pass" />
+ <rich:message for="pass" />
+ <h:outputText value="Confirm the new password:" />
+ <h:inputSecret value="#{passwordValidationBean.confirm}" id="conf" />
+ <rich:message for="conf" />
+ </h:panelGrid>
+
+ <!--
+ <rc:test password="#{passwordValidationBean.password}" confirmation="#{passwordValidationBean.confirm}" />
+ <rc:test1 bean="#{passwordValidationBean}" />
+ -->
+
+
+ <h:commandButton value="Store changes"
+ action="#{passwordValidationBean.storeNewPassword}" />
+ </rich:graphValidator>
+ </h:form>
+ <hr />
+ <h:form>
+ Test
+ <rich:graphValidator value="#{passwordValidationBean}" id="gv">
+ <rich:messages />
+ <rc:test password="#{passwordValidationBean.password}"
+ confirmation="#{passwordValidationBean.confirm}" />
+
+
+ <h:commandButton value="Store changes"
+ action="#{passwordValidationBean.storeNewPassword}" />
+ </rich:graphValidator>
+ </h:form>
+ <hr />
+ <h:form>
+ Test A
+ <rich:graphValidator value="#{passwordValidationBean}" id="gv">
+ <rich:messages />
+ <rc:test />
+
+ <h:commandButton value="Store changes"
+ action="#{passwordValidationBean.storeNewPassword}" />
+ </rich:graphValidator>
+ </h:form>
+ <hr />
+ <h:form>
+ Test1
+ <rich:graphValidator value="#{passwordValidationBean}" id="gv">
+ <rich:messages />
+ <rc:test1 bean="#{passwordValidationBean}" />
+ <h:commandButton value="Store changes"
+ action="#{passwordValidationBean.storeNewPassword}" />
+ </rich:graphValidator>
+ </h:form>
+ </ui:define>
+</ui:composition>
\ No newline at end of file
Property changes on: branches/4.0.X/examples/validator-demo/src/main/webapp/examples/passwordValidation.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.richfaces.showcase/test.xhtml
===================================================================
--- branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.richfaces.showcase/test.xhtml (rev 0)
+++ branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.richfaces.showcase/test.xhtml 2011-03-04 22:55:38 UTC (rev 22066)
@@ -0,0 +1,30 @@
+<!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:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:composite="http://java.sun.com/jsf/composite"
+ xmlns:rich="http://richfaces.org/csv"
+ >
+<head>
+<title>panel</title>
+</head>
+<body>
+
+<composite:interface>
+</composite:interface>
+
+<composite:implementation>
+ <h:panelGrid columns="3">
+ <h:outputText value="Enter new password:" />
+ <h:inputSecret value="#{cc.attrs.password}" id="pass" />
+ <rich:message for="pass" />
+ <h:outputText value="Confirm the new password:" />
+ <h:inputSecret value="#{cc.attrs.confirmation}" id="conf" />
+ <rich:message for="conf" />
+ </h:panelGrid>
+</composite:implementation>
+</body>
+</html>
Property changes on: branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.richfaces.showcase/test.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.richfaces.showcase/test1.xhtml
===================================================================
--- branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.richfaces.showcase/test1.xhtml (rev 0)
+++ branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.richfaces.showcase/test1.xhtml 2011-03-04 22:55:38 UTC (rev 22066)
@@ -0,0 +1,40 @@
+<!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:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:composite="http://java.sun.com/jsf/composite"
+ xmlns:rich="http://richfaces.org/csv"
+ >
+<head>
+<title>panel</title>
+</head>
+<body>
+
+<composite:interface>
+ <composite:valueHolder targets="pass,conf" name="xxx" />
+</composite:interface>
+
+<composite:implementation>
+ #{cc.attrs.bean} a
+ <h:panelGrid columns="2">
+ <f:facet name="head">
+ <h:outputText value="Actual values in the model"/>
+ </f:facet>
+ <h:outputText value="Password:"/><h:outputText value="#{cc.attrs.bean.password}"/>
+ <h:outputText value="Confirmation:"/><h:outputText value="#{cc.attrs.bean.confirm}"/>
+ </h:panelGrid>
+
+ <h:panelGrid columns="3">
+ <h:outputText value="Enter new password:" />
+ <h:inputSecret value="#{cc.attrs.bean.password}" id="pass" />
+ <rich:message for="pass" />
+ <h:outputText value="Confirm the new password:" />
+ <h:inputSecret value="#{cc.attrs.bean.confirm}" id="conf" />
+ <rich:message for="conf" />
+ </h:panelGrid>
+</composite:implementation>
+</body>
+</html>
Property changes on: branches/4.0.X/examples/validator-demo/src/main/webapp/resources/org.richfaces.showcase/test1.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/el/ValueDescriptor.java
===================================================================
--- branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/el/ValueDescriptor.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/el/ValueDescriptor.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -14,24 +14,17 @@
private final Class<?> beanType;
- private final Class<?> propertyType;
-
/**
* @param beanType
* @param name
* @param propertyType
* @param readOnly
*/
- public ValueDescriptor(Class<?> beanType, String name, Class<?> propertyType) {
+ public ValueDescriptor(Class<?> beanType, String name) {
this.beanType = beanType;
this.name = name;
- this.propertyType = propertyType;
}
- public ValueDescriptor(Class<?> beanType, String name) {
- this(beanType,name,Object.class);
- }
-
/**
* @return the name
*/
@@ -47,13 +40,6 @@
return beanType;
}
- /**
- * @return the propertyType
- */
- public Class<?> getPropertyType() {
- return propertyType;
- }
-
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
Modified: branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/el/ValueExpressionAnalayser.java
===================================================================
--- branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/el/ValueExpressionAnalayser.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/el/ValueExpressionAnalayser.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -3,6 +3,7 @@
*/
package org.richfaces.el;
+import javax.el.ELException;
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
@@ -13,6 +14,8 @@
*/
public interface ValueExpressionAnalayser {
- ValueDescriptor getPropertyDescriptor(FacesContext context, ValueExpression expression);
+ ValueDescriptor getPropertyDescriptor(FacesContext context, ValueExpression expression) throws ELException;
+ ValueDescriptor updateValueAndGetPropertyDescriptor(FacesContext context, ValueExpression expression, Object newValue) throws ELException;
+
}
Modified: branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/validator/GraphValidatorState.java
===================================================================
--- branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/validator/GraphValidatorState.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/api/src/main/java/org/richfaces/validator/GraphValidatorState.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -1,12 +1,21 @@
package org.richfaces.validator;
+import java.util.IdentityHashMap;
+import java.util.Map;
+import javax.faces.context.FacesContext;
+
+
public final class GraphValidatorState {
- public static final String STATE_ATTRIBUTE_PREFIX = "org.richfaces.GraphValidator:";
- boolean active = false;
- Object cloned;
- Object base;
- Object property;
+ public static final String STATE_ATTRIBUTE = "org.richfaces.GraphValidator:";
+ private boolean active = false;
+ private final Object cloned;
+
+
+ public GraphValidatorState(Object cloned) {
+ this.cloned = cloned;
+ }
+
/**
* @return the active
*/
@@ -29,57 +38,28 @@
return cloned;
}
- /**
- * @param cloned
- * the cloned to set
- */
- public void setCloned(Object cloned) {
- this.cloned = cloned;
+ public static Object getActiveClone(FacesContext context,Object base){
+ GraphValidatorState state = getState(context, base);
+ if(null == state || !state.isActive()){
+ return null;
+ }
+ return state.getCloned();
}
- /**
- * @return the base
- */
- public Object getBase() {
- return base;
+ public static GraphValidatorState getState(FacesContext context,Object base){
+ return getStateMap(context).get(base);
}
- /**
- * @param base
- * the base to set
- */
- public void setBase(Object base) {
- this.base = base;
+ public static void setState(FacesContext context,Object base,GraphValidatorState state){
+ getStateMap(context).put(base, state);
}
-
- /**
- * @return the property
- */
- public Object getProperty() {
- return property;
- }
-
- /**
- * @param property
- * the property to set
- */
- public void setProperty(Object property) {
- this.property = property;
- }
-
- public boolean isSameBase(Object base) {
- return (null == base && null == this.base) || (base == this.base);
- }
-
- public boolean isSameProperty(Object property) {
- if (null == this.property) {
- return null == property;
- } else {
- return this.property.equals(property);
+
+ private static Map<Object, GraphValidatorState> getStateMap(FacesContext context){
+ IdentityHashMap<Object, GraphValidatorState> statesMap = (IdentityHashMap<Object, GraphValidatorState>) context.getAttributes().get(STATE_ATTRIBUTE);
+ if(null == statesMap){
+ statesMap = new IdentityHashMap<Object, GraphValidatorState>();
+ context.getAttributes().put(STATE_ATTRIBUTE, statesMap);
}
+ return statesMap;
}
-
- public boolean isSame(Object base, Object property) {
- return isSameBase(base) && isSameProperty(property) && active;
- }
}
\ No newline at end of file
Modified: branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/component/AbstractGraphValidator.java
===================================================================
--- branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/component/AbstractGraphValidator.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/component/AbstractGraphValidator.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -25,7 +25,6 @@
import java.lang.reflect.Modifier;
import java.util.Collection;
-import javax.el.ELContext;
import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
@@ -38,8 +37,6 @@
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
-import org.richfaces.el.CapturingELResolver;
-import org.richfaces.el.ELContextWrapper;
import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
import org.richfaces.validator.BeanValidatorService;
@@ -122,38 +119,26 @@
@Override
public void processDecodes(FacesContext context) {
GraphValidatorState validatorState = null;
- // Detect value EL-expression.
- ValueExpression valueExpression = getValueExpression("value");
- if (null != valueExpression) {
-
- Object value = getValue();
- if (null != value && value instanceof Cloneable) {
+ boolean wasActive = false;
+ Object value = getValue();
+ if (null != value) {
+ validatorState = GraphValidatorState.getState(context, value);
+ if (null != validatorState) {
+ // Reuse old value, if any.
+ wasActive = validatorState.isActive();
+ validatorState.setActive(true);
+ } else if (value instanceof Cloneable) {
try {
- ELContext initialELContext = context.getELContext();
-
- CapturingELResolver capturingELResolver = new CapturingELResolver(initialELContext.getELResolver());
- Class<?> type =
- valueExpression.getType(new ELContextWrapper(initialELContext, capturingELResolver));
- if (null != type) {
- validatorState = new GraphValidatorState();
- Method method = getCloneMethod(value.getClass());
- if (!Modifier.isPublic(method.getModifiers())) {
- // Method Object#clone() is protected by default. Make it public
- // unless developer did it.
- method.setAccessible(true);
- }
- validatorState.setCloned(method.invoke(value));
- validatorState.setBase(capturingELResolver.getBase());
- validatorState.setProperty(capturingELResolver.getProperty());
- validatorState.setActive(true);
- context.getExternalContext().getRequestMap().put(getStateId(context), validatorState);
- }
+ Method method = getCloneMethod(value.getClass());
+ validatorState = new GraphValidatorState(method.invoke(value));
+ validatorState.setActive(true);
+ GraphValidatorState.setState(context, value, validatorState);
} catch (NoSuchMethodException e) {
- // do nothing, that is really not possible.
+ // do nothing, that is really not possible - clone() impemented in Object.
} catch (InvocationTargetException e) {
throw new FacesException(e);
} catch (IllegalArgumentException e) {
- // do nothing, that is really not possible.
+ // do nothing, that is really not possible - method has no arguments.
} catch (IllegalAccessException e) {
throw new FacesException(e);
}
@@ -161,7 +146,7 @@
}
super.processDecodes(context);
if (null != validatorState) {
- validatorState.setActive(false);
+ validatorState.setActive(wasActive);
}
}
@@ -170,41 +155,57 @@
return clazz.getDeclaredMethod("clone");
} catch (NoSuchMethodException e) {
if (null != clazz.getSuperclass()) {
- return getCloneMethod(clazz.getSuperclass());
+ Method method = getCloneMethod(clazz.getSuperclass());
+ if (!Modifier.isPublic(method.getModifiers())) {
+ // Method Object#clone() is protected by default. Make it public
+ // unless developer did it.
+ method.setAccessible(true);
+ }
+ return method;
} else {
throw e;
}
}
}
- protected String getStateId(FacesContext context) {
- String stateId = GraphValidatorState.STATE_ATTRIBUTE_PREFIX + getClientId(context);
- return stateId;
- }
protected GraphValidatorState getValidatorState(FacesContext context) {
- return (GraphValidatorState) context.getExternalContext().getRequestMap().get(getStateId(context));
+ Object value = getValue();
+ if (null != value) {
+ return GraphValidatorState.getState(context, value);
+ } else {
+ return null;
+ }
}
@Override
public void processValidators(FacesContext context) {
GraphValidatorState validatorState = getValidatorState(context);
if (null != validatorState) {
+ boolean wasActive = validatorState.isActive();
validatorState.setActive(true);
+ super.processValidators(context);
+ validatorState.setActive(wasActive);
+ if(!context.isValidationFailed()){
+ validateObject(context, validatorState.getCloned());
+ }
+ } else {
+ super.processValidators(context);
}
- super.processValidators(context);
- if (null != validatorState) {
- validatorState.setActive(false);
- validateObject(context, validatorState.getCloned());
- context.getExternalContext().getRequestMap().remove(getStateId(context));
- }
}
@Override
public void processUpdates(FacesContext context) {
super.processUpdates(context);
- Object value = getValue();
- validateObject(context, value);
+ // Validate updated object if it was not done on clone.
+ if (!context.isValidationFailed()) {
+ Object value = getValue();
+ if (null != value) {
+ if (null == GraphValidatorState.getState(context, value)) {
+ validateObject(context, value);
+ }
+ }
+ }
}
private void validateObject(FacesContext context, Object value) {
Modified: branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/el/CapturingELContext.java
===================================================================
--- branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/el/CapturingELContext.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/el/CapturingELContext.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -4,14 +4,21 @@
package org.richfaces.el;
import java.beans.FeatureDescriptor;
+import java.util.Collection;
import java.util.Iterator;
import java.util.Locale;
+import java.util.Map;
import javax.el.ELContext;
import javax.el.ELResolver;
import javax.el.FunctionMapper;
+import javax.el.ValueExpression;
import javax.el.VariableMapper;
+import javax.faces.context.FacesContext;
+import javax.faces.el.CompositeComponentExpressionHolder;
+import org.richfaces.validator.GraphValidatorState;
+
/**
* This class wraps original ELContext and capture whole call stack to the target object so it could be used to extract
* semantic information like annotations or Jena Model properties.
@@ -36,6 +43,37 @@
return reference;
}
+ private boolean isContainerObject(Object base) {
+ return base instanceof Collection || base instanceof Map || base.getClass().isArray();
+ }
+
+ public boolean hasReferenceExpression() {
+ return reference != null && reference.getBase() instanceof CompositeComponentExpressionHolder;
+ }
+
+ public ValueExpression getReferenceExpression() {
+ CompositeComponentExpressionHolder expressionHolder = (CompositeComponentExpressionHolder) reference.getBase();
+ return expressionHolder.getExpression(reference.getProperty().toString());
+ }
+
+ public ValueDescriptor getDescriptor() {
+ ValueReference localReference = reference;
+
+ while (true) {
+ if (localReference == null || localReference.getBase() == null || localReference.getProperty() == null) {
+ return null;
+ }
+
+ Object base = localReference.getBase();
+
+ if (isContainerObject(base) && localReference.hasNext()) {
+ localReference = localReference.next();
+ } else {
+ return new ValueDescriptor(base.getClass(), localReference.getProperty().toString());
+ }
+ }
+ }
+
/*
* (non-Javadoc)
*
@@ -88,6 +126,7 @@
private final class InterceptingResolver extends ELResolver {
private ELResolver delegate;
+ private boolean clonedObject;
public InterceptingResolver(ELResolver delegate) {
this.delegate = delegate;
@@ -97,6 +136,11 @@
@Override
public void setValue(ELContext context, Object base, Object property, Object value) {
if (base != null) {
+ // TODO - detect value object from inderect references ( e.g. data table variables ).
+ if (this.clonedObject) {
+ delegate.setValue(context, base, property, value);
+ }
+
context.setPropertyResolved(true);
reference = new ValueReference(base, property, reference);
}
@@ -107,7 +151,16 @@
@Override
public Object getValue(ELContext context, Object base, Object property) {
reference = new ValueReference(base, property, reference);
- return delegate.getValue(context, base, property);
+ Object value = delegate.getValue(context, base, property);
+ if (null != value && context.isPropertyResolved()) {
+ FacesContext facesContext = (FacesContext) context.getContext(FacesContext.class);
+ Object clone = GraphValidatorState.getActiveClone(facesContext, value);
+ if (null != clone) {
+ this.clonedObject = true;
+ return clone;
+ }
+ }
+ return value;
}
@Override
Modified: branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/el/ValueExpressionAnalayserImpl.java
===================================================================
--- branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/el/ValueExpressionAnalayserImpl.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/el/ValueExpressionAnalayserImpl.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -1,25 +1,96 @@
package org.richfaces.el;
+import javax.el.ELContext;
import javax.el.ELException;
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
public class ValueExpressionAnalayserImpl implements ValueExpressionAnalayser {
- public ValueDescriptor getPropertyDescriptor(FacesContext context, ValueExpression expression) throws ELException {
- if(null == context || null == expression){
- throw new NullPointerException();
+ private abstract static class ValueResolutionCommand {
+
+ private ValueDescriptor valueDescriptor;
+
+ public ValueDescriptor getValueDescriptor() {
+ return valueDescriptor;
}
- CapturingELContext capturingContext = new CapturingELContext(context.getELContext());
- Class<?> type = expression.getType(capturingContext);
- ValueReference reference = capturingContext.getReference();
- if(null != reference && null != reference.getBase() && null != reference.getProperty()){
- // TODO - detect arrays, maps and lists. Check JSF implementation code - seems that Mojarra dosn't validate such fields.
- ValueDescriptor descriptor = new ValueDescriptor(reference.getBase().getClass(),reference.getProperty().toString(),type);
- return descriptor;
- } else {
- throw new ELException("Cannot determine property for expression "+expression.getExpressionString());
+
+ void setValueDescriptor(ValueDescriptor valueDescriptor) {
+ this.valueDescriptor = valueDescriptor;
}
+
+ public abstract void resolve(ValueExpression expression, ELContext context);
+
}
+
+ private static final class GetTypeCommand extends ValueResolutionCommand {
+ @Override
+ public void resolve(ValueExpression expression, ELContext context) {
+ expression.getType(context);
+ }
+ }
+
+ private static final class SetValueCommand extends ValueResolutionCommand {
+
+ private Object value;
+
+ public SetValueCommand(Object value) {
+ super();
+ this.value = value;
+ }
+
+ @Override
+ public void resolve(ValueExpression expression, ELContext context) {
+ expression.setValue(context, value);
+ }
+
+ }
+
+ private void checkNotNull(FacesContext context, ValueExpression expression) {
+ if (context == null) {
+ throw new NullPointerException("facesContext");
+ }
+
+ if (expression == null) {
+ throw new NullPointerException("expression");
+ }
+ }
+
+ private void resolveValue(FacesContext context, ValueExpression initialExpression, ValueResolutionCommand command) throws ELException {
+ checkNotNull(context, initialExpression);
+
+ ValueExpression expression = initialExpression;
+
+ while (expression != null) {
+ CapturingELContext capturingContext = new CapturingELContext(context.getELContext());
+ command.resolve(expression, capturingContext);
+
+ if (capturingContext.hasReferenceExpression()) {
+ expression = capturingContext.getReferenceExpression();
+ } else {
+ ValueDescriptor result = capturingContext.getDescriptor();
+
+ if (result == null) {
+ throw new ELException("Cannot determine property for expression " + initialExpression.getExpressionString());
+ }
+
+ command.setValueDescriptor(result);
+ break;
+ }
+ }
+ }
+
+ public ValueDescriptor getPropertyDescriptor(FacesContext context, ValueExpression expression) throws ELException {
+ ValueResolutionCommand command = new GetTypeCommand();
+ resolveValue(context, expression, command);
+ return command.getValueDescriptor();
+ }
+
+ public ValueDescriptor updateValueAndGetPropertyDescriptor(FacesContext context, ValueExpression expression, Object newValue) throws ELException {
+ ValueResolutionCommand command = new SetValueCommand(newValue);
+ resolveValue(context, expression, command);
+ return command.getValueDescriptor();
+ }
+
}
Modified: branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java
===================================================================
--- branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -3,23 +3,17 @@
*/
package org.richfaces.validator;
-import java.beans.FeatureDescriptor;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.EmptyStackException;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
-import java.util.Stack;
-import javax.el.ELContext;
import javax.el.ELException;
-import javax.el.ELResolver;
import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
@@ -30,7 +24,6 @@
import javax.validation.metadata.ElementDescriptor.ConstraintFinder;
import javax.validation.metadata.PropertyDescriptor;
-import org.richfaces.el.ELContextWrapper;
import org.richfaces.el.ValueDescriptor;
import org.richfaces.el.ValueExpressionAnalayser;
@@ -64,6 +57,11 @@
Class<?>... groups) {
try {
ValueDescriptor propertyDescriptor = analayser.getPropertyDescriptor(context, expression);
+
+ if (propertyDescriptor == null) {
+ return Collections.emptySet();
+ }
+
return processBeanAttribute(context, propertyDescriptor, groups);
} catch (ELException e) {
return Collections.emptySet();
@@ -147,66 +145,36 @@
public Collection<String> validateExpression(FacesContext context, ValueExpression expression, Object newValue,
Class<?>... groups) {
+
if (null == context) {
throw new FacesException(INPUT_PARAMETERS_IS_NOT_CORRECT);
}
- Collection<String> validationMessages = Collections.emptySet();
+
+ Collection<String> validationMessages = null;
if (null != expression) {
- ELContext elContext = context.getELContext();
- ValidationResolver validationResolver =
- createValidationResolver(context, elContext.getELResolver(), groups);
- ELContextWrapper wrappedElContext = new ELContextWrapper(elContext, validationResolver);
+ ValueDescriptor valueDescriptor;
try {
- expression.setValue(wrappedElContext, newValue);
+ valueDescriptor = analayser.updateValueAndGetPropertyDescriptor(context, expression, newValue);
} catch (ELException e) {
throw new FacesException(e);
}
- if (!validationResolver.isValid()) {
- validationMessages = validationResolver.getValidationMessages();
+
+ if (valueDescriptor != null) {
+ validationMessages = validate(context, valueDescriptor.getBeanType(), valueDescriptor.getName(), newValue, groups);
}
+
}
+
+ if (validationMessages == null) {
+ validationMessages = Collections.emptySet();
+ }
+
return validationMessages;
}
- protected ValidationResolver createValidationResolver(FacesContext context, ELResolver parent, Class<?>[] groups) {
- return new ValidationResolver(parent, context, groups);
- }
/**
- * @author asmirnov
- *
- */
- protected static class BasePropertyPair {
- private final Object base;
- private final Object property;
-
- /**
- * @param base
- * @param property
- */
- public BasePropertyPair(Object base, Object property) {
- this.base = base;
- this.property = property;
- }
-
- /**
- * @return the base
- */
- public Object getBase() {
- return base;
- }
-
- /**
- * @return the property
- */
- public Object getProperty() {
- return property;
- }
-
- }
-
- /**
* Class for identify validator instance by locale
*
* @author amarkhel
@@ -277,165 +245,13 @@
}
- /**
- * Wrapper class for a {@link ELResolver}. For a setValue method, perform validation instead of real assignment.
- *
- * @author asmirnov
- *
- */
- final class ValidationResolver extends ELResolver {
- /**
- * Original resolver.
- */
- private final ELResolver parent;
-
- private boolean valid = true;
-
- private Collection<String> validationMessages = null;
-
- private Stack<BasePropertyPair> valuesStack;
-
- private Class<?>[] groups;
-
- private FacesContext facesContext;
-
- private boolean clonedObject = false;
-
- /**
- * @param parent
- * @param context
- */
- public ValidationResolver(ELResolver parent, FacesContext context, Class<?>[] groups) {
- this.parent = parent;
- this.valuesStack = new Stack<BasePropertyPair>();
- this.groups = groups;
- this.facesContext = context;
- }
-
- public boolean isValid() {
- return valid;
- }
-
- /**
- * @param context
- * @param base
- * @return
- * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELContext, java.lang.Object)
- */
- public Class<?> getCommonPropertyType(ELContext context, Object base) {
- return parent.getCommonPropertyType(context, base);
- }
-
- /**
- * @param context
- * @param base
- * @return
- * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELContext, java.lang.Object)
- */
- public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
- return parent.getFeatureDescriptors(context, base);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#getType(javax.el.ELContext, java.lang.Object, java.lang.Object)
- */
- public Class<?> getType(ELContext context, Object base, Object property) {
- return parent.getType(context, base, property);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#getValue(javax.el.ELContext, java.lang.Object, java.lang.Object)
- */
- public Object getValue(ELContext context, Object base, Object property) {
- Object value = ClonedObjectResolver.resolveCloned(context, base, property);
- if (null != value) {
- this.clonedObject = true;
- context.setPropertyResolved(true);
- } else {
- value = parent.getValue(context, base, property);
- }
- valuesStack.push(new BasePropertyPair(base, property));
- return value;
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext, java.lang.Object, java.lang.Object)
- */
- public boolean isReadOnly(ELContext context, Object base, Object property) {
- return parent.isReadOnly(context, base, property);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @param value
- * @see javax.el.ELResolver#setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)
- */
- public void setValue(ELContext context, Object base, Object property, Object value) {
- if (null != base && null != property) {
- // TODO - detect value object from inderect references ( e.g. data table variables ).
- if (this.clonedObject) {
- parent.setValue(context, base, property, value);
- }
- context.setPropertyResolved(true);
- // For Arrays, Collection or Map use parent base and property.
- BasePropertyPair basePropertyPair = lookupBeanProperty(new BasePropertyPair(base, property));
- base = basePropertyPair.getBase();
- property = basePropertyPair.getProperty();
- if (null != base && null != property) {
- // https://jira.jboss.org/jira/browse/RF-4034
- // apache el looses locale information during value
- // resolution,
- // so we use our own
- validationMessages = validate(facesContext, base, property.toString(), value, groups);
- valid = null == validationMessages || 0 == validationMessages.size();
-
- }
- }
- }
-
- private BasePropertyPair lookupBeanProperty(BasePropertyPair pair) {
- Object base = pair.getBase();
- if (null != base && (base instanceof Collection || base instanceof Map || base.getClass().isArray())) {
- try {
- pair = lookupBeanProperty(valuesStack.pop());
- } catch (EmptyStackException e) {
- // Do nothing, this is a first item.
- }
- }
- return pair;
- }
-
- /**
- * @return the validationMessages
- */
- public Collection<String> getValidationMessages() {
- return validationMessages;
- }
-
- }
-
- protected Collection<String> validate(FacesContext facesContext, Object base, String property, Object value,
+ protected Collection<String> validate(FacesContext facesContext, Class<?> beanType, String property, Object value,
Class<?>[] groups) {
- @SuppressWarnings("rawtypes")
- Class beanType = base.getClass();
+
@SuppressWarnings("unchecked")
Set<ConstraintViolation<Object>> constrains =
- getValidator(facesContext).validateValue(beanType, property, value, getGroups(groups));
+ getValidator(facesContext).validateValue((Class<Object>) beanType, property, value, getGroups(groups));
return extractMessages(constrains);
}
Deleted: branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/validator/ClonedObjectResolver.java
===================================================================
--- branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/validator/ClonedObjectResolver.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/ui/src/main/java/org/richfaces/validator/ClonedObjectResolver.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -1,110 +0,0 @@
-/**
- *
- */
-package org.richfaces.validator;
-
-import java.beans.FeatureDescriptor;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.el.ELContext;
-import javax.el.ELResolver;
-import javax.faces.context.FacesContext;
-
-
-
-/**
- * @author asmirnov
- *
- */
-public class ClonedObjectResolver extends ELResolver {
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELContext, java.lang.Object)
- */
- @Override
- public Class<?> getCommonPropertyType(ELContext context, Object base) {
- // Do nothing
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELContext, java.lang.Object)
- */
- @Override
- public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
- // do nothing
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ELResolver#getType(javax.el.ELContext, java.lang.Object, java.lang.Object)
- */
- @Override
- public Class<?> getType(ELContext context, Object base, Object property) {
- Object cloned = resolveCloned(context, base, property);
- if (null != cloned) {
- context.setPropertyResolved(true);
- return cloned.getClass();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ELResolver#getValue(javax.el.ELContext, java.lang.Object, java.lang.Object)
- */
- @Override
- public Object getValue(ELContext context, Object base, Object property) {
- Object cloned = resolveCloned(context, base, property);
- if (null != cloned) {
- context.setPropertyResolved(true);
- }
- return cloned;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext, java.lang.Object, java.lang.Object)
- */
- @Override
- public boolean isReadOnly(ELContext context, Object base, Object property) {
- // TODO Auto-generated method stub
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ELResolver#setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)
- */
- @Override
- public void setValue(ELContext context, Object base, Object property, Object value) {
- // TODO Auto-generated method stub
-
- }
-
- public static Object resolveCloned(ELContext context, Object base, Object property) {
- if (null != base || null != property) {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Map<String, Object> requestMap = facesContext.getExternalContext().getRequestMap();
- for (String key : requestMap.keySet()) {
- if (null != key && key.startsWith(GraphValidatorState.STATE_ATTRIBUTE_PREFIX)) {
- GraphValidatorState state = (GraphValidatorState) requestMap.get(key);
- if (state.isSame(base, property)) {
- return state.getCloned();
- }
- }
- }
- }
- return null;
- }
-}
Modified: branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/ELTestBase.java
===================================================================
--- branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/ELTestBase.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/ELTestBase.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -15,6 +15,7 @@
import javax.el.MapELResolver;
import javax.el.ValueExpression;
import javax.el.VariableMapper;
+import javax.faces.context.FacesContext;
import org.jboss.el.ExpressionFactoryImpl;
import org.junit.After;
@@ -89,6 +90,10 @@
class DummyELContext extends ELContext {
+ public DummyELContext() {
+ putContext(FacesContext.class, FacesContext.getCurrentInstance());
+ }
+
@Override
public ELResolver getELResolver() {
return elResolver;
Modified: branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureEL.java
===================================================================
--- branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureEL.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureEL.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -1,16 +1,47 @@
package org.richfaces.el;
-import static org.junit.Assert.*;
+import static org.easymock.EasyMock.expect;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
import javax.el.ValueExpression;
+import org.jboss.test.faces.mock.Environment;
+import org.jboss.test.faces.mock.Environment.Feature;
+import org.jboss.test.faces.mock.FacesMock;
+import org.jboss.test.faces.mock.Mock;
+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.Maps;
+
@RunWith(MockTestRunner.class)
public class TestCaptureEL extends ELTestBase {
+ @Mock
+ @Environment(Feature.EXTERNAL_CONTEXT)
+ private MockFacesEnvironment facesEnvironment;
+
+
+ @Before
+ public void setUpEnvironment() throws Exception {
+ expect(facesEnvironment.getExternalContext().getRequestMap()).andStubReturn(Maps.<String, Object>newHashMap());
+ expect(facesEnvironment.getFacesContext().getAttributes()).andStubReturn(Maps.<Object, Object>newHashMap());
+ FacesMock.replay(facesEnvironment);
+ }
+
+ @After
+ public void tearDownEnvironment() throws Exception {
+ FacesMock.verify(facesEnvironment);
+ facesEnvironment.release();
+ }
+
@Test
public void testDummyResolverString() throws Exception {
ValueExpression expression = parse("#{bean.string}");
Modified: branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java
===================================================================
--- branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java 2011-03-04 19:24:40 UTC (rev 22065)
+++ branches/4.0.X/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java 2011-03-04 22:55:38 UTC (rev 22066)
@@ -1,15 +1,18 @@
package org.richfaces.el;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
+import static org.easymock.EasyMock.expect;
+import static org.junit.Assert.assertEquals;
import javax.el.ELException;
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
+import org.jboss.test.faces.mock.Environment;
+import org.jboss.test.faces.mock.Environment.Feature;
import org.jboss.test.faces.mock.FacesMock;
import org.jboss.test.faces.mock.Mock;
+import org.jboss.test.faces.mock.MockFacesEnvironment;
import org.jboss.test.faces.mock.MockTestRunner;
import org.junit.After;
import org.junit.Before;
@@ -17,42 +20,48 @@
import org.junit.runner.RunWith;
import org.richfaces.el.model.Bean;
+import com.google.common.collect.Maps;
+
@RunWith(MockTestRunner.class)
public class ValueExpressionAnalayserTest extends ELTestBase {
-
private ValueExpressionAnalayser analayser;
@Mock
+ @Environment(Feature.EXTERNAL_CONTEXT)
+ private MockFacesEnvironment facesEnvironment;
+
private FacesContext facesContext;
-
+
@Before
public void setUpAnalayser() throws Exception {
analayser = new ValueExpressionAnalayserImpl();
+ facesContext = facesEnvironment.getFacesContext();
+ expect(facesEnvironment.getExternalContext().getRequestMap()).andStubReturn(Maps.<String, Object>newHashMap());
}
@After
public void tearDownAnalayser() throws Exception {
+ facesContext = null;
analayser = null;
- facesContext.release();
+ facesEnvironment.release();
}
@Test
public void testGetDescriptionPositive() throws Exception {
ValueExpression expression = parse("#{bean.string}");
expect(facesContext.getELContext()).andReturn(elContext);
- FacesMock.replay(facesContext);
+ FacesMock.replay(facesEnvironment);
ValueDescriptor propertyDescriptor = analayser.getPropertyDescriptor(facesContext, expression);
assertEquals(Bean.class, propertyDescriptor.getBeanType());
assertEquals("string", propertyDescriptor.getName());
- assertEquals(String.class,propertyDescriptor.getPropertyType());
- FacesMock.verify(facesContext);
+ FacesMock.verify(facesEnvironment);
}
@Test(expected=ELException.class)
public void testGetDescriptionNegative() throws Exception {
ValueExpression expression = parse("#{bean}");
expect(facesContext.getELContext()).andReturn(elContext);
- FacesMock.replay(facesContext);
+ FacesMock.replay(facesEnvironment);
ValueDescriptor propertyDescriptor = analayser.getPropertyDescriptor(facesContext, expression);
}
}
15 years, 1 month
JBoss Rich Faces SVN: r22065 - branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-03-04 14:24:40 -0500 (Fri, 04 Mar 2011)
New Revision: 22065
Modified:
branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/component/AbstractCommandButton.java
Log:
https://issues.jboss.org/browse/RF-10702
Modified: branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/component/AbstractCommandButton.java
===================================================================
--- branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/component/AbstractCommandButton.java 2011-03-04 14:45:44 UTC (rev 22064)
+++ branches/4.0.X/ui/core/ui/src/main/java/org/richfaces/component/AbstractCommandButton.java 2011-03-04 19:24:40 UTC (rev 22065)
@@ -25,6 +25,7 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.annotations.Tag;
@@ -45,6 +46,9 @@
public static final String COMPONENT_FAMILY = UICommand.COMPONENT_FAMILY;
+ @Attribute
+ public abstract String getImage();
+
public String resolveClientId(FacesContext facesContext, UIComponent contextComponent, String metaComponentId) {
return null;
}
15 years, 1 month
JBoss Rich Faces SVN: r22064 - in branches/4.0.X/ui/input/ui/src: test/resources/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2011-03-04 09:45:44 -0500 (Fri, 04 Mar 2011)
New Revision: 22064
Modified:
branches/4.0.X/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java
branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/component/calendarScript.xmlunit.xml
Log:
https://jira.jboss.org/browse/RF-10678
Reviewed by Gleb Galkin
Modified: branches/4.0.X/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java
===================================================================
--- branches/4.0.X/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java 2011-03-04 14:06:57 UTC (rev 22063)
+++ branches/4.0.X/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java 2011-03-04 14:45:44 UTC (rev 22064)
@@ -127,9 +127,6 @@
@Attribute(defaultValue = "true")
public abstract boolean isPopup();
- @Attribute(defaultValue = "true")
- public abstract boolean isHidePopupOnScroll();
-
@Attribute
public abstract boolean isDisabled();
Modified: branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/component/calendarScript.xmlunit.xml
===================================================================
--- branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/component/calendarScript.xmlunit.xml 2011-03-04 14:06:57 UTC (rev 22063)
+++ branches/4.0.X/ui/input/ui/src/test/resources/org/richfaces/component/calendarScript.xmlunit.xml 2011-03-04 14:45:44 UTC (rev 22064)
@@ -1,7 +1,7 @@
<span id="form:calendarScript" style="display: none;">
<script type="text/javascript">
//<![CDATA[
-RichFaces.ui.Calendar.addLocale("en_US",{"monthLabels":["January","February","March","April","May","June","July","August","September","October","November","December"] ,"minDaysInFirstWeek":1,"monthLabelsShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"] ,"firstWeekDay":0,"weekDayLabels":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"] ,"weekDayLabelsShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"] } );new RichFaces.ui.Calendar("form:calendar","en_US",{"horizontalOffset":"0","showApplyButton":true,"showFooter":true,"selectedDate":new Date(2010,10,16,0,0,0),"verticalOffset":"0","datePattern":"d\/M\/yy HH:mm","direction":"AA","labels":{} ,"mode":"client","todayControlMode":"select","showWeeksBar":true,"resetTimeOnDateSelect":false,"style":"z\u002Dindex: 3;width:200px","showWeekDaysBar":true,"currentDate":new Date(2010,10,16),"showHeader":true,"popup":true,"enableManualInput":false,"showInput":true,"boundaryDatesMode":"ina!
ctive","disabled":false,"jointPoint":"AA","hidePopupOnScroll":"true"} ,"").load({"startDate":{"month":10,"year":2010} ,"days":[{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"sty!
leClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":fa!
lse,"sty
leClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ] } );
+RichFaces.ui.Calendar.addLocale("en_US",{"monthLabels":["January","February","March","April","May","June","July","August","September","October","November","December"] ,"minDaysInFirstWeek":1,"monthLabelsShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"] ,"firstWeekDay":0,"weekDayLabels":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"] ,"weekDayLabelsShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"] } );new RichFaces.ui.Calendar("form:calendar","en_US",{"horizontalOffset":"0","showApplyButton":true,"showFooter":true,"selectedDate":new Date(2010,10,16,0,0,0),"verticalOffset":"0","datePattern":"d\/M\/yy HH:mm","direction":"AA","labels":{} ,"mode":"client","todayControlMode":"select","showWeeksBar":true,"resetTimeOnDateSelect":false,"style":"z\u002Dindex: 3;width:200px","showWeekDaysBar":true,"currentDate":new Date(2010,10,16),"showHeader":true,"popup":true,"enableManualInput":false,"showInput":true,"boundaryDatesMode":"ina!
ctive","disabled":false,"jointPoint":"AA"} ,"").load({"startDate":{"month":10,"year":2010} ,"days":[{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":fa!
lse,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"ena!
bled":fa
lse,"styleClass":""} ,{"enabled":false,"styleClass":""} ,{"enabled":false,"styleClass":""} ] } );
//]]>
</script>
</span>
\ No newline at end of file
15 years, 1 month
JBoss Rich Faces SVN: r22063 - branches/4.0.X/ui/input/ui/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2011-03-04 09:06:57 -0500 (Fri, 04 Mar 2011)
New Revision: 22063
Modified:
branches/4.0.X/ui/input/ui/src/main/templates/inplaceSelect.template.xml
Log:
RF-10693 Inplace Select - @styleClass does not work
- reviewed by Anton Belevich
Modified: branches/4.0.X/ui/input/ui/src/main/templates/inplaceSelect.template.xml
===================================================================
--- branches/4.0.X/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2011-03-04 14:05:49 UTC (rev 22062)
+++ branches/4.0.X/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2011-03-04 14:06:57 UTC (rev 22063)
@@ -37,7 +37,8 @@
<cdk:object type="java.util.List" type-arguments="InplaceSelectBaseRenderer.ClientSelectItem" name="clientSelectItems"
value="#{getConvertedSelectItems(facesContext, component)}" />
- <span id="#{clientId}" class="#{getStateStyleClass(component, inplaceState)}" cdk:passThroughWithExclusions="id class">
+ <span id="#{clientId}" cdk:passThroughWithExclusions="id class"
+ class="#{concatClasses(getStateStyleClass(component, inplaceState), component.attributes['styleClass'])}" >
<span id="#{clientId}Label" class="rf-is-lbl#{inplaceValue == component.attributes['defaultLabel'] ? ' rf-is-dflt-lbl' : ''}">
#{inplaceValue}
15 years, 1 month
JBoss Rich Faces SVN: r22062 - branches/4.0.X/ui/input/ui/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2011-03-04 09:05:49 -0500 (Fri, 04 Mar 2011)
New Revision: 22062
Modified:
branches/4.0.X/ui/input/ui/src/main/templates/inplaceInput.template.xml
Log:
RF-10691 Inplace Input - @styleClass doesn't work
- reviewed by Anton Belevich
Modified: branches/4.0.X/ui/input/ui/src/main/templates/inplaceInput.template.xml
===================================================================
--- branches/4.0.X/ui/input/ui/src/main/templates/inplaceInput.template.xml 2011-03-04 13:55:31 UTC (rev 22061)
+++ branches/4.0.X/ui/input/ui/src/main/templates/inplaceInput.template.xml 2011-03-04 14:05:49 UTC (rev 22062)
@@ -42,7 +42,8 @@
<cdk:object type="org.richfaces.component.InplaceState" name="inplaceState" value="#{getInplaceState(component)}" />
<cdk:object type="java.lang.String" name="inplaceValue" value="#{getValue(facesContext, component)}" />
- <span id="#{clientId}" class="#{getStateStyleClass(component, inplaceState)}" cdk:passThroughWithExclusions="id class">
+ <span id="#{clientId}" cdk:passThroughWithExclusions="id class"
+ class="#{concatClasses(getStateStyleClass(component, inplaceState), component.attributes['styleClass'])}">
<span id="#{clientId}Label" class="rf-ii-lbl#{inplaceValue == component.attributes['defaultLabel'] ? ' rf-ii-dflt-lbl' : ''}">
#{inplaceValue}
</span>
15 years, 1 month
JBoss Rich Faces SVN: r22061 - branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-03-04 08:55:31 -0500 (Fri, 04 Mar 2011)
New Revision: 22061
Modified:
branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
Log:
https://issues.jboss.org/browse/RF-10644 Collapsible sub table: border of nodata facet rendered wrong. Reviewed by Alex Kolonitsky.
Modified: branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2011-03-04 13:51:48 UTC (rev 22060)
+++ branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2011-03-04 13:55:31 UTC (rev 22061)
@@ -146,35 +146,10 @@
encodeBeforeRows(writer, facesContext, dataTableBase, encodeParentTBody, encodePartialUpdate);
if (rowCount > 0) {
- processRows(writer, facesContext, dataTableBase, new Object[] {encodePartialUpdate, encodeParentTBody});
+ processRows(writer, facesContext, dataTableBase, new Object[]{encodePartialUpdate, encodeParentTBody});
} else {
- int columns = getColumnsCount(dataTableBase.columns());
-
- writer.startElement(HtmlConstants.TR_ELEMENT, dataTableBase);
- String styleClass = (String) dataTableBase.getAttributes().get("noDataStyleClass");
- styleClass = concatClasses(getNoDataClass(), styleClass);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, styleClass, null);
-
- writer.startElement(HtmlConstants.TD_ELEM, dataTableBase);
- writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
-
- String cellStyleClass = (String) dataTableBase.getAttributes().get("noDataCellStyleClass");
- cellStyleClass = concatClasses( getNoDataCellClass(), cellStyleClass);
- writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, cellStyleClass, null);
-
- UIComponent noDataFacet = dataTableBase.getNoData();
- if (noDataFacet != null && noDataFacet.isRendered()) {
- noDataFacet.encodeAll(facesContext);
- } else {
- String noDataLabel = dataTableBase.getNoDataLabel();
- if (noDataLabel != null) {
- writer.writeText(noDataLabel, "noDataLabel");
- }
- }
-
- writer.endElement(HtmlConstants.TD_ELEM);
- writer.endElement(HtmlConstants.TR_ELEMENT);
- }
+ encodeNoDataFacetOrLabel(writer,facesContext,dataTableBase);
+ }
encodeAfterRows(writer, facesContext, dataTableBase, encodeParentTBody, encodePartialUpdate);
@@ -193,6 +168,37 @@
dataTableBase.setRowKey(facesContext, key);
dataTableBase.restoreOrigValue(facesContext);
}
+
+ public void encodeNoDataFacetOrLabel(ResponseWriter writer, FacesContext facesContext, UIDataTableBase dataTableBase)
+ throws IOException {
+
+ int columns = getColumnsCount(dataTableBase.columns());
+ UIComponent noDataFacet = dataTableBase.getNoData();
+ String noDataLabel = dataTableBase.getNoDataLabel();
+
+ writer.startElement(HtmlConstants.TR_ELEMENT, dataTableBase);
+ String styleClass = (String) dataTableBase.getAttributes().get("noDataStyleClass");
+ styleClass = concatClasses(getNoDataClass(), styleClass);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, styleClass, null);
+
+ writer.startElement(HtmlConstants.TD_ELEM, dataTableBase);
+ writer.writeAttribute(HtmlConstants.COLSPAN_ATTRIBUTE, columns, null);
+
+ String cellStyleClass = (String) dataTableBase.getAttributes().get("noDataCellStyleClass");
+ cellStyleClass = concatClasses(getNoDataCellClass(), cellStyleClass);
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, cellStyleClass, null);
+
+ if (noDataFacet != null && noDataFacet.isRendered()) {
+ noDataFacet.encodeAll(facesContext);
+ } else if (noDataLabel != null && noDataLabel.length() > 0) {
+ writer.writeText(noDataLabel, "noDataLabel");
+ } else {
+ writer.writeAttribute(HtmlConstants.STYLE_ATTRIBUTE, "display: none;", null);
+ }
+ writer.endElement(HtmlConstants.TD_ELEM);
+ writer.endElement(HtmlConstants.TR_ELEMENT);
+
+ }
protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
if(component instanceof UIDataTableBase) {
15 years, 1 month
JBoss Rich Faces SVN: r22060 - in branches/4.0.X/ui/iteration/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-03-04 08:51:48 -0500 (Fri, 04 Mar 2011)
New Revision: 22060
Modified:
branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/renderkit/CollapsibleSubTableRenderer.java
branches/4.0.X/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/collapsible-subtable.ecss
Log:
https://issues.jboss.org/browse/RF-10644 Collapsible sub table: border of nodata facet rendered wrong. Reviewed by Alex Kolonitsky.
Modified: branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/renderkit/CollapsibleSubTableRenderer.java
===================================================================
--- branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/renderkit/CollapsibleSubTableRenderer.java 2011-03-04 12:28:08 UTC (rev 22059)
+++ branches/4.0.X/ui/iteration/ui/src/main/java/org/richfaces/renderkit/CollapsibleSubTableRenderer.java 2011-03-04 13:51:48 UTC (rev 22060)
@@ -217,7 +217,7 @@
partialEnd(facesContext);
}
}
-
+
@Override
public void encodeAfterRows(ResponseWriter writer, FacesContext facesContext, UIDataTableBase dataTableBase,
boolean encodeParentTBody, boolean partialUpdate) throws IOException {
Modified: branches/4.0.X/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/collapsible-subtable.ecss
===================================================================
--- branches/4.0.X/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/collapsible-subtable.ecss 2011-03-04 12:28:08 UTC (rev 22059)
+++ branches/4.0.X/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/collapsible-subtable.ecss 2011-03-04 13:51:48 UTC (rev 22060)
@@ -17,7 +17,10 @@
padding:0px;
}
-.rf-cst {
+.rf-cst, .rf-cst-nd {
+ border-bottom-width:'#{richSkin.tableBorderWidth}';
+ border-bottom-style:solid;
+ border-bottom-color:'#{richSkin.tableBorderColor}';
}
.rf-cst-r{
@@ -32,7 +35,7 @@
.rf-cst-hdr-fst-r{
}
-.rf-cst-c{
+.rf-cst-c, .rf-cst-nd-c{
border-bottom-width:'#{richSkin.tableBorderWidth}';
border-bottom-style:solid;
border-bottom-color:'#{richSkin.tableBorderColor}';
15 years, 1 month
JBoss Rich Faces SVN: r22059 - branches/4.0.X/ui/output/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2011-03-04 07:28:08 -0500 (Fri, 04 Mar 2011)
New Revision: 22059
Modified:
branches/4.0.X/ui/output/ui/src/main/java/org/richfaces/component/AbstractDropDownMenu.java
Log:
RF-10661 Taglib: drop down menu missing attribute label
- reviewed by Anton Belevich
Modified: branches/4.0.X/ui/output/ui/src/main/java/org/richfaces/component/AbstractDropDownMenu.java
===================================================================
--- branches/4.0.X/ui/output/ui/src/main/java/org/richfaces/component/AbstractDropDownMenu.java 2011-03-04 12:21:13 UTC (rev 22058)
+++ branches/4.0.X/ui/output/ui/src/main/java/org/richfaces/component/AbstractDropDownMenu.java 2011-03-04 12:28:08 UTC (rev 22059)
@@ -67,6 +67,9 @@
@Attribute(events = @EventName("itemclick"))
public abstract String getOnitemclick();
+ @Attribute
+ public abstract String getLabel();
+
public enum Facets {
label,
labelDisabled
15 years, 1 month