JBoss Rich Faces SVN: r19830 - in trunk/examples/richfaces-showcase/src/main/webapp/richfaces/select: samples and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-11-01 10:21:49 -0400 (Mon, 01 Nov 2010)
New Revision: 19830
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/select/samples/select-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/select/select.xhtml
Log:
select demo descriptions added
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/select/samples/select-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/select/samples/select-sample.xhtml 2010-11-01 14:03:58 UTC (rev 19829)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/select/samples/select-sample.xhtml 2010-11-01 14:21:49 UTC (rev 19830)
@@ -6,7 +6,7 @@
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<h:form>
- <p>DESC</p>
+ <p>There is simple sample where select behaves as standard one:</p>
<rich:panel style="width:220px;">
<f:facet name="header">
<h:outputText value="Simples select"></h:outputText>
@@ -19,14 +19,21 @@
<f:selectItem itemValue="4" itemLabel="Option 5" />
</rich:select>
</rich:panel>
- <p>DESC</p>
+ <p>There you could check keyboard filtering within the select
+ component. It allows to enter only valid items from the list. Wrong
+ input will be reseted.</p>
<rich:panel style="width:220px;">
<f:facet name="header">
<h:outputText value="Select with manual input"></h:outputText>
</f:facet>
- <rich:select enableManualInput="true" defaultLabel="start typing for select" >
- <f:selectItems value="#{inplaceSelectBean.capitalsOptions}"/>
+ <rich:select enableManualInput="true"
+ defaultLabel="start typing for select">
+ <f:selectItems value="#{inplaceSelectBean.capitalsOptions}" />
</rich:select>
- </rich:panel>
+ <a4j:commandButton value="submit"></a4j:commandButton>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:messages />
+ </a4j:outputPanel>
+ </rich:panel>
</h:form>
</ui:composition>
\ No newline at end of file
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/select/select.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/select/select.xhtml 2010-11-01 14:03:58 UTC (rev 19829)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/select/select.xhtml 2010-11-01 14:21:49 UTC (rev 19830)
@@ -5,7 +5,15 @@
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition>
- <p>DESC</p>
+ <p><b>rich:select</b> component is designed to replace standard
+ h:selectOneMenu. Main features which differs from base component:</p>
+ <ul>
+ <li>Skinned according to RichFaces standard principles. That
+ allows the component to have unified look and feel across all the
+ browsers.</li>
+ <li>Provides better navigation across select items using keyboard</li>
+ <li>Provides default label functionality which is common for all the RichFaces inputs.</li>
+ </ul>
<ui:include src="#{demoNavigator.sampleIncludeURI}" />
<ui:include src="/templates/includes/source-view.xhtml">
13 years, 6 months
JBoss Rich Faces SVN: r19829 - in trunk/examples/richfaces-showcase/src/main: webapp/richfaces/inplaceInput/samples and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-11-01 10:03:58 -0400 (Mon, 01 Nov 2010)
New Revision: 19829
Modified:
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml
Log:
minor correction of inplaceInput sample
Modified: trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-11-01 14:02:21 UTC (rev 19828)
+++ trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-11-01 14:03:58 UTC (rev 19829)
@@ -398,6 +398,15 @@
</demo>
</demos>
</group>
+ <!-- group>
+ <name>Menus</name>
+ <demos>
+ <demo>
+ <id>panelMenu</id>
+ <name>rich:panelMenu</name>
+ </demo>
+ </demos>
+ </group-->
<group>
<name>Inputs and Selects</name>
<demos>
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml 2010-11-01 14:02:21 UTC (rev 19828)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml 2010-11-01 14:03:58 UTC (rev 19829)
@@ -11,9 +11,9 @@
</f:facet>
<h:panelGrid columns="2">
<h:outputText value="Name: " />
- <rich:inplaceInput value="click to enter your name" />
+ <rich:inplaceInput defaultLabel="click to enter your name" />
<h:outputText value="Email:" />
- <rich:inplaceInput value="click to enter your email" />
+ <rich:inplaceInput defaultLabel="click to enter your email" />
</h:panelGrid>
</rich:panel>
</ui:composition>
\ No newline at end of file
13 years, 6 months
JBoss Rich Faces SVN: r19828 - in trunk: ui/input/ui/src/main/java/org/richfaces/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-11-01 10:02:21 -0400 (Mon, 01 Nov 2010)
New Revision: 19828
Modified:
trunk/examples/input-demo/src/main/webapp/examples/autocomplete.xhtml
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutocomplete.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteRendererBase.java
trunk/ui/input/ui/src/main/templates/autocomplete.template.xml
Log:
http://jira.jboss.com/jira/browse/RF-9585
Modified: trunk/examples/input-demo/src/main/webapp/examples/autocomplete.xhtml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/examples/autocomplete.xhtml 2010-11-01 13:50:44 UTC (rev 19827)
+++ trunk/examples/input-demo/src/main/webapp/examples/autocomplete.xhtml 2010-11-01 14:02:21 UTC (rev 19828)
@@ -30,8 +30,14 @@
<div style="height: 300px; width: 300px; overflow: auto; float:left;">Text
block text block text block text block text block text block text
block text block
+ <script type="text/javascript">
+ function customFilterFunction(subString, value) {
+ if(subString.length>1)
+ if(value.indexOf(subString)!=-1) return true;
+ }
+ </script>
- <input:autocomplete autofill="false" id="myAutocomplete" clientFilter="if(subString.length>1) if(value.indexOf(subString)!=-1) return true;" mode="#{autoCompleteBean.mode}" minChars="2" autocompleteMethod="#{autoCompleteBean.autocomplete}" var="country" fetchValue="#{country.name}" showButton="true"
+ <input:autocomplete autofill="false" id="myAutocomplete" clientFilterFunction="customFilterFunction" mode="#{autoCompleteBean.mode}" minChars="2" autocompleteMethod="#{autoCompleteBean.autocomplete}" var="country" fetchValue="#{country.name}" showButton="true"
value = "#{autoCompleteBean.value}"
onchange="return onEvent.call(this, event);" onselectitem="return onEvent.call(this, event);" onblur="return onEvent.call(this, event);" onfocus="return onEvent.call(this, event);">
#{country.name} #{country.iso} #{country.domain}
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutocomplete.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutocomplete.java 2010-11-01 13:50:44 UTC (rev 19827)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutocomplete.java 2010-11-01 14:02:21 UTC (rev 19828)
@@ -194,7 +194,7 @@
public abstract String getOnbeforedomupdate();
@Attribute
- public abstract String getClientFilter();
+ public abstract String getClientFilterFunction();
@Override
public Converter getConverter() {
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteRendererBase.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteRendererBase.java 2010-11-01 13:50:44 UTC (rev 19827)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteRendererBase.java 2010-11-01 14:02:21 UTC (rev 19828)
@@ -45,7 +45,7 @@
import javax.servlet.jsp.jstl.sql.Result;
import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.javascript.JSFunctionDefinition;
+import org.ajax4jsf.javascript.JSReference;
import org.richfaces.component.AbstractAutocomplete;
import org.richfaces.component.AutocompleteLayout;
import org.richfaces.component.MetaComponentResolver;
@@ -69,14 +69,11 @@
})
public abstract class AutocompleteRendererBase extends InputRendererBase implements MetaComponentRenderer {
- public JSFunctionDefinition getClientFilterFunction(UIComponent component) {
+ public JSReference getClientFilterFunction(UIComponent component) {
AbstractAutocomplete autocomplete = (AbstractAutocomplete) component;
- String clientFilter = (String) autocomplete.getAttributes().get("clientFilter");
+ String clientFilter = (String) autocomplete.getAttributes().get("clientFilterFunction");
if (clientFilter != null && clientFilter.length() != 0) {
- JSFunctionDefinition clientFilterFunction = new JSFunctionDefinition("subString");
- clientFilterFunction.addParameter("value");
- clientFilterFunction.addToBody(clientFilter);
- return clientFilterFunction;
+ return new JSReference(clientFilter);
}
return null;
Modified: trunk/ui/input/ui/src/main/templates/autocomplete.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/autocomplete.template.xml 2010-11-01 13:50:44 UTC (rev 19827)
+++ trunk/ui/input/ui/src/main/templates/autocomplete.template.xml 2010-11-01 14:02:21 UTC (rev 19828)
@@ -77,8 +77,8 @@
<cdk:scriptOption attributes="onbegin oncomplete onerror onbeforedomupdate onchange onselectitem onfocus onblur" wrapper="eventHandler"/>
<cdk:scriptOption name="filterFunction" value="#{getClientFilterFunction(component)}" />
<cdk:scriptOption name="isCachedAjax" value="#{'ajax'==mode ? false : true}" defaultValue="true" />
- <cdk:scriptOption name="ajaxMode" value="#{'client'==mode||'lazyClient'==mode ? false : true}" defaultValue="true" />
- <cdk:scriptOption name="lazyClientMode" value="#{'lazyClient'==mode ? true : false}" defaultValue="false" />
+ <cdk:scriptOption name="ajaxMode" value="#{'client'==mode||'lazyClient'==mode ? false : true}" defaultValue="true" />
+ <cdk:scriptOption name="lazyClientMode" value="#{'lazyClient'==mode ? true : false}" defaultValue="false" />
</cdk:scriptObject>
new RichFaces.ui.Autocomplete("#{clientId}",
"#{clientId}Input", #{toScriptArgs(options)}
13 years, 6 months
JBoss Rich Faces SVN: r19827 - modules/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-11-01 09:50:44 -0400 (Mon, 01 Nov 2010)
New Revision: 19827
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/formQueue.xhtml
Log:
a4j:queue - moved globalQueue definition to top-level (outOfTemplateBefore) to satisfy it is not nested in other components
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/formQueue.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/formQueue.xhtml 2010-11-01 13:50:09 UTC (rev 19826)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/formQueue.xhtml 2010-11-01 13:50:44 UTC (rev 19827)
@@ -40,11 +40,8 @@
</ui:define>
<ui:define name="outOfTemplateBefore">
- </ui:define>
-
- <ui:define name="component">
-
- <a4j:queue id="globalQueue" ignoreDupResponses="#{a4jQueueBean.globalQueue.attributes['ignoreDupResponses'].value}"
+
+ <a4j:queue id="globalQueue" ignoreDupResponses="#{a4jQueueBean.globalQueue.attributes['ignoreDupResponses'].value}"
name="#{a4jQueueBean.globalQueue.attributes['name'].value}"
onbeforedomupdate="#{a4jQueueBean.globalQueue.attributes['onbeforedomupdate'].value}"
oncomplete="#{a4jQueueBean.globalQueue.attributes['oncomplete'].value}"
@@ -55,7 +52,11 @@
rendered="#{a4jQueueBean.globalQueue.attributes['rendered'].value}"
requestDelay="#{a4jQueueBean.globalQueue.attributes['requestDelay'].value}"
timeout="#{a4jQueueBean.globalQueue.attributes['timeout'].value}" />
+
+ </ui:define>
+ <ui:define name="component">
+
<c:forEach var="i" begin="1" end="2" step="1">
<rich:panel id="formQueue${i}Panel" header="Form Based Queue ${i}">
<h:form id="formQueue${i}Form">
13 years, 6 months
JBoss Rich Faces SVN: r19826 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-11-01 09:50:09 -0400 (Mon, 01 Nov 2010)
New Revision: 19826
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestInterval.java
Log:
a4j:push - increased limit for one push to two intervals instead of one (because of some unexpected deviations - the behavior should be verified by computing average deviation)
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestInterval.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestInterval.java 2010-11-01 13:30:38 UTC (rev 19825)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestInterval.java 2010-11-01 13:50:09 UTC (rev 19826)
@@ -160,8 +160,8 @@
System.out.println(format("deviation for interval {0}: {1}", interval, deviation));
}
- assertTrue(deviation <= interval,
- format("Deviation ({0}) is greater than one interval {1}", deviation, interval));
+ assertTrue(deviation <= (2 * interval),
+ format("Deviation ({0}) is greater than two intervals (2 * {1})", deviation, interval));
deviationTotal += deviation;
deviationCount += 1;
13 years, 6 months
JBoss Rich Faces SVN: r19825 - trunk/core/impl/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-11-01 09:30:38 -0400 (Mon, 01 Nov 2010)
New Revision: 19825
Modified:
trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
Log:
add KEYS codes
Modified: trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-11-01 13:29:44 UTC (rev 19824)
+++ trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-11-01 13:30:38 UTC (rev 19825)
@@ -753,6 +753,23 @@
}
}
};
+
+ //keys codes
+ richfaces.KEYS = {
+ BACKSPACE: 8,
+ TAB: 9,
+ RETURN: 13,
+ ESC: 27,
+ PAGEUP: 33,
+ PAGEDOWN: 34,
+ LEFT: 37,
+ UP: 38,
+ RIGHT: 39,
+ DOWN: 40,
+ DEL: 46
+ };
+
+
// move this code to somewhere
if (typeof jsf != 'undefined') {
jsf.ajax.addOnEvent(ajaxOnComplete);
13 years, 6 months
JBoss Rich Faces SVN: r19824 - trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-11-01 09:29:44 -0400 (Mon, 01 Nov 2010)
New Revision: 19824
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
Log:
fix select onBlur behavior, use bindScrollEventHandlers function from richfaces-events, move key codes def to the richfaces.js
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js 2010-11-01 13:00:32 UTC (rev 19823)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js 2010-11-01 13:29:44 UTC (rev 19824)
@@ -1,43 +1,3 @@
-// TODO: remove when these functions will be moved to the RichFaces.Event <!--
-
-(function (rf) {
- rf.KEYS = {
- BACKSPACE: 8,
- TAB: 9,
- RETURN: 13,
- ESC: 27,
- PAGEUP: 33,
- PAGEDOWN: 34,
- LEFT: 37,
- UP: 38,
- RIGHT: 39,
- DOWN: 40,
- DEL: 46
- };
-})(RichFaces);
-
-
-$.extend(RichFaces.Event, {
- bindScrollEventHandlers: function(element, handler, component) {
- var elements = [];
- element = RichFaces.getDomElement(element).parentNode;
- while (element && element!=window.document.body)
- {
- if (element.offsetWidth!=element.scrollWidth || element.offsetHeight!=element.scrollHeight)
- {
- elements.push(element);
- RichFaces.Event.bind(element, "scroll"+component.getNamespace(), handler, component);
- }
- element = element.parentNode;
- }
- return elements;
- },
- unbindScrollEventHandlers: function(elements, component) {
- RichFaces.Event.unbind(elements, "scroll"+component.getNamespace());
- }
-});
-// -->
-
(function ($, rf) {
rf.ui = rf.ui || {};
@@ -163,10 +123,6 @@
this.cancel();
},
- __setInputFocus: function() {
- this.input.focus();
- },
-
destroy: function () {
$super.destroy.call(this);
}
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js 2010-11-01 13:00:32 UTC (rev 19823)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js 2010-11-01 13:29:44 UTC (rev 19824)
@@ -50,6 +50,10 @@
__changeHandler: function(e) {
},
+ __setInputFocus: function() {
+ this.input.focus();
+ },
+
getValue: function() {
return this.input.val();
},
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-11-01 13:00:32 UTC (rev 19823)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-11-01 13:29:44 UTC (rev 19824)
@@ -1,22 +1,3 @@
-//TODO: to the utils? <--
-(function (rf) {
- rf.KEYS = {
- BACKSPACE: 8,
- TAB: 9,
- RETURN: 13,
- ESC: 27,
- PAGEUP: 33,
- PAGEDOWN: 34,
- LEFT: 37,
- UP: 38,
- RIGHT: 39,
- DOWN: 40,
- DEL: 46
- };
-})(RichFaces);
-
-
-//TODO: remove when cache will be moved to utils <--
(function ($, rf) {
rf.utils = rf.utils || {};
13 years, 6 months
JBoss Rich Faces SVN: r19823 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-11-01 09:00:32 -0400 (Mon, 01 Nov 2010)
New Revision: 19823
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java
Log:
a4j:repeat - simple test - fixed countExpectedValues() to follow RF-9373 (refactored to better understand)
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java 2010-11-01 12:59:48 UTC (rev 19822)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java 2010-11-01 13:00:32 UTC (rev 19823)
@@ -30,7 +30,6 @@
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
-import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -54,8 +53,9 @@
@Use(empty = false)
Integer rows;
- int expectedFirst;
- int expectedRows;
+ int expectedBegin;
+ int displayedRows;
+ int expectedEnd;
@Override
public URL getTestUrl() {
@@ -81,8 +81,7 @@
}
@Test
- @Use(field = "first", ints = { -1, 0, 1, ELEMENTS_TOTAL / 2, ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL,
- ELEMENTS_TOTAL + 1 })
+ @Use(field = "first", ints = { -1, 0, 1, ELEMENTS_TOTAL / 2, ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL, ELEMENTS_TOTAL + 1 })
public void testFirstAttribute() {
verifyRepeat();
}
@@ -90,7 +89,6 @@
@Test
@Use(field = "rows", ints = { -2, -1, 0, 1, ELEMENTS_TOTAL / 2, ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL,
ELEMENTS_TOTAL + 1 })
- @IssueTracking({ "https://jira.jboss.org/browse/RF-9373" })
public void testRowsAttribute() {
verifyRepeat();
}
@@ -102,42 +100,59 @@
}
private void verifyCounts() {
- assertEquals(model.getTotalRowCount(), expectedRows);
- if (expectedRows > 0) {
- assertEquals(model.getIndex(1), expectedFirst);
+ assertEquals(model.getTotalRowCount(), displayedRows);
+ if (displayedRows > 0) {
+ assertEquals(model.getIndex(1), expectedBegin);
}
}
private void verifyRows() {
int rowCount = model.getTotalRowCount();
for (int position = 1; position <= rowCount; position++) {
- assertEquals(model.getBegin(position), expectedFirst, "begin");
- assertEquals(model.getEnd(position), expectedFirst + expectedRows - 1, "end");
- assertEquals(model.getIndex(position), expectedFirst + position - 1, "index");
+ assertEquals(model.getBegin(position), expectedBegin, "begin");
+ assertEquals(model.getEnd(position), expectedEnd, "end");
+ assertEquals(model.getIndex(position), expectedBegin + position - 1, "index");
assertEquals(model.getCount(position), position, "count");
assertEquals(model.isFirst(position), position == 1, "first");
assertEquals(model.isLast(position), position == rowCount, "last");
assertEquals(model.isEven(position), (position % 2) == 0, "even");
- // TODO fails because of rowCount on page doesn't eqaul to rowCount, but ELEMENTS_TOTAL
- // assertEquals(model.getRowCount(position), rowCount, "rowCount");
+ assertEquals(model.getRowCount(position), ELEMENTS_TOTAL, "rowCount");
}
}
private void countExpectedValues() {
+
+ // expected begin
+
if (first == null || first < 0) {
- expectedFirst = 0;
+ expectedBegin = 0;
} else {
- expectedFirst = first;
+ expectedBegin = first;
}
+ expectedBegin = minMax(0, expectedBegin, ELEMENTS_TOTAL);
+
+ // expected displayed rows
+
if (rows == null || rows < 1 || rows > ELEMENTS_TOTAL) {
- expectedRows = ELEMENTS_TOTAL;
+ displayedRows = ELEMENTS_TOTAL;
} else {
- expectedRows = rows;
+ displayedRows = rows;
}
- expectedFirst = minMax(0, expectedFirst, ELEMENTS_TOTAL);
- expectedRows = min(expectedRows, ELEMENTS_TOTAL - expectedFirst);
+ if (first != null && first < 0) {
+ displayedRows = 0;
+ }
+
+ displayedRows = min(displayedRows, ELEMENTS_TOTAL - expectedBegin);
+
+ // expected end
+
+ if (rows == null || rows < 1) {
+ expectedEnd = ELEMENTS_TOTAL - 1;
+ } else {
+ expectedEnd = rows - 1;
+ }
}
private int minMax(int min, int value, int max) {
13 years, 6 months
JBoss Rich Faces SVN: r19822 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-11-01 08:59:48 -0400 (Mon, 01 Nov 2010)
New Revision: 19822
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocomplete.java
Log:
rich:autocomplete - fixed the name of tested page
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocomplete.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocomplete.java 2010-11-01 12:59:06 UTC (rev 19821)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAutocomplete/TestAutocomplete.java 2010-11-01 12:59:48 UTC (rev 19822)
@@ -54,7 +54,7 @@
@Override
public URL getTestUrl() {
- return buildUrl(contextPath, "faces/components/richAutocomplete/autocompleteValidation.xhtml");
+ return buildUrl(contextPath, "faces/components/richAutocomplete/autocomplete.xhtml");
}
@Inject
13 years, 6 months
JBoss Rich Faces SVN: r19821 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-11-01 08:59:06 -0400 (Mon, 01 Nov 2010)
New Revision: 19821
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java
Log:
a4j:repeat - do not test @first attribute with value lesser than -1 (RF-9372)
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java 2010-11-01 12:42:30 UTC (rev 19820)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java 2010-11-01 12:59:06 UTC (rev 19821)
@@ -81,9 +81,8 @@
}
@Test
- @Use(field = "first", ints = { -2, -1, 0, 1, ELEMENTS_TOTAL / 2, ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL,
+ @Use(field = "first", ints = { -1, 0, 1, ELEMENTS_TOTAL / 2, ELEMENTS_TOTAL - 1, ELEMENTS_TOTAL,
ELEMENTS_TOTAL + 1 })
- @IssueTracking({ "https://jira.jboss.org/browse/RF-9372" })
public void testFirstAttribute() {
verifyRepeat();
}
13 years, 6 months