JBoss Rich Faces SVN: r10714 - trunk/framework/impl/src/main/java/org/richfaces/model.
by richfaces-svn-commits@lists.jboss.org
Author: pgolawski
Date: 2008-10-10 08:42:34 -0400 (Fri, 10 Oct 2008)
New Revision: 10714
Modified:
trunk/framework/impl/src/main/java/org/richfaces/model/ModifiableModel.java
Log:
changed all private members to protected to allow inheritance
Modified: trunk/framework/impl/src/main/java/org/richfaces/model/ModifiableModel.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/model/ModifiableModel.java 2008-10-10 12:41:20 UTC (rev 10713)
+++ trunk/framework/impl/src/main/java/org/richfaces/model/ModifiableModel.java 2008-10-10 12:42:34 UTC (rev 10714)
@@ -30,7 +30,7 @@
*/
public class ModifiableModel extends ExtendedDataModel implements Modifiable{
- private class RowKeyWrapperFactory extends ObjectWrapperFactory {
+ protected class RowKeyWrapperFactory extends ObjectWrapperFactory {
private class ExtendedJavaBeanWrapper extends JavaBeanWrapper {
@@ -66,11 +66,11 @@
private static final Log log = LogFactory.getLog(ModifiableModel.class);
- private List<Object> rowKeys;
+ protected List<Object> rowKeys;
- private ExtendedDataModel originalModel;
+ protected ExtendedDataModel originalModel;
- private String var;
+ protected String var;
public ModifiableModel(ExtendedDataModel originalModel, String var) {
this.originalModel = originalModel;
@@ -207,7 +207,7 @@
}
- private List<Object> filter(List<FilterField> filterFields) {
+ protected List<Object> filter(List<FilterField> filterFields) {
if (filterFields != null && !filterFields.isEmpty()) {
FacesContext context = FacesContext.getCurrentInstance();
List <Object> filteredCollection = new ArrayList<Object>();
@@ -225,7 +225,7 @@
return rowKeys;
}
- private void sort(List<SortField2> sortFields) {
+ protected void sort(List<SortField2> sortFields) {
if (sortFields != null && !sortFields.isEmpty()) {
FacesContext context = FacesContext.getCurrentInstance();
ObjectWrapperFactory wrapperFactory = new RowKeyWrapperFactory(
16 years, 3 months
JBoss Rich Faces SVN: r10713 - trunk/framework/api/src/main/java/org/richfaces/model.
by richfaces-svn-commits@lists.jboss.org
Author: pgolawski
Date: 2008-10-10 08:41:20 -0400 (Fri, 10 Oct 2008)
New Revision: 10713
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/DataProvider.java
Log:
changed JavaDoc comment
Modified: trunk/framework/api/src/main/java/org/richfaces/model/DataProvider.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/DataProvider.java 2008-10-10 12:14:12 UTC (rev 10712)
+++ trunk/framework/api/src/main/java/org/richfaces/model/DataProvider.java 2008-10-10 12:41:20 UTC (rev 10713)
@@ -7,10 +7,10 @@
import java.util.List;
/**
- * G3DataProvider is an interface that defines methods for manage loading data.<br>
+ * DataProvider is an interface that defines methods for manage loading data.<br>
* Usage:
* <pre>
- * G3DataProvider<SomeDataType> dataProvider = new G3DataProvider<SomeDataType>();
+ * DataProvider<SomeDataType> dataProvider = new DataProvider<SomeDataType>();
* </pre>
* @author pawelgo
*
16 years, 3 months
JBoss Rich Faces SVN: r10712 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/dataScroller and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-10-10 08:14:12 -0400 (Fri, 10 Oct 2008)
New Revision: 10712
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScrollerListeners.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataScrollerBean.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java
Log:
DataScroller: listeners test
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataScrollerBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataScrollerBean.java 2008-10-10 11:20:37 UTC (rev 10711)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataScrollerBean.java 2008-10-10 12:14:12 UTC (rev 10712)
@@ -12,6 +12,8 @@
import javax.faces.event.ActionEvent;
+import org.ajax4jsf.context.AjaxContext;
+
/**
* Bean class for dataScroller component testing
* @author Andrey Markavtsov
@@ -42,6 +44,12 @@
private Boolean bypassUpdates = false;
+ private Boolean immediate;
+
+ private Boolean ajaxSingle;
+
+ private String status;
+
public DataScrollerBean() {
init();
}
@@ -79,6 +87,33 @@
return null;
}
+ public String testImmediate() {
+ page = null;
+ status = null;
+ immediate = true;
+ return null;
+ }
+
+ public String testFalidationFailure() {
+ page = null;
+ status = null;
+ return null;
+ }
+
+ public String testAjaxSingle() {
+ page = null;
+ status = null;
+ ajaxSingle = true;
+ return null;
+ }
+
+ public void actionListener(ActionEvent event) {
+ if (status == null) {
+ status = "";
+ }
+ status = status + "ActionListener";
+ }
+
private void init() {
data = new ArrayList();
for (int i = 0; i < totalRows; i++) {
@@ -98,6 +133,9 @@
limitToList = false;
onComplete = null;
bypassUpdates = false;
+ ajaxSingle = false;
+ immediate = false;
+ status = null;
}
public void apply(ActionEvent event) {
@@ -216,6 +254,11 @@
}
public void setInput(String input) {
+ if (status == null) {
+ status = "";
+ }
+ if (input.equals("Text"))
+ status = status + "UpdateModel ";
this.input = input;
}
@@ -234,4 +277,29 @@
public void setBypassUpdates(Boolean bypassUpdates) {
this.bypassUpdates = bypassUpdates;
}
+
+ public Boolean getImmediate() {
+ return immediate;
+ }
+
+ public void setImmediate(Boolean immediate) {
+ this.immediate = immediate;
+ }
+
+ public Boolean getAjaxSingle() {
+ return ajaxSingle;
+ }
+
+ public void setAjaxSingle(Boolean ajaxSingle) {
+ this.ajaxSingle = ajaxSingle;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
}
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScrollerListeners.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScrollerListeners.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScrollerListeners.xhtml 2008-10-10 12:14:12 UTC (rev 10712)
@@ -0,0 +1,50 @@
+<!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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.template}">
+ <ui:define name="component">
+ <script>
+ </script>
+ <h:form id="_controls">
+ <h:commandButton id="fValidation" action="#{dataScrollerBean.testFalidationFailure}" value="Test validation failure"></h:commandButton>
+ <h:commandButton id="ajaxSingle" action="#{dataScrollerBean.testAjaxSingle}" value="Test Ajax Single"></h:commandButton>
+ <h:commandButton id="immediate" action="#{dataScrollerBean.testImmediate}" value="Test Immediate"></h:commandButton>
+ </h:form>
+ <br/>
+ <h:form id="_data">
+ <h:outputText id="status" value="#{dataScrollerBean.status}"></h:outputText>
+ <rich:datascroller id="scroller"
+ for="tbl"
+ align="left"
+ maxPages="#{dataScrollerBean.maxPages}"
+ page="#{dataScrollerBean.page}"
+ actionListener="#{dataScrollerBean.actionListener}"
+ immediate="#{dataScrollerBean.immediate}"
+ ajaxSingle="#{dataScrollerBean.ajaxSingle}"
+ reRender="status"
+ />
+ <br/>
+ <rich:dataTable id="tbl" value="#{dataScrollerBean.data}" rows="#{dataScrollerBean.tableRows}" var="var">
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="#" />
+ </f:facet>
+ <h:outputText value="#{var[0]}" />
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Data" />
+ </f:facet>
+ <h:outputText value="#{var[1]}" />
+ </rich:column>
+ </rich:dataTable>
+ <h:inputHidden id="input" value="#{dataScrollerBean.input}" required="true"></h:inputHidden>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java 2008-10-10 11:20:37 UTC (rev 10711)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java 2008-10-10 12:14:12 UTC (rev 10712)
@@ -7,7 +7,6 @@
package org.richfaces.testng;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import org.ajax4jsf.template.Template;
@@ -22,6 +21,10 @@
*/
public class DataScrollerTest extends SeleniumTestBase {
+ static String TEST__URL = "pages/dataScroller/dataScroller.xhtml";
+
+ static final String TEST_AJAX_URL = "pages/dataScroller/dataScrollerListeners.xhtml";
+
static final String RESET_METHOD_ME = "#{dataScrollerBean.reset}";
String dataScrollerId;
@@ -50,6 +53,73 @@
};
@Test
+ public void testAjaxAttributes(Template template) {
+ TEST__URL = TEST_AJAX_URL;
+ final String UPDATE_MODEL = "UpdateModel";
+ final String LISTENER = "ActionListener";
+ renderPage(template, RESET_METHOD_ME);
+ initIDs(getParentId(), template);
+
+ String statusId = getParentId() + "_data:status";
+ String status = null;
+ String commandId = null;
+
+ // Test actionListener & model Update
+ setValidation(true, getParentId());
+ clickControl(4);
+ status = getTextById(statusId);
+ if (status.indexOf(UPDATE_MODEL) == -1) {
+ writeStatus("Update model phase has been skipped", true);
+ Assert.fail("Update model phase has been skipped");
+ }else if (status.indexOf(LISTENER) == -1) {
+ writeStatus("Invoke application phase has been skipped", true);
+ Assert.fail("Invoke application phase has been skipped");
+ }
+
+ // Test actionListener & model Update if validation failure
+ commandId = getParentId() + "_controls:fValidation";
+ clickCommandAndWait(commandId);
+ setValidation(false, getParentId());
+ clickControl(4);
+ status = getTextById(statusId);
+ if (status.indexOf(UPDATE_MODEL) != -1) {
+ writeStatus("Update model should be skipped in case of failed validation", true);
+ Assert.fail("Update model should be skipped in case of failed validation");
+ }else if (status.indexOf(LISTENER) != -1) {
+ writeStatus("Invoke application phase should be skipped in case of failed validation", true);
+ Assert.fail("Invoke application phase should be skipped in case of failed validation");
+ }
+
+ // Test actionListener & model Update if ajaxSingle
+ commandId = getParentId() + "_controls:ajaxSingle";
+ clickCommandAndWait(commandId);
+ setValidation(true, getParentId());
+ clickControl(4);
+ status = getTextById(statusId);
+ if (status.indexOf(UPDATE_MODEL) != -1) {
+ writeStatus("Update model should be skipped in case of ajaxSingle", true);
+ Assert.fail("Update model should be skipped in case of ajaxSingle");
+ }else if (status.indexOf(LISTENER) == -1) {
+ writeStatus("Invoke application phase has been skipped for ajaxSingle", true);
+ Assert.fail("Invoke application phase has been skipped for ajaxSingle");
+ }
+
+ // Test actionListener & model Update if immediate
+ commandId = getParentId() + "_controls:immediate";
+ clickCommandAndWait(commandId);
+ setValidation(false, getParentId());
+ clickControl(4);
+ status = getTextById(statusId);
+ if (status.indexOf(UPDATE_MODEL) != -1) {
+ writeStatus("Update model should be skipped in case of immediate", true);
+ Assert.fail("Update model should be skipped in case of immediate");
+ }else if (status.indexOf(LISTENER) == -1) {
+ writeStatus("Invoke application phase has been skipped for immediate", true);
+ Assert.fail("Invoke application phase has been skipped for immediate");
+ }
+ }
+
+ @Test
public void testBypassUpdates(Template template) {
renderPage(template, RESET_METHOD_ME);
initIDs(getParentId(), template);
@@ -252,6 +322,15 @@
}
+ private void setValidation(boolean validationPassed, String parentId) {
+ String inputId = getParentId() + "_data:input";
+ if (validationPassed) {
+ setValueById(inputId, "Text");
+ } else {
+ setValueById(inputId, "");
+ }
+ }
+
private void initIDs(String parentId, Template template) {
dataScrollerId = parentId + "_data:scroller";
dataScrollerTableId = parentId + "_data:scroller_table";
@@ -372,7 +451,8 @@
*/
@Override
public String getTestUrl() {
- return "pages/dataScroller/dataScroller.xhtml";
+ return TEST__URL;
}
}
+
16 years, 3 months
JBoss Rich Faces SVN: r10711 - trunk/ui/calendar/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-10-10 07:20:37 -0400 (Fri, 10 Oct 2008)
New Revision: 10711
Modified:
trunk/ui/calendar/src/main/config/component/calendar.xml
Log:
toolTipMode attribute has become hidden
Modified: trunk/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/ui/calendar/src/main/config/component/calendar.xml 2008-10-10 11:02:29 UTC (rev 10710)
+++ trunk/ui/calendar/src/main/config/component/calendar.xml 2008-10-10 11:20:37 UTC (rev 10711)
@@ -211,7 +211,7 @@
</description>
</property>
- <property>
+ <property hidden="true">
<name>toolTipMode</name>
<classname>java.lang.String</classname>
<description>
16 years, 3 months
JBoss Rich Faces SVN: r10710 - in trunk/test-applications/facelets/src/main: webapp/Calendar and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: tromanovich
Date: 2008-10-10 07:02:29 -0400 (Fri, 10 Oct 2008)
New Revision: 10710
Modified:
trunk/test-applications/facelets/src/main/java/calendar/CalendarBean.java
trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml
trunk/test-applications/facelets/src/main/webapp/Calendar/CalendarProperty.xhtml
trunk/test-applications/facelets/src/main/webapp/DropDownMenu/DropDownMenuProperty.xhtml
trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelectProperty.xhtml
Log:
"Readonly" attribute was added to the calendar component
Modified: trunk/test-applications/facelets/src/main/java/calendar/CalendarBean.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/calendar/CalendarBean.java 2008-10-10 10:41:00 UTC (rev 10709)
+++ trunk/test-applications/facelets/src/main/java/calendar/CalendarBean.java 2008-10-10 11:02:29 UTC (rev 10710)
@@ -73,6 +73,7 @@
private String jointPoint;
private String direction;
private String boundary;
+ private int firstWeekDay;
private String icon;
private String toolTipMode;
private String label;
@@ -93,6 +94,7 @@
private HtmlCalendar htmlCalendar = null;
public CalendarBean() {
+ firstWeekDay = 1;
horizontalOffset = "0";
verticalOffset = "0";
isDayEnabled = true;
@@ -111,7 +113,7 @@
pattern = "MMM d, yyyy";
jointPoint = "bottom-left";
direction = "bottom-right";
- readonly = true;
+ readonly = false;
enableManualInput = false;
showInput = true;
boundary = "inactive";
@@ -665,8 +667,22 @@
public void setHeaderFacet(String headerFacet) {
this.headerFacet = headerFacet;
}
+
+ /**
+ * @return the firstWeekDay
+ */
+ public int getFirstWeekDay() {
+ return firstWeekDay;
+ }
+ /**
+ * @param firstWeekDay the firstWeekDay to set
+ */
+ public void setFirstWeekDay(int firstWeekDay) {
+ this.firstWeekDay = firstWeekDay;
+ }
+
public HtmlCalendar getHtmlCalendar() {
return htmlCalendar;
}
Modified: trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml 2008-10-10 10:41:00 UTC (rev 10709)
+++ trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml 2008-10-10 11:02:29 UTC (rev 10710)
@@ -11,6 +11,7 @@
rendered="#{calendarBean.renderedAjax}" />
<rich:calendar id="calendarClientID" dataModel="#{calendarDataModel}"
+ firstWeekDay="#{calendarBean.firstWeekDay}"
style="#{style.style}" styleClass="#{style.styleClass}" inputStyle="#{style.inputStyle}"
locale="#{calendarBean.locale}" popup="#{calendarBean.popup}"
preloadDateRangeBegin="#{calendarBean.prDateRangeBegin}"
@@ -35,6 +36,7 @@
buttonIcon="#{calendarBean.icon}"
buttonIconDisabled="#{icon.iconFileManagerReject}"
disabled="#{calendarBean.disabled}"
+ readonly="#{calendarBean.readonly}"
bypassUpdates="#{calendarBean.bypassUpdates}"
zindex="#{calendarBean.zindex}"
toolTipMode="#{calendarBean.toolTipMode}"
@@ -66,7 +68,10 @@
oninputselect="#{event.oninputselect}"
ontimeselect="#{event.ontimeselect}"
ontimeselected="#{event.ontimeselected}"
- binding="#{calendarBean.htmlCalendar}">
+ binding="#{calendarBean.htmlCalendar}"
+ horizontalOffset="#{calendarBean.horizontalOffset}"
+ verticalOffset="#{calendarBean.verticalOffset}"
+ >
<f:facet name="weekDay">
<f:verbatim>
<span style="padding: 2px; font-size: 4">{weekDayLabel +
@@ -97,6 +102,7 @@
</rich:calendar>
<rich:calendar id="calendarAjaxID" dataModel="#{calendarDataModel}"
+ firstWeekDay="#{calendarBean.firstWeekDay}"
locale="#{calendarBean.locale}" popup="#{calendarBean.popup}"
datePattern="#{calendarBean.pattern}"
weekDayLabels="#{calendarBean.weekDayLabels}"
@@ -118,6 +124,7 @@
buttonIcon="#{calendarBean.icon}"
buttonIconDisabled="#{icon.iconFileManagerReject}"
disabled="#{calendarBean.disabled}"
+ readonly="#{calendarBean.readonly}"
bypassUpdates="#{calendarBean.bypassUpdates}"
zindex="#{calendarBean.zindex}"
toolTipMode="#{calendarBean.toolTipMode}"
@@ -141,7 +148,10 @@
oninputkeyup="#{event.oninputkeyup}"
oninputselect="#{event.oninputselect}"
ontimeselect="#{event.ontimeselect}"
- ontimeselected="#{event.ontimeselected}">
+ ontimeselected="#{event.ontimeselected}"
+ horizontalOffset="#{calendarBean.horizontalOffset}"
+ verticalOffset="#{calendarBean.verticalOffset}"
+ >
<f:facet name="weekDay">
<f:verbatim>
Modified: trunk/test-applications/facelets/src/main/webapp/Calendar/CalendarProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Calendar/CalendarProperty.xhtml 2008-10-10 10:41:00 UTC (rev 10709)
+++ trunk/test-applications/facelets/src/main/webapp/Calendar/CalendarProperty.xhtml 2008-10-10 11:02:29 UTC (rev 10710)
@@ -36,10 +36,6 @@
<h:selectBooleanCheckbox value="#{calendarBean.showApplyButton}"
onchange="submit();"></h:selectBooleanCheckbox>
- <h:outputText value="showScrollerBar: "></h:outputText>
- <h:selectBooleanCheckbox value="#{calendarBean.showScrollerBar}"
- onchange="submit();"></h:selectBooleanCheckbox>
-
<h:outputText value="showWeeksBar: "></h:outputText>
<h:selectBooleanCheckbox value="#{calendarBean.showWeeksBar}"
onchange="submit();"></h:selectBooleanCheckbox>
@@ -54,7 +50,19 @@
<h:outputText value="cellWidth: "></h:outputText>
<h:inputText value="#{calendarBean.cellWidth}" onchange="submit();"></h:inputText>
- <h:outputText value="Custom day labels" />
+ <h:outputText value="firstWeekDay"></h:outputText>
+ <h:selectOneRadio value="#{calendarBean.firstWeekDay}"
+ onchange="submit();">
+ <f:selectItem itemLabel="1" itemValue="1" />
+ <f:selectItem itemLabel="2" itemValue="2" />
+ <f:selectItem itemLabel="3" itemValue="3" />
+ <f:selectItem itemLabel="4" itemValue="4" />
+ <f:selectItem itemLabel="5" itemValue="5" />
+ <f:selectItem itemLabel="6" itemValue="6" />
+ <f:selectItem itemLabel="7" itemValue="7" />
+ </h:selectOneRadio>
+
+ <h:outputText value="todayControlMode" />
<h:selectOneRadio value="#{calendarBean.todayControlMode}"
onchange="submit();">
<f:selectItem itemLabel="scroll" itemValue="scroll" />
@@ -180,6 +188,10 @@
<h:outputText value="Disabled:" />
<h:selectBooleanCheckbox value="#{calendarBean.disabled}"
onclick="submit()" />
+
+ <h:outputText value="Readonly:" />
+ <h:selectBooleanCheckbox value="#{calendarBean.readonly}"
+ onclick="submit()" />
<h:outputText value="Rendered:" />
<h:selectBooleanCheckbox value="#{calendarBean.rendered}"
Modified: trunk/test-applications/facelets/src/main/webapp/DropDownMenu/DropDownMenuProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/DropDownMenu/DropDownMenuProperty.xhtml 2008-10-10 10:41:00 UTC (rev 10709)
+++ trunk/test-applications/facelets/src/main/webapp/DropDownMenu/DropDownMenuProperty.xhtml 2008-10-10 11:02:29 UTC (rev 10710)
@@ -65,7 +65,7 @@
<h:outputText value="Direction:" />
<h:selectOneRadio value="#{dDMenu.direction}">
- <f:selectItem itemLabel="top-right" itemValue="top-right" />
+ <f:selectItem itemLabel="top-right" itemValue="top-right" />
<f:selectItem itemLabel="top-left" itemValue="top-left" />
<f:selectItem itemLabel="bottom-right" itemValue="bottom-right" />
<f:selectItem itemLabel="bottom-left" itemValue="bottom-left" />
@@ -75,10 +75,12 @@
<h:outputText value="GroupDirection:" />
<h:selectOneRadio value="#{dDMenu.groupDirection}">
- <f:selectItem itemLabel="top-up" itemValue="top-up" />
- <f:selectItem itemLabel="top-down" itemValue="top-down" />
- <f:selectItem itemLabel="bottom-up" itemValue="bottom-up" />
- <f:selectItem itemLabel="bottom-down" itemValue="bottom-down" />
+ <f:selectItem itemLabel="right" itemValue="right" />
+ <f:selectItem itemLabel="left" itemValue="left" />
+ <f:selectItem itemLabel="left-down" itemValue="left-down" />
+ <f:selectItem itemLabel="left-up" itemValue="left-up" />
+ <f:selectItem itemLabel="right-down" itemValue="right-down" />
+ <f:selectItem itemLabel="right-up" itemValue="right-up" />
<f:selectItem itemLabel="auto" itemValue="auto" />
<a4j:support event="onclick" reRender="ddmId" />
</h:selectOneRadio>
Modified: trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelectProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelectProperty.xhtml 2008-10-10 10:41:00 UTC (rev 10709)
+++ trunk/test-applications/facelets/src/main/webapp/InplaceSelect/InplaceSelectProperty.xhtml 2008-10-10 11:02:29 UTC (rev 10710)
@@ -101,12 +101,12 @@
value="cancel"></a4j:commandLink>
<br />
<a4j:commandLink
- onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.getValue()"
+ onclick="alert ($('formID:inplaceSelectSubviewID:inplaceSelectID').component.getValue())"
value="getValue"></a4j:commandLink>
<br />
<a4j:commandLink
- onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.setValue('setValue')"
- value="setValuel"></a4j:commandLink>
+ onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.setValue('passeds','passeds')"
+ value="setValue('passeds','passeds')"></a4j:commandLink>
<br />
<br />
<div style="FONT-WEIGHT: bold;">rich:findComponent</div>
16 years, 3 months
JBoss Rich Faces SVN: r10709 - in trunk/test-applications/jsp/src/main: webapp/Calendar and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tromanovich
Date: 2008-10-10 06:41:00 -0400 (Fri, 10 Oct 2008)
New Revision: 10709
Modified:
trunk/test-applications/jsp/src/main/java/calendar/CalendarBean.java
trunk/test-applications/jsp/src/main/webapp/Calendar/Calendar.jsp
trunk/test-applications/jsp/src/main/webapp/Calendar/CalendarProperty.jsp
Log:
Add "readonly" attribute for testing to Calendar page
Modified: trunk/test-applications/jsp/src/main/java/calendar/CalendarBean.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/calendar/CalendarBean.java 2008-10-10 10:28:26 UTC (rev 10708)
+++ trunk/test-applications/jsp/src/main/java/calendar/CalendarBean.java 2008-10-10 10:41:00 UTC (rev 10709)
@@ -202,7 +202,7 @@
pattern = "MMM d, yyyy";
jointPoint = "bottom-left";
direction = "bottom-right";
- readonly = true;
+ readonly = false;
enableManualInput = false;
showInput = true;
boundary = "inactive";
Modified: trunk/test-applications/jsp/src/main/webapp/Calendar/Calendar.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Calendar/Calendar.jsp 2008-10-10 10:28:26 UTC (rev 10708)
+++ trunk/test-applications/jsp/src/main/webapp/Calendar/Calendar.jsp 2008-10-10 10:41:00 UTC (rev 10709)
@@ -52,6 +52,7 @@
buttonIcon="#{calendarBean.icon}"
buttonIconDisabled="#{icon.iconFileManagerReject}"
disabled="#{calendarBean.disabled}"
+ readonly="#{calendarBean.readonly}"
bypassUpdates="#{calendarBean.bypassUpdates}"
zindex="#{calendarBean.zindex}"
toolTipMode="#{calendarBean.toolTipMode}"
@@ -82,7 +83,8 @@
oninputkeyup="#{event.oninputkeyup}"
oninputselect="#{event.oninputselect}"
ontimeselect="#{event.ontimeselect}"
- ontimeselected="#{event.ontimeselected}">
+ ontimeselected="#{event.ontimeselected}"
+ >
<f:facet name="weekDay">
<f:verbatim>
<span style="padding: 2px; font-size: 4">{weekDayLabel +
@@ -136,6 +138,7 @@
buttonIcon="#{calendarBean.icon}"
buttonIconDisabled="#{icon.iconFileManagerReject}"
disabled="#{calendarBean.disabled}"
+ readonly="#{calendarBean.readonly}"
bypassUpdates="#{calendarBean.bypassUpdates}"
zindex="#{calendarBean.zindex}"
toolTipMode="#{calendarBean.toolTipMode}"
Modified: trunk/test-applications/jsp/src/main/webapp/Calendar/CalendarProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Calendar/CalendarProperty.jsp 2008-10-10 10:28:26 UTC (rev 10708)
+++ trunk/test-applications/jsp/src/main/webapp/Calendar/CalendarProperty.jsp 2008-10-10 10:41:00 UTC (rev 10709)
@@ -204,6 +204,10 @@
<h:outputText value="Disabled:" />
<h:selectBooleanCheckbox value="#{calendarBean.disabled}"
onclick="submit()" />
+
+ <h:outputText value="Readonly:" />
+ <h:selectBooleanCheckbox value="#{calendarBean.readonly}"
+ onclick="submit()" />
<h:outputText value="Rendered:" />
<h:selectBooleanCheckbox value="#{calendarBean.rendered}"
16 years, 3 months
JBoss Rich Faces SVN: r10708 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-10-10 06:28:26 -0400 (Fri, 10 Oct 2008)
New Revision: 10708
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java
Log:
AjaxStatus: failure messages added
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-10-10 09:59:27 UTC (rev 10707)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-10-10 10:28:26 UTC (rev 10708)
@@ -112,10 +112,10 @@
String startFacetId = statusElemId + ".start";
String stopFacetId = statusElemId + ".stop";
- assertStyleAttribute(startFacetId, "color: red");
+ assertStyleAttribute(startFacetId, "color: red", "Style attribute was not output to client for start facet");
assertClassNames(startFacetId, new String[] {"start-class"}, "Class attribute was not output to client for start facet", true);
- assertStyleAttribute(stopFacetId, "color: green");
+ assertStyleAttribute(stopFacetId, "color: green", "Style attribute was not output to client for stop facet");
assertClassNames(stopFacetId, new String[] {"stop-class"}, "Class attribute was not output to client for stop facet", true);
}
@@ -147,8 +147,8 @@
String statusElemId = getParentId() + "_form:" + STATUS_1_ID;
- assertStyleAttribute(statusElemId, "font-size: 13px");
- assertClassNames(statusElemId, new String[] { "noclass" }, "Class attribute was not output to client ", true);
+ assertStyleAttribute(statusElemId, "font-size: 13px", "Style attribute was not output to client");
+ assertClassNames(statusElemId, new String[] { "noclass" }, "Class attribute was not output to client", true);
}
public String getTestUrl() {
16 years, 3 months
JBoss Rich Faces SVN: r10707 - trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: piotr.buda
Date: 2008-10-10 05:59:27 -0400 (Fri, 10 Oct 2008)
New Revision: 10707
Modified:
trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
Log:
Fixed passing of attributes from rich:column to EDT renderer (style, styleClass) and EDT columnClasses attribute.
Modified: trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
===================================================================
--- trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-10-10 09:51:57 UTC (rev 10706)
+++ trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-10-10 09:59:27 UTC (rev 10707)
@@ -594,6 +594,7 @@
encodeGroupRow(context, table, holder);
}
holder.setFirstRow(false);
+
while (iter.hasNext()) {
column = iter.next();
// Start new row for first column - expect a case of the detail
@@ -605,41 +606,44 @@
}
// TODO PKA CHANGE COLUMN RENDERER TO GET RID OF && false
- if (false && (column instanceof Column)) {
- boolean breakBefore = ((Column) column).isBreakBefore()
- || isRow;
- if (breakBefore && !first) {
- // close current row
- writer.endElement(HTML.TR_ELEMENT);
- // reset columns counter.
- currentColumn = 0;
- // Start new row, expect a case of the detail table, wich
- // will be insert own row.
- if (!isRow) {
- holder.nextRow();
- encodeRowStart(context, holder.getRowClass(), table,
- holder, writer);
- }
- }
- encodeCellChildren(context, column,
- first ? getFirstRowSkinClass() : null,
- getRowSkinClass(), holder.getRowClass(),
- getCellSkinClass(), holder
- .getColumnClass(currentColumn));
- // renderChild(context, column);
- if (isRow && iter.hasNext()) {
- // Start new row for remained columns.
- holder.nextRow();
- encodeRowStart(context, holder.getRowClass(), table,
- holder, writer);
- // reset columns counter.
- currentColumn = -1;
- }
- } else if (column.isRendered()) {
+// if (false && (column instanceof Column)) {
+// boolean breakBefore = ((Column) column).isBreakBefore()
+// || isRow;
+// if (breakBefore && !first) {
+// // close current row
+// writer.endElement(HTML.TR_ELEMENT);
+// // reset columns counter.
+// currentColumn = 0;
+// // Start new row, expect a case of the detail table, wich
+// // will be insert own row.
+// if (!isRow) {
+// holder.nextRow();
+// encodeRowStart(context, holder.getRowClass(), table,
+// holder, writer);
+// }
+// }
+// encodeCellChildren(context, column,
+// first ? getFirstRowSkinClass() : null,
+// getRowSkinClass(), holder.getRowClass(),
+// getCellSkinClass(), holder
+// .getColumnClass(currentColumn));
+// // renderChild(context, column);
+// if (isRow && iter.hasNext()) {
+// // Start new row for remained columns.
+// holder.nextRow();
+// encodeRowStart(context, holder.getRowClass(), table,
+// holder, writer);
+// // reset columns counter.
+// currentColumn = -1;
+// }
+// } else
+ if (column.isRendered()) {
// UIColumn don't have own renderer
writer.startElement(HTML.td_ELEM, table);
getUtils().encodeId(context, column);
- encodeStyleClass(writer, null, getCellSkinClass(), null, null);
+ encodeStyleClass(writer, null, getCellSkinClass(), holder.getColumnClass(currentColumn),
+ column.getAttributes().get("styleClass"));
+ encodeStyle(writer, null, null, null, column.getAttributes().get("style"));
// TODO - encode column attributes.
writer.startElement(HTML.DIV_ELEM, table);
writer.writeAttribute("class", "extdt-cell-div", null);
16 years, 3 months
JBoss Rich Faces SVN: r10706 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-10-10 05:51:57 -0400 (Fri, 10 Oct 2008)
New Revision: 10706
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/layout.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
for compatibility with js optimization
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/layout.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-10-09 15:44:53 UTC (rev 10705)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-10-10 09:51:57 UTC (rev 10706)
@@ -997,8 +997,9 @@
if (null != message && message.length() > 0) {
Assert.fail(message);
}
+ eventsExpected.clear();
}
-
+
public void autoTest(Template template, String component, List<SeleniumEvent> events, Map<String , String> attributes) {
selenium.open(protocol + "://" + host + ":" + port + "/" + APPLICATION_NAME + filterPrefix + "/pages/_autotest/autotestsetup.xhtml");
waitForPageToLoad();
16 years, 3 months
JBoss Rich Faces SVN: r10705 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-10-09 11:44:53 -0400 (Thu, 09 Oct 2008)
New Revision: 10705
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataScrollerBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/layout.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScroller.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/test.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java
Log:
DataScrolle Test
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataScrollerBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataScrollerBean.java 2008-10-09 14:36:29 UTC (rev 10704)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataScrollerBean.java 2008-10-09 15:44:53 UTC (rev 10705)
@@ -7,6 +7,7 @@
package org.ajax4jsf.bean;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
import javax.faces.event.ActionEvent;
@@ -31,10 +32,53 @@
private Integer page;
+ private String reRender = null;
+
+ private Boolean limitToList = false;
+
+ private String input;
+
+ private String onComplete = null;
+
+ private Boolean bypassUpdates = false;
+
public DataScrollerBean() {
init();
}
+ public String maxPages() {
+ maxPages = 5;
+ return null;
+ }
+
+ public String rendered() {
+ rendered = false;
+ return null;
+ }
+
+ public String testReRender() {
+ reRender = "time";
+ onComplete = "window.dataScrollerComplete = true";
+ return null;
+ }
+
+ public String testByPassUpdates() {
+ bypassUpdates = true;
+ reRender = "input";
+ return null;
+ }
+
+ public String testLimitToList1() {
+ limitToList = true;
+ return null;
+ }
+
+ public String testLimitToList2() {
+ limitToList = true;
+ reRender = "scroller, tbl";
+ return null;
+ }
+
private void init() {
data = new ArrayList();
for (int i = 0; i < totalRows; i++) {
@@ -43,9 +87,26 @@
}
}
+ public void reset() {
+ tableRows = 1;
+ totalRows = 10;
+ maxPages = 10;
+ rendered = true;
+ page = null;
+ data = null;
+ reRender = null;
+ limitToList = false;
+ onComplete = null;
+ bypassUpdates = false;
+ }
+
public void apply(ActionEvent event) {
init();
}
+
+ public String getTime() {
+ return String.valueOf(new Date().getTime());
+ }
/**
* @return the rendered
@@ -65,6 +126,9 @@
* @return the data
*/
public List getData() {
+ if (data == null) {
+ init();
+ }
return data;
}
@@ -130,8 +194,44 @@
public void setPage(Integer page) {
this.page = page;
}
-
-
-
+ public String getReRender() {
+ return reRender;
+ }
+
+ public void setReRender(String reRender) {
+ this.reRender = reRender;
+ }
+
+ public Boolean getLimitToList() {
+ return limitToList;
+ }
+
+ public void setLimitToList(Boolean limitToList) {
+ this.limitToList = limitToList;
+ }
+
+ public String getInput() {
+ return input;
+ }
+
+ public void setInput(String input) {
+ this.input = input;
+ }
+
+ public String getOnComplete() {
+ return onComplete;
+ }
+
+ public void setOnComplete(String onComplete) {
+ this.onComplete = onComplete;
+ }
+
+ public Boolean getBypassUpdates() {
+ return bypassUpdates;
+ }
+
+ public void setBypassUpdates(Boolean bypassUpdates) {
+ this.bypassUpdates = bypassUpdates;
+ }
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/layout.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScroller.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScroller.xhtml 2008-10-09 14:36:29 UTC (rev 10704)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScroller.xhtml 2008-10-09 15:44:53 UTC (rev 10705)
@@ -14,10 +14,16 @@
<td>Total Rows:</td><td><h:inputText value="#{dataScrollerBean.totalRows}" /></td>
</tr>
<tr>
- <td>Table Rows:</td><td><h:inputText value="#{dataScrollerBean.tableRows}" /></td>
+ <td>Table Rows:</td><td><h:inputText id="tableRow" value="#{dataScrollerBean.tableRows}" /></td>
</tr>
</table>
<h:commandButton id="apply" actionListener="#{dataScrollerBean.apply}" value="apply"/>
+ <h:commandButton id="maxP" action="#{dataScrollerBean.maxPages}" value="Test maxPages" />
+ <h:commandButton id="rendered" action="#{dataScrollerBean.rendered}" value="Test rendered" />
+ <h:commandButton id="rerender" action="#{dataScrollerBean.testReRender}" value="Test reRender" />
+ <h:commandButton id="limit2list1" action="#{dataScrollerBean.testLimitToList1}" value="Test Limit2List1" />
+ <h:commandButton id="limit2list2" action="#{dataScrollerBean.testLimitToList2}" value="Test Limit2List2" />
+ <h:commandButton id="bypassUpdates" action="#{dataScrollerBean.testByPassUpdates}" value="Test bypassUpdates" />
</h:form>
<br/>
<h:form id="_data">
@@ -33,9 +39,15 @@
onmouseout="EventQueue.fire('onmouseout')"
onmouseover="EventQueue.fire('onmouseover')"
onmouseup="EventQueue.fire('onmouseup')"
+ limitToList="#{dataScrollerBean.limitToList}"
+ reRender="#{dataScrollerBean.reRender}"
+ oncomplete="#{dataScrollerBean.onComplete}"
+ bypassUpdates="#{dataScrollerBean.bypassUpdates}"
/>
-
- <br/><br/>
+
+
+ <br/>
+ <br/>
<rich:dataTable id="tbl" value="#{dataScrollerBean.data}" rows="#{dataScrollerBean.tableRows}" var="var">
<rich:column>
<f:facet name="header">
@@ -50,6 +62,12 @@
<h:outputText value="#{var[1]}" />
</rich:column>
</rich:dataTable>
+
+ <br/><br/>
+
+ <h:outputText id="time" value="#{dataScrollerBean.time}"></h:outputText>
+ <h:inputText id="input" value="#{dataScrollerBean.input}"></h:inputText>
+
</h:form>
</ui:define>
</ui:composition>
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/test.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-10-09 14:36:29 UTC (rev 10704)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-10-09 15:44:53 UTC (rev 10705)
@@ -1056,4 +1056,11 @@
assertEvents(assertevent);
}
+
+ public String getElementById(String id) {
+ StringBuffer b = new StringBuffer("$('");
+ b.append(id);
+ b.append("')");
+ return b.toString();
+ }
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java 2008-10-09 14:36:29 UTC (rev 10704)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java 2008-10-09 15:44:53 UTC (rev 10705)
@@ -7,12 +7,10 @@
package org.richfaces.testng;
import java.util.ArrayList;
-import java.util.HashMap;
+import java.util.Arrays;
import java.util.List;
-import java.util.Map;
import org.ajax4jsf.template.Template;
-import org.richfaces.SeleniumEvent;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -24,25 +22,242 @@
*/
public class DataScrollerTest extends SeleniumTestBase {
+ static final String RESET_METHOD_ME = "#{dataScrollerBean.reset}";
+
String dataScrollerId;
String dataScrollerTableId;
String dataTableId;
+ static final String [] activePageClasses = new String[] {
+ "dr-dscr-act","rich-datascr-act"
+ };
+
+ static final String [] inactivePageClasses = new String[] {
+ "dr-dscr-inact","rich-datascr-inact"
+ };
+ static final String [] activeForwardClasses = new String[] {
+ "dr-dscr-button","rich-datascr-button"
+ };
+
+ static final String [] inactiveForwardClasses = new String [] {
+ "dr-dscr-button-dsbld",
+ "rich-datascr-button-dsbld",
+ "dr-dscr-button",
+ "rich-datascr-button"
+ };
+
@Test
- public void testDataScroller(Template template) {
- renderPage(template);
- String parentId = getParentId();
+ public void testBypassUpdates(Template template) {
+ renderPage(template, RESET_METHOD_ME);
+ initIDs(getParentId(), template);
+
+ String inputId = getParentId() + "_data:input";
+ String commandId = getParentId() + "_controls:bypassUpdates";
+
+ clickCommandAndWait(commandId);
+
+ setValueById(inputId, "bypassUpdates = true");
+ clickControl(4);
+ AssertTextEquals(inputId, "", "BypassUpdates attribute does not work.");
+
+ }
+
+ @Test
+ public void testLimitToList(Template template) {
+ renderPage(template, RESET_METHOD_ME);
+ initIDs(getParentId(), template);
+
+ String commandId = getParentId() + "_controls:limit2list1";
+ clickCommandAndWait(commandId);
+
+ String text = selenium.getTable("id=" + dataTableId + "."+1+".1");
+
+ clickControl(4);
+
+ Assert.assertEquals(selenium.getTable("id=" + dataTableId + "."+1+".1"), text, "LimitToList does not work. Datatable has been rerendered");
+
+ commandId = getParentId() + "_controls:limit2list2";
+ clickCommandAndWait(commandId);
+
+ text = selenium.getTable("id=" + dataTableId + "."+1+".1");
+ clickControl(5);
+ Assert.assertFalse(selenium.getTable("id=" + dataTableId + "."+1+".1").equals(text), "LimitToList does not work. Datatable has not been updated");
+
+ }
+
+ @Test
+ public void testReRender(Template template) {
+ renderPage(template, RESET_METHOD_ME);
+ initIDs(getParentId(), template);
+
+ String commandId = getParentId() + "_controls:rerender";
+ clickCommandAndWait(commandId);
+
+ String timeId = getParentId() + "_data:time";
+ String text = getTextById(timeId);
+
+ clickControl(4);
+
+ String scr = runScript("window.dataScrollerComplete");
+ if (!scr.equals("true")) {
+ Assert.fail("Oncomplete attribute does not work");
+ }
+
+ AssertTextNotEquals(timeId, text, "ReRender attribute does not work");
+ }
+
+ @Test
+ public void testRendered(Template template) {
+ renderPage(template, RESET_METHOD_ME);
+ initIDs(getParentId(), template);
+
+ String commandId = getParentId() + "_controls:rendered";
+ clickCommandAndWait(commandId);
+
+ AssertNotPresent(dataScrollerId, "Rendered attribute does not work");
+ AssertNotPresent(dataScrollerTableId, "Rendered attribute does not work");
+ }
+
+
+ @Test
+ public void testDataScrollerRendering(Template template) {
+ renderPage(template, RESET_METHOD_ME);
+ initIDs(getParentId(), template);
+
+ testRendering();
+ testHTMLEvent(dataScrollerId);
+ }
+
+ @Test
+ public void testDataScrollerPagination(Template template) {
+ renderPage(template, RESET_METHOD_ME);
+ initIDs(getParentId(), template);
+
+ testPageCount(16);
+
+ clickControl(5);
+ testData(1, "Page 3");
+
+ assertClassNames(getPageLinkRefScript(5), activePageClasses, "'3' link should current", false);
+ assertClassNames(getPageLinkRefScript(3), inactivePageClasses, "'1' link should be inactive", false);
+ assertClassNames(getPageLinkRefScript(0), activeForwardClasses, "'��' control should be accessible", false);
+ assertClassNames(getPageLinkRefScript(1), activeForwardClasses, "'�' control should be accessible", false);
+
+ clickControl(10);
+ testData(1, "Page 8");
+ assertClassNames(getPageLinkRefScript(10), activePageClasses, "'8' link should current", false);
+
+ clickControl(15);
+ testData(1, "Page 10");
+ assertClassNames(getPageLinkRefScript(15), inactiveForwardClasses, "'��' control should be inactive", false);
+ assertClassNames(getPageLinkRefScript(14), inactiveForwardClasses, "'�' control should be inactive", false);
+
+ clickControl(1);
+ testData(1, "Page 9");
+ assertClassNames(getPageLinkRefScript(0), activeForwardClasses, "'��' control should be active", false);
+ assertClassNames(getPageLinkRefScript(1), activeForwardClasses, "'�' control should be active", false);
+ assertClassNames(getPageLinkRefScript(11), activePageClasses, "'9' link should be current", false);
+
+ clickControl(0);
+ testData(1, "Page 1");
+ assertClassNames(getPageLinkRefScript(3), activePageClasses, "'1' link should be current", false);
+ assertClassNames(getPageLinkRefScript(4), inactivePageClasses, "'2' link should be inactive", false);
+
+ clickControl(14);
+ testData(1, "Page 2");
+ assertClassNames(getPageLinkRefScript(3), inactivePageClasses, "'1' link should be inactive", false);
+ assertClassNames(getPageLinkRefScript(4), activePageClasses, "'2' link should be current", false);
+
+
+ }
+
+ @Test
+ public void testMaxPagesAttr(Template template) {
+ renderPage(template, RESET_METHOD_ME);
+ initIDs(getParentId(), template);
+
+ testPageCount(16);
+
+ String buttonId = getParentId() + "_controls:maxP";
+ clickCommandAndWait(buttonId);
+
+ testPageCount(11);
+
+ String text = selenium.getTable("id=" + dataScrollerTableId + ".0.5");
+ Assert.assertEquals(text, "3", "'3' link should be in the middle");
+
+ clickControl(7);
+ testPageCount(11);
+ text = selenium.getTable("id=" + dataScrollerTableId + ".0.5");
+ Assert.assertEquals(text, "5", "'5' link should be in the middle");
+ testData(1, "Page 5");
+
+
+ clickControl(10);
+ testPageCount(11);
+ text = selenium.getTable("id=" + dataScrollerTableId + ".0.7");
+ Assert.assertEquals(text, "10");
+ text = selenium.getTable("id=" + dataScrollerTableId + ".0.3");
+ Assert.assertEquals(text, "6");
+ testData(1, "Page 10");
+
+ clickControl(3);
+ testPageCount(11);
+ text = selenium.getTable("id=" + dataScrollerTableId + ".0.5");
+ Assert.assertEquals(text, "6");
+ text = selenium.getTable("id=" + dataScrollerTableId + ".0.3");
+ Assert.assertEquals(text, "4");
+ testData(1, "Page 6");
+
+ clickControl(1);
+ clickControl(1);
+ testPageCount(11);
+ text = selenium.getTable("id=" + dataScrollerTableId + ".0.5");
+ Assert.assertEquals(text, "4");
+ text = selenium.getTable("id=" + dataScrollerTableId + ".0.3");
+ Assert.assertEquals(text, "2");
+ testData(1, "Page 4");
+
+
+ }
+
+
+ @Test
+ public void testChangedData(Template template) {
+ renderPage(template, RESET_METHOD_ME);
+ initIDs(getParentId(), template);
+
+ String tableRowsId = getParentId() + "_controls:tableRow";
+ setValueById(tableRowsId, "2");
+
+ String applyId = getParentId() + "_controls:apply";
+ clickCommandAndWait(applyId);
+
+ testPageCount(11);
+ assertRowsCount(2, dataTableId);
+
+ clickControl(7);
+ String text = selenium.getTable("id=" + dataScrollerTableId + ".0.7");
+ Assert.assertEquals(text, "5", "5th page should be displayed");
+ assertRowsCount(2, dataTableId);
+
+ clickControl(3);
+ text = selenium.getTable("id=" + dataScrollerTableId + ".0.3");
+ Assert.assertEquals(text, "1", "1st page should be displayed");
+ assertRowsCount(2, dataTableId);
+
+
+ }
+
+ private void initIDs(String parentId, Template template) {
dataScrollerId = parentId + "_data:scroller";
dataScrollerTableId = parentId + "_data:scroller_table";
//FIXME: currently dataTableId is invalid (dataTableId + ':0'). May be it's cause of problem with component state storing inside dataTable.
dataTableId = (!template.getName().equals(Template.DATA_TABLE.getName())) ? parentId + "_data:tbl" : parentId + "_data:tbl:0";
-
- testRendering();
- testHTMLEvent(dataScrollerId);
}
private void testHTMLEvent(String id) {
@@ -63,6 +278,7 @@
assertEvents(event);
+
}
private void testRendering() {
@@ -76,78 +292,50 @@
"rich-dtascroller-table"},
"DataScroller rendering failed: ", true);
- testPageCount();
+ testPageCount(16);
testControls();
testData(1,"Page 1");
}
- private void testPageCount() {
- assertColumnsCount(16, dataScrollerTableId, "DataScroller inner table contains invalid columns count");
- String text = selenium.getTable("id=" + dataScrollerTableId + ".0.3");
- Assert.assertEquals("1", text, "DataScroller does not contain first page link or its position is invalid");
- text = selenium.getTable("id=" + dataScrollerTableId + ".0.7");
- Assert.assertEquals("5", text, "DataScroller does not contain 5th page link or its position is invalid");
- text = selenium.getTable("id=" + dataScrollerTableId + ".0.12");
- Assert.assertEquals("10", text, "DataScroller does not contain 10th page link or its position is invalid");
+ private void testPageCount(int n) {
+ assertColumnsCount(n, dataScrollerTableId, "DataScroller inner table contains invalid columns count");
}
private void testControls() {
// Check '��' link
String text = selenium.getTable("id=" + dataScrollerTableId + ".0.0");
Assert.assertEquals("��", text, "DataScroller does not contain '��' link or its position is invalid");
- assertClassNames(getPageLinkRefScript(0),new String []
- {"dr-dscr-button-dsbld",
- "rich-datascr-button-dsbld",
- "dr-dscr-button",
- "rich-datascr-button"
- },
+ assertClassNames(getPageLinkRefScript(0),inactiveForwardClasses,
"DataScroller rendering failed: ", false);
// Check '�' link
text = selenium.getTable("id=" + dataScrollerTableId + ".0.1");
Assert.assertEquals("�", text, "DataScroller does not contain '�' link or its position is invalid");
- assertClassNames(getPageLinkRefScript(1),new String []
- {"dr-dscr-button-dsbld",
- "rich-datascr-button-dsbld",
- "dr-dscr-button",
- "rich-datascr-button"
- },
+ assertClassNames(getPageLinkRefScript(1),inactiveForwardClasses,
"DataScroller rendering failed: ", false);
// Check '1' link
text = selenium.getTable("id=" + dataScrollerTableId + ".0.3");
Assert.assertEquals("1", text, "DataScroller does not contain '1' link or its position is invalid");
- assertClassNames(getPageLinkRefScript(3),new String []
- {"dr-dscr-act",
- "rich-datascr-act"
- },
+ assertClassNames(getPageLinkRefScript(3),activePageClasses,
"DataScroller rendering failed: ", false);
// Check '5' link
text = selenium.getTable("id=" + dataScrollerTableId + ".0.7");
Assert.assertEquals("5", text, "DataScroller does not contain '5' link or its position is invalid");
- assertClassNames(getPageLinkRefScript(7),new String []
- {"dr-dscr-inact",
- "rich-datascr-inact"
- },
+ assertClassNames(getPageLinkRefScript(7),inactivePageClasses,
"DataScroller rendering failed: ", false);
// Check '�' link
text = selenium.getTable("id=" + dataScrollerTableId + ".0.14");
Assert.assertEquals("�", text, "DataScroller does not contain '�' link or its position is invalid");
- assertClassNames(getPageLinkRefScript(14),new String []
- {"dr-dscr-button",
- "rich-datascr-button"
- },
+ assertClassNames(getPageLinkRefScript(14),activeForwardClasses,
"DataScroller rendering failed: ", false);
// Check '��' link
text = selenium.getTable("id=" + dataScrollerTableId + ".0.15");
Assert.assertEquals("��", text, "DataScroller does not contain '��' link or its position is invalid");
- assertClassNames(getPageLinkRefScript(15),new String []
- {"dr-dscr-button",
- "rich-datascr-button"
- },
+ assertClassNames(getPageLinkRefScript(15),activeForwardClasses,
"DataScroller rendering failed: ", false);
}
@@ -170,6 +358,14 @@
b.append("]");
return b.toString();
}
+
+ private void clickControl(int n) {
+ StringBuffer b = new StringBuffer();
+ b.append(getPageLinkRefScript(n));
+ b.append(".onclick();");
+ selenium.getEval(b.toString());
+ waitForAjaxCompletion();
+ }
/* (non-Javadoc)
* @see org.richfaces.SeleniumTestBase#getTestUrl()
16 years, 3 months