JBoss Rich Faces SVN: r10774 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-10-16 09:52:42 -0400 (Thu, 16 Oct 2008)
New Revision: 10774
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/simpleTogglePanel/simpleTogglePanelAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java
Log:
SimpleTogglePanel: ajaxSingle tests
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/simpleTogglePanel/simpleTogglePanelAutoTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2008-10-16 13:46:30 UTC (rev 10773)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2008-10-16 13:52:42 UTC (rev 10774)
@@ -114,7 +114,22 @@
checkUpdateModel(false);
}
-
+
+ /**
+ * Important! Override {@link SeleniumTestBase#setInternalValidationFailed()} method if you use this method
+ */
+ public void testAjaxSingleWithInternalValidationFailed() {
+ reset();
+ setupControl(TestSetupEntry.ajaxSingle, Boolean.TRUE);
+ clickLoad();
+
+ setInternalValidationFailed();
+ base.sendAjax();
+
+ checkActionListener(false);
+ checkUpdateModel(false);
+ }
+
public void testImmediate() {
reset();
setupControl(TestSetupEntry.immediate, Boolean.TRUE);
@@ -269,7 +284,11 @@
private void setExtrenalValidationFailed() {
base.setValueById(base.getParentId() + AUTOTEST_FORM_ID + INPUT_ID, "");
}
-
+
+ private void setInternalValidationFailed() {
+ base.setInternalValidationFailed();
+ }
+
private void setupControl(TestSetupEntry attr, Object o) {
final String idPrefix = "_auto_";
String controlId = base.getParentId() + AUTOTEST_CONTROLS_FORM_ID + idPrefix + attr.name;
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-16 13:46:30 UTC (rev 10773)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-10-16 13:52:42 UTC (rev 10774)
@@ -1006,8 +1006,15 @@
*/
public void sendAjax() {
}
-
+
/**
+ * This call back has to move auto test component into invalid state.
+ * Used for auto testing only.
+ */
+ public void setInternalValidationFailed() {
+ }
+
+ /**
* Returns the array of components' ids that are rerendering after ajax request from the component.
* This method should be overridden for auto test
*/
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java 2008-10-16 13:46:30 UTC (rev 10773)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SimpleTogglePanelTest.java 2008-10-16 13:52:42 UTC (rev 10774)
@@ -147,12 +147,34 @@
assertClassNames(bodyDivId, new String[] { "body-class" }, "bodyClass attribute was not output to client", true);
}
+ @Test
+ public void testAjaxSingle(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test ajaxSingle attribute");
+ tester.testAjaxSingle();
+ }
+
+ @Test
+ public void testAjaxSingleWithInternalValidationFailed(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test ajaxSingle attribute in case of invalid children state");
+ tester.testAjaxSingleWithInternalValidationFailed();
+ }
+
@Override
public void sendAjax() {
clickAjaxCommandAndWait(getAutoTester(this).getClientId(AutoTester.COMPONENT_ID) + "_header");
}
@Override
+ public void setInternalValidationFailed() {
+ String childCompId = getAutoTester(this).getClientId("") + "child";
+ setValueById(childCompId, "");
+ }
+
+ @Override
public String getAutoTestUrl() {
return "pages/simpleTogglePanel/simpleTogglePanelAutoTest.xhtml";
}
16 years, 11 months
JBoss Rich Faces SVN: r10773 - in trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts: tiny_mce and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-10-16 09:46:30 -0400 (Thu, 16 Oct 2008)
New Revision: 10773
Modified:
trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js
trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/tiny_mce/tiny_mce_src.js
Log:
editor resource loader changes
Modified: trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js
===================================================================
--- trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js 2008-10-16 11:14:31 UTC (rev 10772)
+++ trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js 2008-10-16 13:46:30 UTC (rev 10773)
@@ -1,5 +1,6 @@
if (!window.Richfaces) window.Richfaces = {};
Richfaces.Editor = {};
+Richfaces.Editor.REGEXP_CSS = /(\/tiny_mce\/(?:themes|plugins)\/[\w\.\\\/]*[\w\.]+\.)(c|C)[sS]{2}$/;
Richfaces.Editor.preInit = {extSuffix:".jsf"};
/*Richfaces.Editor.getResourceURL = function (baseURL, type) {
return Richfaces.Editor.ResourceHTML.replace("$1", baseURL);
Modified: trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/tiny_mce/tiny_mce_src.js
===================================================================
--- trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/tiny_mce/tiny_mce_src.js 2008-10-16 11:14:31 UTC (rev 10772)
+++ trunk/sandbox/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/tiny_mce/tiny_mce_src.js 2008-10-16 13:46:30 UTC (rev 10773)
@@ -18,10 +18,13 @@
t.isGecko = !t.isWebKit && /Gecko/.test(ua);
t.isMac = ua.indexOf('Mac') != -1;
+ // RF: added by PY
if (Richfaces.Editor && Richfaces.Editor.preInit)
{
t.extSuffix = Richfaces.Editor.preInit.extSuffix;
}
+ // RF: end
+
// TinyMCE .NET webcontrol might be setting the values for TinyMCE
if (w.tinyMCEPreInit) {
t.suffix = tinyMCEPreInit.suffix;
@@ -412,7 +415,11 @@
_addVer : function(u) {
var v;
+ // RF: added by PY
+ u = u.replace(Richfaces.Editor.REGEXP_CSS, function($1,$2,$3){alert($2);return $2+($3=='c' ? "xcss":"XCSS");});
if (this.extSuffix) u += this.extSuffix;
+ // RF: end
+
if (!this.query)
return u;
16 years, 11 months
JBoss Rich Faces SVN: r10772 - in trunk/ui/columns/src: main/java/org/richfaces/taglib and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-10-16 07:14:31 -0400 (Thu, 16 Oct 2008)
New Revision: 10772
Modified:
trunk/ui/columns/src/main/java/org/richfaces/el/ELBuilder.java
trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java
trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsTag.java
trunk/ui/columns/src/test/java/org/richfaces/el/ELBuilderTest.java
Log:
Columns: fix EL Builder
Modified: trunk/ui/columns/src/main/java/org/richfaces/el/ELBuilder.java
===================================================================
--- trunk/ui/columns/src/main/java/org/richfaces/el/ELBuilder.java 2008-10-16 11:01:58 UTC (rev 10771)
+++ trunk/ui/columns/src/main/java/org/richfaces/el/ELBuilder.java 2008-10-16 11:14:31 UTC (rev 10772)
@@ -24,10 +24,10 @@
Log log = LogFactory.getLog(ELBuilder.class);
/** Original value expression string */
- String orig;
+ String [] orig;
/** Result buffer */
- StringBuffer res = new StringBuffer("#{");
+ StringBuffer res = new StringBuffer();
int l;
@@ -47,7 +47,9 @@
int indexL;
+ boolean isLiteral;
+ String postFix;
/**
* Constructor
@@ -59,12 +61,11 @@
*/
public ELBuilder(String orig, String var, String index, String varR,
String indexR) {
- this.orig = trimEL(orig);
+ this.orig = orig.split("#");
this.var = var;
this.index = index;
this.varReplacement = varR;
this.indexReplacement = indexR;
- l = this.orig.length();
varL = var.length();
indexL = index.length();
@@ -76,8 +77,20 @@
*/
public String parse() {
try {
- internalParse(orig);
- res.append("}");
+ for (String s : orig) {
+ if (s != null && s.trim().length() > 0) {
+ String trim = trimEL(s);
+ if (!isLiteral) {
+ l = trim.length();
+ res.append("#{");
+ internalParse(trim);
+ res.append("}");
+ res.append(postFix);
+ }else {
+ res.append(s);
+ }
+ }
+ }
}catch (Exception e) {
log.error("Error occured during ValueExpression parsing. Keep old expression. " + e);
res.append(orig);
@@ -105,18 +118,44 @@
}
/**
- * Removes '#', '{', '}' chars from expression
+ * Evaluates expression body
* @param orig - original expression
* @return
*/
- public static String trimEL(String orig) {
- if (orig.trim().startsWith("#")) {
- orig = orig.substring(1).trim();
- if (orig.startsWith("{") && orig.endsWith("}")) {
- orig = orig.substring(1, orig.length() - 1);
+ private String trimEL(String orig) {
+ int end = orig.lastIndexOf("}");
+ if (orig.startsWith("{") && end != -1) {
+ isLiteral = false;
+ postFix = (end + 1 < orig.length()) ? orig.substring(end + 1) : "";
+ return orig.substring(1, end);
+ }
+ isLiteral = true;
+ return orig;
+ }
+
+ /**
+ * Returns var replacement
+ * @param expr
+ * @return
+ */
+ public static String getVarReplacement(String expr) {
+ int start = 0;
+ int end = 0;
+ int l = expr.length();
+ boolean f = false;
+ boolean f2 = true;
+ for (int i = 0; i < l; i++) {
+ char c = expr.charAt(i);
+ if (c == '#') {
+ f = true;
+ }else if (c == '}') {
+ end = i;
+ }else if (c == '{' && f && f2) {
+ start = (i + 1 < l) ? i + 1 : i;
+ f2 = false;
}
}
- return orig;
+ return (end > start) ? expr.substring(start, end) : null;
}
private int internalParse(String s) {
@@ -127,11 +166,11 @@
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c == firstIndex) {
- i = parseIndex(i, c);
+ i = parseIndex(s, i, c);
} else if (c == firstVar) {
- i = parseVar(i, c);
+ i = parseVar(s, i, c);
} else if (isQuote(c)) {
- i = parseString(i, c);
+ i = parseString(s, i, c);
} else {
res.append(c);
}
@@ -139,10 +178,10 @@
return 0;
}
- private int parseIndex(int i, char c) {
- if (orig.indexOf(index, i) == i) {
- Character before = (i != 0) ? orig.charAt(i - 1) : null;
- Character after = (i + indexL < l) ? orig.charAt(i + indexL) : null;
+ private int parseIndex(String s, int i, char c) {
+ if (s.indexOf(index, i) == i) {
+ Character before = (i != 0) ? s.charAt(i - 1) : null;
+ Character after = (i + indexL < l) ? s.charAt(i + indexL) : null;
if (isIndex(c, before, after)) {
res.append(indexReplacement);
return i + indexL - 1;
@@ -155,10 +194,10 @@
return i;
}
- private int parseVar(int i, char c) {
- if (orig.indexOf(var, i) == i) {
- Character before = (i != 0) ? orig.charAt(i - 1) : null;
- Character after = (i + varL < l) ? orig.charAt(i + varL) : null;
+ private int parseVar(String s, int i, char c) {
+ if (s.indexOf(var, i) == i) {
+ Character before = (i != 0) ? s.charAt(i - 1) : null;
+ Character after = (i + varL < l) ? s.charAt(i + varL) : null;
if (isVar(c, before, after)) {
res.append(varReplacement);
return i + varL - 1;
@@ -171,14 +210,14 @@
return i;
}
- private int parseString(int i, char c) {
- res.append(orig.charAt(i));
+ private int parseString(String s, int i, char c) {
+ res.append(s.charAt(i));
int j = i++;
while (j < l) {
- if (isQuote(orig.charAt(j))) {
+ if (isQuote(s.charAt(j))) {
break;
} else {
- res.append(orig.charAt(j));
+ res.append(s.charAt(j));
}
j++;
}
Modified: trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java
===================================================================
--- trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java 2008-10-16 11:01:58 UTC (rev 10771)
+++ trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java 2008-10-16 11:14:31 UTC (rev 10772)
@@ -198,7 +198,7 @@
try {
this.value = getAttribute("value");
- itContext.valueExpr = ELBuilder.trimEL(this.value.getValue());
+ itContext.valueExpr = ELBuilder.getVarReplacement(this.value.getValue());
// produce the right sort of ForEachIterator
if (value != null) {
Modified: trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsTag.java
===================================================================
--- trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsTag.java 2008-10-16 11:01:58 UTC (rev 10771)
+++ trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsTag.java 2008-10-16 11:14:31 UTC (rev 10772)
@@ -402,7 +402,7 @@
} else if (items.getVarReplacement() != null) {
return items.getVarReplacement();
}
- String varReplacement = ELBuilder.trimEL(this.__value.getExpressionString())
+ String varReplacement = ELBuilder.getVarReplacement(this.__value.getExpressionString())
+ "[" + index + "]";
return varReplacement;
}
Modified: trunk/ui/columns/src/test/java/org/richfaces/el/ELBuilderTest.java
===================================================================
--- trunk/ui/columns/src/test/java/org/richfaces/el/ELBuilderTest.java 2008-10-16 11:01:58 UTC (rev 10771)
+++ trunk/ui/columns/src/test/java/org/richfaces/el/ELBuilderTest.java 2008-10-16 11:14:31 UTC (rev 10772)
@@ -41,6 +41,9 @@
indexR = "1";
origList = new ArrayList<String>();
+ origList.add("#{}");
+ origList.add("#{column}");
+ origList.add("#{index}");
origList.add("#{column.header}");
origList.add("#{var[index]}");
origList.add("#{bean.filterValue[index]}");
@@ -48,8 +51,17 @@
origList.add("#{var.column.index == 1}");
origList.add("#{index + 11 == 12}");
origList.add("#{var[index*2].index == column[index].index}");
+ origList.add("Active column: #{index}");
+ origList.add("Active name: #{column.name}");
+ origList.add("#{column} text #{index}");
+ origList.add("#{column.index} #{bean.name[index] == 'index'}");
+
+
resultList = new ArrayList<String>();
+ resultList.add("#{}");
+ resultList.add("#{bean.columns[0]}");
+ resultList.add("#{1}");
resultList.add("#{bean.columns[0].header}");
resultList.add("#{var[1]}");
resultList.add("#{bean.filterValue[1]}");
@@ -57,6 +69,10 @@
resultList.add("#{var.column.index == 1}");
resultList.add("#{1 + 11 == 12}");
resultList.add("#{var[1*2].index == bean.columns[0][1].index}");
+ resultList.add("Active column: #{1}");
+ resultList.add("Active name: #{bean.columns[0].name}");
+ resultList.add("#{bean.columns[0]} text #{1}");
+ resultList.add("#{bean.columns[0].index} #{bean.name[1] == 'index'}");
}
public void tearDown() throws Exception {
16 years, 11 months
JBoss Rich Faces SVN: r10771 - trunk/test-applications/jsp/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-10-16 07:01:58 -0400 (Thu, 16 Oct 2008)
New Revision: 10771
Modified:
trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml
Log:
Modified: trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml 2008-10-16 11:00:56 UTC (rev 10770)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml 2008-10-16 11:01:58 UTC (rev 10771)
@@ -226,7 +226,7 @@
</filter>
<!-- Extensions Filter -->
- <!--filter>
+ <filter>
<filter-name>extensionsFilter</filter-name>
<filter-class>
org.apache.myfaces.webapp.filter.ExtensionsFilter
@@ -250,7 +250,7 @@
<param-name>uploadThresholdSize</param-name>
<param-value>100k</param-value>
</init-param>
- </filter-->
+ </filter>
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
@@ -260,10 +260,10 @@
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
- <!--filter-mapping>
+ <filter-mapping>
<filter-name>extensionsFilter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
- </filter-mapping-->
+ </filter-mapping>
<session-config>
<session-timeout>600</session-timeout>
16 years, 11 months
JBoss Rich Faces SVN: r10770 - trunk/test-applications/jsp/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-10-16 07:00:56 -0400 (Thu, 16 Oct 2008)
New Revision: 10770
Modified:
trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml
Log:
LoadScriptStrategy changed to "DEFAULT".
Modified: trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml 2008-10-16 08:54:43 UTC (rev 10769)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/web.xml 2008-10-16 11:00:56 UTC (rev 10770)
@@ -181,7 +181,7 @@
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
- <param-value>ALL</param-value>
+ <param-value>DEFAULT</param-value>
</context-param>
<context-param>
@@ -226,7 +226,7 @@
</filter>
<!-- Extensions Filter -->
- <filter>
+ <!--filter>
<filter-name>extensionsFilter</filter-name>
<filter-class>
org.apache.myfaces.webapp.filter.ExtensionsFilter
@@ -250,7 +250,7 @@
<param-name>uploadThresholdSize</param-name>
<param-value>100k</param-value>
</init-param>
- </filter>
+ </filter-->
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
@@ -260,10 +260,10 @@
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
- <filter-mapping>
+ <!--filter-mapping>
<filter-name>extensionsFilter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
- </filter-mapping>
+ </filter-mapping-->
<session-config>
<session-timeout>600</session-timeout>
16 years, 11 months
JBoss Rich Faces SVN: r10769 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/dataScroller and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-10-16 04:54:43 -0400 (Thu, 16 Oct 2008)
New Revision: 10769
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataScrollerBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScroller.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScrollerAjax.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumEvent.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java
Log:
DataScrollerTest: pageVars, custom facets, onpagechange
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-16 07:40:54 UTC (rev 10768)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataScrollerBean.java 2008-10-16 08:54:43 UTC (rev 10769)
@@ -31,6 +31,10 @@
private Integer page;
+ private String onpagechange = "EventQueue.fire('onpagechange')";
+
+ private String reRender;
+
public DataScrollerBean() {
init();
@@ -41,7 +45,17 @@
return null;
}
+ public String onpagechange() {
+ onpagechange = "return false;";
+ return null;
+ }
+ public String pageVars() {
+ reRender = "activePage, pagesCount";
+ return null;
+ }
+
+
private void init() {
data = new ArrayList();
for (int i = 0; i < totalRows; i++) {
@@ -56,6 +70,7 @@
maxPages = 10;
page = null;
data = null;
+ onpagechange = "EventQueue.fire('onpagechange')";
}
public void apply(ActionEvent event) {
@@ -139,5 +154,33 @@
this.page = page;
}
+ /**
+ * @return the onpagechange
+ */
+ public String getOnpagechange() {
+ return onpagechange;
+ }
+
+ /**
+ * @param onpagechange the onpagechange to set
+ */
+ public void setOnpagechange(String onpagechange) {
+ this.onpagechange = onpagechange;
+ }
+
+ /**
+ * @return the reRender
+ */
+ public String getReRender() {
+ return reRender;
+ }
+
+ /**
+ * @param reRender the reRender to set
+ */
+ public void setReRender(String reRender) {
+ this.reRender = reRender;
+ }
+
}
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-16 07:40:54 UTC (rev 10768)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScroller.xhtml 2008-10-16 08:54:43 UTC (rev 10769)
@@ -19,6 +19,8 @@
</table>
<h:commandButton id="apply" actionListener="#{dataScrollerBean.apply}" value="apply"/>
<h:commandButton id="maxP" action="#{dataScrollerBean.maxPages}" value="Test maxPages" />
+ <h:commandButton id="onpagechange" action="#{dataScrollerBean.onpagechange}" value="Test onpagechange" />
+ <h:commandButton id="pageVars" action="#{dataScrollerBean.pageVars}" value="Test page vars" />
</h:form>
<br/>
<h:form id="_data">
@@ -33,7 +35,18 @@
onmouseout="EventQueue.fire('onmouseout')"
onmouseover="EventQueue.fire('onmouseover')"
onmouseup="EventQueue.fire('onmouseup')"
- />
+ onpagechange="#{dataScrollerBean.onpagechange}"
+ reRender="#{dataScrollerBean.reRender}"
+ pageIndexVar="activePage"
+ pagesVar="pagesCount"
+ >
+ <f:facet name="next">
+ <h:outputText value="Next"></h:outputText>
+ </f:facet>
+ <f:facet name="previous">
+ <h:outputText value="Previous"></h:outputText>
+ </f:facet>
+ </rich:datascroller>
<br/>
@@ -54,7 +67,8 @@
</rich:dataTable>
<br/><br/>
-
+ <h:outputText id="activePage" value="Active page: #{activePage}"></h:outputText>
+ <h:outputText id="pagesCount" value="Count of pages: #{pagesCount}"></h:outputText>
</h:form>
</ui:define>
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScrollerAjax.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScrollerAjax.xhtml 2008-10-16 07:40:54 UTC (rev 10768)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataScroller/dataScrollerAjax.xhtml 2008-10-16 08:54:43 UTC (rev 10769)
@@ -21,6 +21,7 @@
bypassUpdates="#{autoTestBean.bypassUpdate}"
rendered="#{autoTestBean.rendered}"
oncomplete="#{autoTestBean.oncomplete}"
+ onpagechange="EventQueue.fire('onpagechange')"
>
<f:param name="parameter1" value="value1" />
<f:actionListener type="org.ajax4jsf.autotest.bean.AutoTestListener" />
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumEvent.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumEvent.java 2008-10-16 07:40:54 UTC (rev 10768)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumEvent.java 2008-10-16 08:54:43 UTC (rev 10769)
@@ -19,7 +19,13 @@
private String name;
- public static final List<SeleniumEvent> STANDARD_HTML_EVENTS = new ArrayList<SeleniumEvent>();
+ @SuppressWarnings("serial")
+ public static final List<SeleniumEvent> STANDARD_HTML_EVENTS = new ArrayList<SeleniumEvent>() {
+ @Override
+ public void clear() {
+
+ }
+ };
static {
STANDARD_HTML_EVENTS.add(ONCLICK);
STANDARD_HTML_EVENTS.add(ONMOUSEOVER);
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-16 07:40:54 UTC (rev 10768)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java 2008-10-16 08:54:43 UTC (rev 10769)
@@ -51,7 +51,53 @@
"rich-datascr-button"
};
+ @SuppressWarnings("serial")
+ static final List<String> events = new ArrayList<String>(){
+ @Override
+ public void clear() {
+
+ }
+ };
+ static {
+ events.add("onpagechange");
+ }
+
@Test
+ public void testPagesVariables(Template template) {
+ renderPage(template, RESET_METHOD_ME);
+ initIDs(getParentId(), template);
+ String commandId = getParentId() + "_controls:pageVars";
+ clickCommandAndWait(commandId);
+
+ String activePageId = getParentId() + "_data:activePage";
+ String pageCountId = getParentId() + "_data:pagesCount";
+
+ AssertTextEquals(activePageId, "Active page: 1", "PageIndexVar does not work.");
+ AssertTextEquals(pageCountId, "Count of pages: 10", "PagesVar does not work.");
+
+ clickControl(4);
+
+ AssertTextEquals(activePageId, "Active page: 2", "PageIndexVar does not work.");
+ AssertTextEquals(pageCountId, "Count of pages: 10", "PagesVar does not work.");
+
+ }
+
+
+ @Test
+ public void testCancelableOnpagechnage(Template template) {
+ renderPage(template, RESET_METHOD_ME);
+ initIDs(getParentId(), template);
+ String commandId = getParentId() + "_controls:onpagechange";
+ clickCommandAndWait(commandId);
+
+ assertClassNames(getPageLinkRefScript(4), inactivePageClasses, "'2' Link should be inactive", false);
+ clickControlNotWait(4);
+ assertClassNames(getPageLinkRefScript(4), inactivePageClasses, "Cancelable onpagechnage does not work. Page should not be switched. .'2' Link should be inactive", false);
+
+ }
+
+
+ @Test
public void testAutoAjaxAttributes(Template template) {
AutoTester autoTester = getAutoTester(this);
@@ -256,8 +302,10 @@
testPageCount(16);
testControls();
testData(1,"Page 1");
+ checkCustomFacets();
}
+
private void testPageCount(int n) {
assertColumnsCount(n, dataScrollerTableId, "DataScroller inner table contains invalid columns count");
}
@@ -301,6 +349,26 @@
}
+ private void checkCustomFacets() {
+ String text = selenium.getTable("id=" + dataScrollerTableId + ".0.2");
+ Assert.assertEquals("", text, "'Previous' facet should be rendered yet");
+ assertClassNames(getPageLinkRefScript(2),inactiveForwardClasses,
+ "DataScroller rendering failed: ", false);
+
+ text = selenium.getTable("id=" + dataScrollerTableId + ".0.13");
+ Assert.assertEquals("Next", text, "'Next' facet didnot rendered. DataScroller does not contain 'Next' link or its position is invalid");
+ assertClassNames(getPageLinkRefScript(13),activeForwardClasses,
+ "DataScroller rendering failed: ", false);
+ clickControl(4);
+
+ text = selenium.getTable("id=" + dataScrollerTableId + ".0.2");
+ Assert.assertEquals("Previous", text, "'Previous' facet didnot be rendered.");
+ assertClassNames(getPageLinkRefScript(2),activeForwardClasses,
+ "DataScroller rendering failed: ", false);
+
+
+ }
+
private void testData(int rowCount, String data) {
assertRowsCount(rowCount, dataTableId);
@@ -326,8 +394,16 @@
b.append(".onclick();");
selenium.getEval(b.toString());
waitForAjaxCompletion();
+ assertEvents(events);
}
+ private void clickControlNotWait(int n) {
+ StringBuffer b = new StringBuffer();
+ b.append(getPageLinkRefScript(n));
+ b.append(".onclick();");
+ selenium.getEval(b.toString());
+ }
+
/* (non-Javadoc)
* @see org.richfaces.SeleniumTestBase#getTestUrl()
*/
16 years, 11 months
JBoss Rich Faces SVN: r10768 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-10-16 03:40:54 -0400 (Thu, 16 Oct 2008)
New Revision: 10768
Modified:
trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml
Log:
RF-4576 - information is added
Modified: trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml 2008-10-16 07:40:32 UTC (rev 10767)
+++ trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml 2008-10-16 07:40:54 UTC (rev 10768)
@@ -66,7 +66,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlDatascroller;
-...
+...
HtmlDatascroller myScroll = new HtmlDatascroller();
...
]]></programlisting>
@@ -77,6 +77,15 @@
<property><rich:datascroller></property>
</emphasis> component provides table scrolling functionalitity the
same as TOMAHAWK scroller but with Ajax requests usage.</para>
+ <para> The
+ <emphasis role="bold">
+ <property><rich:datascroller></property>
+ </emphasis> component should be reRendered also with <emphasis role="bold">
+ <property><rich:dataTable></property>
+ </emphasis> when you changing filter in order to be updated according to the <emphasis role="bold">
+ <property><rich:dataTable></property>
+ </emphasis> current model.
+ </para>
<para>The component should be placed into footer of the parent table or be bound
to it with the <emphasis>
<property>"for"</property>
@@ -198,10 +207,10 @@
<h:panelGroup>
<h:outputText value="Set current page number:" />
<h:inputText value="#{dataTableScrollerBean.scrollerPage}" id="sc1" size="1"/>
- <h:commandButton value="Set" />
+ <h:commandButton value="Set" />
</h:panelGroup>
</h:panelGrid>
-</h:form>
+</h:form>
...
]]></programlisting>
@@ -229,7 +238,7 @@
</emphasis> attributes provide an ability to show the current page and the number of pages in
the <emphasis role="bold">
<property><rich:datascroller></property>
- </emphasis>.
+ </emphasis>.
-->
16 years, 11 months
JBoss Rich Faces SVN: r10767 - in trunk/docs/userguide/en/src/main: resources/images and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-10-16 03:40:32 -0400 (Thu, 16 Oct 2008)
New Revision: 10767
Added:
trunk/docs/userguide/en/src/main/resources/images/calendar6.png
Modified:
trunk/docs/userguide/en/src/main/docbook/included/calendar.xml
Log:
RF-4570 - screen and additional information about "disabled" attribute are added
Modified: trunk/docs/userguide/en/src/main/docbook/included/calendar.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/calendar.xml 2008-10-15 17:10:39 UTC (rev 10766)
+++ trunk/docs/userguide/en/src/main/docbook/included/calendar.xml 2008-10-16 07:40:32 UTC (rev 10767)
@@ -72,7 +72,7 @@
<para>
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlCalendar;
+ <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlCalendar;
...
HtmlCalendar myCalendar = new HtmlCalendar();
...
@@ -132,6 +132,39 @@
changing selected day.</para>
</listitem>
</itemizedlist>
+
+
+
+ <para>
+ With the help of the
+ <emphasis>
+ <property>"readonly"</property>
+ </emphasis>
+ attribute you can make date, time and input field unavailable, but you can look through the next/previous month or the next/previous year.
+ </para>
+ <para>
+ In order to disable the component, use the <emphasis>
+ <property>"disabled"</property>
+ </emphasis> attribute. With its help both controls are disabled in the
+ <emphasis>
+ <property>"popup"</property>
+ </emphasis>
+ mode.
+ </para>
+ <figure>
+ <title>Using the <emphasis>
+ <property>"disabled"</property>
+ </emphasis> attribute.</title>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/calendar6.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+
+
<para>The <emphasis role="bold">
<property><rich:calendar></property>
</emphasis> component can render pages of days in two modes. A mode
@@ -190,7 +223,7 @@
</emphasis> event as it's shown in the example below:</para>
<programlisting role="XML"><![CDATA[...
<rich:calendar id="date" value="#{bean.dateTest}">
- <a4j:support event="ondateselected" reRender="mainTable"/>
+ <a4j:support event="ondateselected" reRender="mainTable"/>
</rich:calendar>
...]]></programlisting>
<para><emphasis>
@@ -404,19 +437,19 @@
.talign{
text-align:center;
}
-</style>
+</style>
...]]></programlisting>
<programlisting role="XML"><![CDATA[...
-<rich:calendar id="myCalendar" popup="true" locale="#{calendarBean.locale}" value="#{bean.date}"
+<rich:calendar id="myCalendar" popup="true" locale="#{calendarBean.locale}" value="#{bean.date}"
preloadRangeBegin="#{bean.date}" preloadRangeEnd="#{bean.date}" cellWidth="40px" cellHeight="40px">
-<!-- Customization with usage of facets and accessible elements -->
+<!-- Customization with usage of facets and accessible elements -->
<f:facet name="header">
<h:panelGrid columns="2" width="100%" columnClasses="width100, fake">
<h:outputText value="{selectedDateControl}" />
<h:outputText value="{todayControl}" style="font-weight:bold; text-align:left"/>
- </h:panelGrid>
+ </h:panelGrid>
</f:facet>
<f:facet name="weekDay">
<h:panelGroup style="width:60px; overflow:hidden;" layout="block">
@@ -429,12 +462,12 @@
</h:panelGroup>
</f:facet>
<f:facet name="footer">
- <h:panelGrid columns="3" width="100%" columnClasses="fake, width100 talign">
+ <h:panelGrid columns="3" width="100%" columnClasses="fake, width100 talign">
<h:outputText value="{previousMonthControl}" style="font-weight:bold;"/>
<h:outputText value="{currentMonthControl}" style="font-weight:bold;"/>
<h:outputText value="{nextMonthControl}" style="font-weight:bold;"/>
- </h:panelGrid>
- </f:facet>
+ </h:panelGrid>
+ </f:facet>
<h:outputText value="{day}"></h:outputText>
</rich:calendar>
...]]></programlisting>
@@ -722,13 +755,13 @@
<!--
<row>
<entry>enable()</entry>
-
+
<entry>Enables calendar</entry>
</row>
-
+
<row>
<entry>disable()</entry>
-
+
<entry>Disables calendar</entry>
</row>
-->
@@ -1909,9 +1942,9 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="CSS"><![CDATA[...
-.rich-calendar-today {
- background-color: #FF0000;
-}
+.rich-calendar-today {
+ background-color: #FF0000;
+}
...]]></programlisting>
<para>This is a result:</para>
Added: trunk/docs/userguide/en/src/main/resources/images/calendar6.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/calendar6.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 11 months
JBoss Rich Faces SVN: r10766 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-10-15 13:10:39 -0400 (Wed, 15 Oct 2008)
New Revision: 10766
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml
Log:
https://jira.jboss.org/jira/browse/RF-4519
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml 2008-10-15 15:25:46 UTC (rev 10765)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCtechreqs.xml 2008-10-15 17:10:39 UTC (rev 10766)
@@ -111,9 +111,9 @@
<listitem><para>JBoss 4.2.x - 5</para></listitem>
- <listitem><para> Websphere 7.0. and higher </listitem></para>
+ <listitem><para> Websphere 7.0. and higher </para> </listitem>
- <listitem><para>Geronimo 2.0 and higher </listitem></para>
+ <listitem><para>Geronimo 2.0 and higher </para> </listitem>
</itemizedlist>
16 years, 11 months
JBoss Rich Faces SVN: r10765 - Suite and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-10-15 11:25:46 -0400 (Wed, 15 Oct 2008)
New Revision: 10765
Modified:
trunk/test-applications/qa/Performance Suite/Performance Test Suite Blank 3.2.0 (1).doc
trunk/test-applications/qa/Performance Suite/Performance Test Suite Blank 3.3.0 (1).doc
Log:
Modified: trunk/test-applications/qa/Performance Suite/Performance Test Suite Blank 3.2.0 (1).doc
===================================================================
(Binary files differ)
Modified: trunk/test-applications/qa/Performance Suite/Performance Test Suite Blank 3.3.0 (1).doc
===================================================================
(Binary files differ)
16 years, 11 months