JBoss Rich Faces SVN: r7920 - in trunk/test-applications/seleniumTest/src: main/webapp/WEB-INF and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-04-18 06:06:23 -0400 (Fri, 18 Apr 2008)
New Revision: 7920
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ProgressBarTestBean.java
trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/
trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarDescription.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/seleniumTest/src/main/webapp/layout/template.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java
Log:
progress bar test
Added: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ProgressBarTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ProgressBarTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/ProgressBarTestBean.java 2008-04-18 10:06:23 UTC (rev 7920)
@@ -0,0 +1,50 @@
+package org.ajax4jsf;
+
+import java.util.Date;
+
+public class ProgressBarTestBean {
+
+ private boolean enabled = false;
+
+ private Long value = -5L;
+
+ public String getDate() {
+ return String.valueOf(new Date().getTime());
+ }
+
+ public String getCompleteDate() {
+ return String.valueOf(new Date().getTime());
+ }
+
+ /**
+ * @return the enabled
+ */
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ /**
+ * @param enabled the enabled to set
+ */
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ /**
+ * @return the value
+ */
+ public Long getValue() {
+ value++;
+ return value;
+ }
+
+ /**
+ * @param value the value to set
+ */
+ public void setValue(Long value) {
+ this.value = value;
+ }
+
+
+
+}
Modified: trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-04-18 09:30:11 UTC (rev 7919)
+++ trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-04-18 10:06:23 UTC (rev 7920)
@@ -25,6 +25,11 @@
<managed-bean-name>commandBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.A4JCommandTestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>progressBarBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.ProgressBarTestBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>tabPanelBean</managed-bean-name>
Modified: trunk/test-applications/seleniumTest/src/main/webapp/layout/template.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/layout/template.xhtml 2008-04-18 09:30:11 UTC (rev 7919)
+++ trunk/test-applications/seleniumTest/src/main/webapp/layout/template.xhtml 2008-04-18 10:06:23 UTC (rev 7920)
@@ -8,6 +8,7 @@
<head>
<script>
var errorMessage = null;
+ var pauseHolder = {};
window.onerror = function (message, url, code) {
errorMessage = message;
};
@@ -15,6 +16,11 @@
return errorMessage;
}
+ function pause (miliseconds, id) {
+ pauseHolder[id] = false;
+ window.setTimeout(function () { pauseHolder[id] = true; }, miliseconds);
+ }
+
function submitForm () {
document.getElementById('_form').submit();
}
Added: trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarDescription.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarDescription.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarDescription.xhtml 2008-04-18 10:06:23 UTC (rev 7920)
@@ -0,0 +1,25 @@
+<html>
+<table border="1" style="border-color: #F1EEE9" cellpadding="5" cellspacing="0">
+<tr><th></th><th>Action</th><th>Result</th></tr>
+<tr><td>1</td><td>Get progressBar1 value</td><td>Value < 0</td></tr>
+<tr><td>2</td><td>Get progreesBar1 text</td><td>Text == 'Process not started'</td></tr>
+<tr><td>3</td><td>Enable progressBar1</td><td>Polling should be started</td></tr>
+<tr><td>4</td><td>Wait for 5 seconds</td><td> </td></tr>
+<tr><td>5</td><td>Disable progressBar1</td><td>Polling should be stopped</td></tr>
+<tr><td>6</td><td>Get progressBar1 text</td><td>Test should be ended with '%'</td></tr>
+<tr><td>7</td><td>Get progressBar1 value</td><td>Value > 0</td></tr>
+<tr><td>8</td><td>Enable progressBar1</td><td>Polling should be started</td></tr>
+<tr><td>9</td><td>Wait for 5 seconds</td><td></td></tr>
+<tr><td>10</td><td>Get progressBar1 value</td><td>Value should be different from the previous</td></tr>
+<tr><td>11</td><td>Disable progressBar1</td><td>Polling should be stopped</td></tr>
+<tr><td>12</td><td>Get progressBar1 value</td><td>Remember the value</td></tr>
+<tr><td>13</td><td>Wait for 1.5 seconds</td><td> </td></tr>
+<tr><td>14</td><td>Get progressBar1 value</td><td>Value should be the same as the previous</td></tr>
+<tr><td>15</td><td>Get progressBar2 value</td><td>Value == -5</td></tr>
+<tr><td>16</td><td>Get progreesBar2 text</td><td>Text == 'Process not started'</td></tr>
+<tr><td>17</td><td>Set progressBar2 value in '20' through JS API </td><td>Progress should be changed</td></tr>
+<tr><td>18</td><td>Get progressBar2 value </td><td>Value == 20</td></tr>
+<tr><td>19</td><td>Set progressBar2 value in '60' through JS API </td><td>Progress should be changed</td></tr>
+<tr><td>20</td><td>Get progressBar2 value </td><td>Value == 60</td></tr>
+</table>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarTest.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/pages/progressBar/progressBarTest.xhtml 2008-04-18 10:06:23 UTC (rev 7920)
@@ -0,0 +1,35 @@
+<!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="../../layout/template.xhtml">
+ <ui:define name="component">
+ <rich:progressBar enabled="#{progressBarBean.enabled}" id="progressBar1" value="#{progressBarBean.value}">
+ <f:facet name="initial">
+ <h:outputText value="Process not started"></h:outputText>
+ </f:facet>
+ <f:facet name="complete">
+ <h:outputText value="Process not started"></h:outputText>
+ </f:facet>
+ <h:outputText value="{value}%"></h:outputText>
+ </rich:progressBar><br/>
+ <br/><br/>
+ <rich:progressBar enabled="#{progressBarBean.enabled}" mode="client" id="progressBar2" value="-5">
+ <f:facet name="initial">
+ <h:outputText value="Process not started"></h:outputText>
+ </f:facet>
+ <f:facet name="complete">
+ <h:outputText value="Process not started"></h:outputText>
+ </f:facet>
+ <h:outputText value="{value}%"></h:outputText>
+ </rich:progressBar> <br/>
+ </ui:define>
+ <ui:define name="description">
+ <ui:include src="progressBarDescription.xhtml" />
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java 2008-04-18 09:30:11 UTC (rev 7919)
+++ trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java 2008-04-18 10:06:23 UTC (rev 7920)
@@ -17,6 +17,8 @@
/** Specifies the time to wait for ajax processing */
protected static final int ajaxCompletionTime = 3000;
+
+ private static final String WINDOW_JS_RESOLVER = "selenium.browserbot.getCurrentWindow().";
/** The default selenium instance */
public DefaultSelenium selenium;
@@ -106,6 +108,18 @@
// clickById("_Selenium_Test_ReRender_Form:_reRender");
waitForAjaxCompletion(3000);
}
+
+
+ /**
+ * Performs script defined in parameter
+ * @param script
+ * @return
+ */
+ public String runScript(String script) {
+ String result = selenium.getEval(WINDOW_JS_RESOLVER + script);
+ checkJSError();
+ return result;
+ }
/**
* This method are invoking after selenium tests completed
@@ -115,51 +129,53 @@
selenium = null;
}
- /**
- * Checks if JS error occurred. Fails test if yes. This method should be
- * invoked after each event or any thing which can be a cause of JS error.
- */
- public void checkJSError() {
- String error = selenium.getEval("selenium.browserbot.getCurrentWindow().checkError();");
- if (error != null && !("null".equals(error)) && !("".equals(error))) {
- Assert.fail("Failure by the following Javascript error: " + error);
- }
- }
+ /**
+ * Checks if JS error occurred. Fails test if yes. This method should be
+ * invoked after each event or any thing which can be a cause of JS error.
+ */
+ public void checkJSError() {
+ String error = selenium.getEval(WINDOW_JS_RESOLVER + "checkError();");
+ if (error != null && !("null".equals(error)) && !("".equals(error))) {
+ Assert.fail("Failure by the following Javascript error: " + error);
+ }
+ }
- /**
- * Checks if page containing component test has been rendered completely
- */
- public void checkPageRendering() {
- try {
- String t1 = getTextById("_Selenium_Test_ControlPoint1");
- String t2 = getTextById("_Selenium_Test_ControlPoint2");
- if (t1 == null || t2 == null || !"Control1".equals(t1) || !"Control2".equals(t2)) {
- Assert.fail("The page has been not rendered properlly");
- }
- }catch (Exception e) {
- Assert.fail("The page has been not rendered properlly by the following error: " + e);
- }
- }
+ /**
+ * Checks if page containing component test has been rendered completely
+ */
+ public void checkPageRendering() {
+ try {
+ String t1 = getTextById("_Selenium_Test_ControlPoint1");
+ String t2 = getTextById("_Selenium_Test_ControlPoint2");
+ if (t1 == null || t2 == null || !"Control1".equals(t1) || !"Control2".equals(t2)) {
+ Assert.fail("The page has been not rendered properlly");
+ }
+ }catch (Exception e) {
+ Assert.fail("The page has been not rendered properlly by the following error: " + e);
+ }
+ }
+ /**
+ * Waits while AJAX request will be completed
+ *
+ * @param miliseconds -
+ * time to wait
+ */
+ public void waitForAjaxCompletion(int miliseconds) {
+ selenium.waitForCondition(WINDOW_JS_RESOLVER + "done==true", String.valueOf(miliseconds));
+ }
+
+ /**
+ * Waits while AJAX request will be completed
+ *
+ * @param miliseconds -
+ * time to wait
+ */
+ public void waitForAjaxCompletion() {
+ waitForAjaxCompletion(ajaxCompletionTime);
+ }
- /**
- * Waits while AJAX request will be completed
- *
- * @param miliseconds -
- * time to wait
- */
- public void waitForAjaxCompletion(int miliseconds) {
- selenium.waitForCondition("selenium.browserbot.getCurrentWindow().done==true", String.valueOf(miliseconds));
- }
/**
- * Waits while AJAX request will be completed
- *
- */
- public void waitForAjaxCompletion() {
- selenium.waitForCondition("selenium.browserbot.getCurrentWindow().done==true", String.valueOf(ajaxCompletionTime));
- }
-
- /**
* Waits while simple request will be completed
*
* @param miliseconds -
@@ -237,7 +253,7 @@
* @return
*/
public String getTextById(String id) {
- return selenium.getText(id);
+ return selenium.getText("id=" + id);
}
/**
@@ -248,8 +264,18 @@
* @return
*/
public String getValueById(String id) {
- return selenium.getValue(id);
+ return selenium.getValue("id=" + id);
}
+
+
+ /**
+ * Returns element's width
+ * @param id - DOM element id
+ * @return
+ */
+ public Number getWidthById(String id) {
+ return selenium.getElementWidth("id=" + id);
+ }
/**
* Clicks on element
@@ -259,7 +285,7 @@
* @return
*/
public void clickById(String id) {
- selenium.click(id);
+ selenium.click("id=" + id);
checkJSError();
}
@@ -269,16 +295,35 @@
* @return
*/
public boolean isVisibleById(String id) {
- return selenium.isVisible(id);
+ return selenium.isVisible("id=" + id);
}
+
/**
* Creates delay
* @param miliSeconds
* @throws InterruptedException
*/
- public void delay(int miliSeconds) throws InterruptedException {
- Thread.sleep(miliSeconds);
+ public void delay(int miliSeconds) {
+ try {
+ Thread.sleep(miliSeconds);
+ } catch (Exception e) {
+
+ }
+ }
+
+ /**
+ * Creates pause for defined time in miliSeconds
+ * @param miliSeconds
+ */
+ public void pause(int miliSeconds, String id) {
+ StringBuffer script = new StringBuffer("pause(");
+ script.append(miliSeconds);
+ script.append(",'");
+ script.append(id);
+ script.append("');");
+ runScript(script.toString());
+ selenium.waitForCondition(WINDOW_JS_RESOLVER + "pauseHolder['" + id + "'] == true;", String.valueOf(miliSeconds + 1000));
}
}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java 2008-04-18 10:06:23 UTC (rev 7920)
@@ -0,0 +1,122 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.testng.Assert;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+public class ProgressBarTest extends SeleniumTestBase implements
+ RichSeleniumTest {
+
+ public ProgressBarTest() {
+ super("http", "localhost", "8080");
+ }
+
+ /**
+ * This method are invoking before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ super.startSelenium(browser);
+ }
+
+ /**
+ * This method are invoking after selenium tests completed
+ */
+ @AfterTest
+ public void stopSelenium() {
+ super.stopSelenium();
+ }
+
+ @Test
+ public void testProgressBarComponent() {
+ renderPage("/faces/pages/progressBar/progressBarTest.xhtml");
+
+ _testProgressBarComponent(COMPONENT_PREFIX_INSIDE_TABLE);
+ _testProgressBarComponent(COMPONENT_PREFIX_INSIDE_PANEL);
+ }
+
+ private void _testProgressBarComponent(String parentId) {
+
+ //- Test ajax mode
+
+ String progressBarId = parentId + "progressBar1";
+ int value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value < 0);
+ String text = getTextById(progressBarId);
+ Assert.assertTrue(text.startsWith("Process not started"));
+
+ enableProgressBar(progressBarId, true);
+
+ pause(5000, progressBarId);
+
+ enableProgressBar(progressBarId, false);
+
+ text = getTextById(progressBarId + ":remain");
+ Assert.assertTrue(text.endsWith("%"));
+
+ value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value > 0);
+
+ enableProgressBar(progressBarId, true);
+
+ pause(5000, progressBarId);
+ Assert.assertTrue((getProgressBarValue(progressBarId).intValue() != value));
+
+ enableProgressBar(progressBarId, false);
+
+ value = getProgressBarValue(progressBarId);
+ delay(1500);
+ Assert.assertTrue(getProgressBarValue(progressBarId) == value);
+
+
+ // - Test client mode
+
+ progressBarId = parentId + "progressBar2";
+ value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value == -5);
+
+ text = getTextById(progressBarId);
+ Assert.assertTrue(text.startsWith("Process not started"));
+
+ setProgressBarValue(progressBarId, 20);
+ value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value == 20);
+
+ setProgressBarValue(progressBarId, 60);
+ value = getProgressBarValue(progressBarId);
+ Assert.assertTrue(value == 60);
+
+
+
+
+
+ }
+
+ private void enableProgressBar(String id, boolean enable) {
+ StringBuffer script = new StringBuffer("$('");
+ script.append(id).append("').component.").append(
+ enable ? "enable();" : "disable();");
+ runScript(script.toString());
+ }
+
+ private void setProgressBarValue(String id, Object value) {
+ StringBuffer script = new StringBuffer("$('");
+ script.append(id).append("').component.").append("setValue(").append(
+ value).append(");");
+ runScript(script.toString());
+ }
+
+ private Integer getProgressBarValue(String id) {
+ StringBuffer script = new StringBuffer("$('");
+ script.append(id).append("').component.").append("getValue();");
+ String value = runScript(script.toString());
+ Integer v = Integer.parseInt(value);
+ return v;
+ }
+
+}
16 years, 9 months
JBoss Rich Faces SVN: r7919 - trunk/test-applications/jsp/src/main/java/inplaceInput.
by richfaces-svn-commits@lists.jboss.org
Author: gmaksimenko
Date: 2008-04-18 05:30:11 -0400 (Fri, 18 Apr 2008)
New Revision: 7919
Modified:
trunk/test-applications/jsp/src/main/java/inplaceInput/InplaceInput.java
Log:
Add test for layout
Modified: trunk/test-applications/jsp/src/main/java/inplaceInput/InplaceInput.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/inplaceInput/InplaceInput.java 2008-04-18 09:29:55 UTC (rev 7918)
+++ trunk/test-applications/jsp/src/main/java/inplaceInput/InplaceInput.java 2008-04-18 09:30:11 UTC (rev 7919)
@@ -25,6 +25,7 @@
private String valueCL;
private HtmlInplaceInput myInplaceInput;
private String bindLabel;
+ private String layout;
public HtmlInplaceInput getMyInplaceInput() {
return myInplaceInput;
@@ -67,6 +68,7 @@
valueCL = "---";
myInplaceInput = new HtmlInplaceInput();
bindLabel = "Click Binding";
+ layout = "inline";
}
public void valueChangeListener(ValueChangeEvent event){
@@ -175,5 +177,12 @@
public void setValueCL(String valueCL) {
this.valueCL = valueCL;
}
+
+ public String getLayout() {
+ return layout;
+ }
+ public void setLayout(String layout) {
+ this.layout = layout;
+ }
}
16 years, 9 months
JBoss Rich Faces SVN: r7918 - trunk/test-applications/jsp/src/main/webapp/InplaceInput.
by richfaces-svn-commits@lists.jboss.org
Author: gmaksimenko
Date: 2008-04-18 05:29:55 -0400 (Fri, 18 Apr 2008)
New Revision: 7918
Modified:
trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp
Log:
Add test for layout
Modified: trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp 2008-04-18 09:23:04 UTC (rev 7917)
+++ trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp 2008-04-18 09:29:55 UTC (rev 7918)
@@ -26,7 +26,8 @@
selectOnEdit="#{inplaceInput.selectOnEdit}"
showControls="#{inplaceInput.showControls}"
rendered="#{inplaceInput.rendered}"
- immediate="#{inplaceInput.immediate}">
+ immediate="#{inplaceInput.immediate}"
+ layout = "#{inplaceInput.layout}">
</rich:inplaceInput>
are easy to exploit.
@@ -106,5 +107,9 @@
<h:commandButton actionListener="#{inplaceInput.checkBinding}" value="Binding"></h:commandButton>
<h:outputText value="#{inplaceInput.bindLabel}"></h:outputText>
+ <h:outputText value="layout"></h:outputText>
+ <h:inputText value="#{inplaceInput.layout}" onchange="submit();">
+ </h:inputText>
+
</h:panelGrid>
</f:subview>
\ No newline at end of file
16 years, 9 months
JBoss Rich Faces SVN: r7917 - trunk/test-applications/facelets/src/main/java/inplaceInput.
by richfaces-svn-commits@lists.jboss.org
Author: gmaksimenko
Date: 2008-04-18 05:23:04 -0400 (Fri, 18 Apr 2008)
New Revision: 7917
Modified:
trunk/test-applications/facelets/src/main/java/inplaceInput/InplaceInput.java
Log:
Add test for layout
Modified: trunk/test-applications/facelets/src/main/java/inplaceInput/InplaceInput.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/inplaceInput/InplaceInput.java 2008-04-18 09:22:10 UTC (rev 7916)
+++ trunk/test-applications/facelets/src/main/java/inplaceInput/InplaceInput.java 2008-04-18 09:23:04 UTC (rev 7917)
@@ -1,7 +1,11 @@
package inplaceInput;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
+import org.richfaces.component.html.HtmlInplaceInput;
+
public class InplaceInput {
private String inputMaxLength;
private String inputWidth;
@@ -20,7 +24,31 @@
private boolean rendered;
private boolean immediate;
private String valueCL;
+ private HtmlInplaceInput myInplaceInput;
+ private String bindLabel;
+ private String layout;
+ public HtmlInplaceInput getMyInplaceInput() {
+ return myInplaceInput;
+ }
+
+ public void setMyInplaceInput(HtmlInplaceInput myInplaceInput) {
+ this.myInplaceInput = myInplaceInput;
+ }
+
+ public String getBindLabel() {
+ return bindLabel;
+ }
+
+ public void setBindLabel(String bindLabel) {
+ this.bindLabel = bindLabel;
+ }
+
+ public void checkBinding(ActionEvent actionEvent){
+ FacesContext context = FacesContext.getCurrentInstance();
+ bindLabel = myInplaceInput.getClientId(context);
+ }
+
public InplaceInput() {
inputMaxLength = "200";
inputWidth = "150";
@@ -39,6 +67,9 @@
rendered = true;
immediate = false;
valueCL = "---";
+ myInplaceInput = new HtmlInplaceInput();
+ bindLabel = "Click Binding";
+ layout = "inline";
}
public void valueChangeListener(ValueChangeEvent event){
@@ -148,4 +179,13 @@
this.valueCL = valueCL;
}
+ public String getLayout() {
+ return layout;
+ }
+
+ public void setLayout(String layout) {
+ this.layout = layout;
+ }
+
+
}
16 years, 9 months
JBoss Rich Faces SVN: r7916 - trunk/test-applications/facelets/src/main/webapp/InplaceInput.
by richfaces-svn-commits@lists.jboss.org
Author: gmaksimenko
Date: 2008-04-18 05:22:10 -0400 (Fri, 18 Apr 2008)
New Revision: 7916
Modified:
trunk/test-applications/facelets/src/main/webapp/InplaceInput/InplaceInput.xhtml
Log:
Add test for layout
Modified: trunk/test-applications/facelets/src/main/webapp/InplaceInput/InplaceInput.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/InplaceInput/InplaceInput.xhtml 2008-04-18 07:13:08 UTC (rev 7915)
+++ trunk/test-applications/facelets/src/main/webapp/InplaceInput/InplaceInput.xhtml 2008-04-18 09:22:10 UTC (rev 7916)
@@ -1,9 +1,12 @@
<f:subview xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" id="inplaceInputSubviewID">
+
+<h:inputText value="For verify tabbing"></h:inputText> <br/>
+
This is because such an error can easily be made at programming level, <br />
and while invisible for the user who does not understand or cannot <br />
acquire the source code, many of those
-<rich:inplaceInput inputMaxLength="#{inplaceInput.inputMaxLength}"
+<rich:inplaceInput id = "inplaceInputId1" inputMaxLength="#{inplaceInput.inputMaxLength}"
inputWidth="#{inplaceInput.inputWidth}"
maxInputWidth="#{inplaceInput.maxInputWidth}"
minInputWidth="#{inplaceInput.minInputWidth}"
@@ -18,7 +21,8 @@
selectOnEdit="#{inplaceInput.selectOnEdit}"
showControls="#{inplaceInput.showControls}"
rendered="#{inplaceInput.rendered}"
- immediate="#{inplaceInput.immediate}">
+ immediate="#{inplaceInput.immediate}"
+ layout = "#{inplaceInput.layout}">
</rich:inplaceInput>
are easy to exploit. <h:commandButton value="ok"></h:commandButton>
<h:panelGrid columns="2">
@@ -97,6 +101,13 @@
<h:outputText value="requiredMessage"></h:outputText>
<h:inputText value="#{inplaceInput.requiredMessage}" onchange="submit();">
</h:inputText>
-
+
+ <h:commandButton actionListener="#{inplaceInput.checkBinding}" value="Binding"></h:commandButton>
+ <h:outputText value="#{inplaceInput.bindLabel}"></h:outputText>
+
+ <h:outputText value="layout"></h:outputText>
+ <h:inputText value="#{inplaceInput.layout}" onchange="submit();">
+ </h:inputText>
+
</h:panelGrid>
</f:subview>
\ No newline at end of file
16 years, 9 months
JBoss Rich Faces SVN: r7915 - trunk/test-applications/jsp/src/main/java/inplaceInput.
by richfaces-svn-commits@lists.jboss.org
Author: gmaksimenko
Date: 2008-04-18 03:13:08 -0400 (Fri, 18 Apr 2008)
New Revision: 7915
Modified:
trunk/test-applications/jsp/src/main/java/inplaceInput/InplaceInput.java
Log:
Add binding and tabbing
Modified: trunk/test-applications/jsp/src/main/java/inplaceInput/InplaceInput.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/inplaceInput/InplaceInput.java 2008-04-18 07:12:51 UTC (rev 7914)
+++ trunk/test-applications/jsp/src/main/java/inplaceInput/InplaceInput.java 2008-04-18 07:13:08 UTC (rev 7915)
@@ -1,6 +1,9 @@
package inplaceInput;
import javax.faces.event.ValueChangeEvent;
+import org.richfaces.component.html.HtmlInplaceInput;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
public class InplaceInput {
private String inputMaxLength;
@@ -20,7 +23,30 @@
private boolean rendered;
private boolean immediate;
private String valueCL;
+ private HtmlInplaceInput myInplaceInput;
+ private String bindLabel;
+ public HtmlInplaceInput getMyInplaceInput() {
+ return myInplaceInput;
+ }
+
+ public void setMyInplaceInput(HtmlInplaceInput myInplaceInput) {
+ this.myInplaceInput = myInplaceInput;
+ }
+
+ public String getBindLabel() {
+ return bindLabel;
+ }
+
+ public void setBindLabel(String bindLabel) {
+ this.bindLabel = bindLabel;
+ }
+
+ public void checkBinding(ActionEvent actionEvent){
+ FacesContext context = FacesContext.getCurrentInstance();
+ bindLabel = myInplaceInput.getClientId(context);
+ }
+
public InplaceInput() {
inputMaxLength = "200";
inputWidth = "150";
@@ -39,6 +65,8 @@
rendered = true;
immediate = false;
valueCL = "---";
+ myInplaceInput = new HtmlInplaceInput();
+ bindLabel = "Click Binding";
}
public void valueChangeListener(ValueChangeEvent event){
16 years, 9 months
JBoss Rich Faces SVN: r7914 - trunk/test-applications/jsp/src/main/webapp/InplaceInput.
by richfaces-svn-commits@lists.jboss.org
Author: gmaksimenko
Date: 2008-04-18 03:12:51 -0400 (Fri, 18 Apr 2008)
New Revision: 7914
Modified:
trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp
Log:
Add binding and tabbing
Modified: trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp 2008-04-18 00:46:34 UTC (rev 7913)
+++ trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp 2008-04-18 07:12:51 UTC (rev 7914)
@@ -4,6 +4,7 @@
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="inplaceInputSubviewID">
+<h:inputText value="For verify tabbing"></h:inputText> <br/>
This is because such an error can easily be made at programming level, <br />
and while invisible for the user who does not understand or cannot <br />
acquire the source code, many of those
@@ -101,6 +102,9 @@
<h:outputText value="requiredMessage"></h:outputText>
<h:inputText value="#{inplaceInput.requiredMessage}" onchange="submit();">
</h:inputText>
-
+
+ <h:commandButton actionListener="#{inplaceInput.checkBinding}" value="Binding"></h:commandButton>
+ <h:outputText value="#{inplaceInput.bindLabel}"></h:outputText>
+
</h:panelGrid>
</f:subview>
\ No newline at end of file
16 years, 9 months
JBoss Rich Faces SVN: r7913 - in trunk: ui/core/src/main/config/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-04-17 20:46:34 -0400 (Thu, 17 Apr 2008)
New Revision: 7913
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/ToStream.java
trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/TreeWalker.java
trunk/ui/core/src/main/config/component/commandButton.xml
trunk/ui/core/src/main/config/component/commandLink.xml
trunk/ui/core/src/main/config/component/support.xml
Log:
Fix issues:
http://jira.jboss.com/jira/browse/RF-3130
http://jira.jboss.com/jira/browse/AJSF-129
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/ToStream.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/ToStream.java 2008-04-17 23:19:00 UTC (rev 7912)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/ToStream.java 2008-04-18 00:46:34 UTC (rev 7913)
@@ -229,20 +229,22 @@
try
{
- TreeWalker walker =
- new TreeWalker(this);
-
- walker.traverse(node);
- }
- catch (org.xml.sax.SAXException se)
- {
- throw new WrappedRuntimeException(se);
- }
+ TreeWalker walker = new TreeWalker(this);
+ // FIX for http://jira.jboss.com/jira/browse/AJSF-129
+ if (m_needToCallStartDocument) {
+ walker.traverse(node);
+ } else {
+ // Serialise without start/endDocument calls.
+ walker.traverseFragment(node);
+ }
+ } catch (org.xml.sax.SAXException se) {
+ throw new WrappedRuntimeException(se);
+ }
}
/**
- * Taken from XSLTC
- */
+ * Taken from XSLTC
+ */
private boolean m_escaping = true;
/**
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/TreeWalker.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/TreeWalker.java 2008-04-17 23:19:00 UTC (rev 7912)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/TreeWalker.java 2008-04-18 00:46:34 UTC (rev 7913)
@@ -54,6 +54,7 @@
import org.w3c.dom.Text;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
import org.xml.sax.ext.LexicalHandler;
import org.xml.sax.helpers.LocatorImpl;
@@ -158,8 +159,17 @@
this.m_contentHandler.startDocument();
- Node top = pos;
+ traverseFragment(pos);
+ this.m_contentHandler.endDocument();
+ }
+/**
+ * @param pos
+ * @throws SAXException
+ */
+public void traverseFragment(Node pos) throws SAXException {
+ Node top = pos;
+
while (null != pos)
{
startNode(pos);
@@ -193,8 +203,7 @@
pos = nextNode;
}
- this.m_contentHandler.endDocument();
- }
+}
/**
* Perform a pre-order traversal non-recursive style.
Modified: trunk/ui/core/src/main/config/component/commandButton.xml
===================================================================
--- trunk/ui/core/src/main/config/component/commandButton.xml 2008-04-17 23:19:00 UTC (rev 7912)
+++ trunk/ui/core/src/main/config/component/commandButton.xml 2008-04-18 00:46:34 UTC (rev 7913)
@@ -107,5 +107,10 @@
<classname>int</classname>
<description>Timeout ( in ms ) for request.</description>
</property>
+ <property>
+ <name>disabled</name>
+ <classname>boolean</classname>
+ <description>If true, disable this component on page.</description>
+ </property>
</component>
</components>
\ No newline at end of file
Modified: trunk/ui/core/src/main/config/component/commandLink.xml
===================================================================
--- trunk/ui/core/src/main/config/component/commandLink.xml 2008-04-17 23:19:00 UTC (rev 7912)
+++ trunk/ui/core/src/main/config/component/commandLink.xml 2008-04-18 00:46:34 UTC (rev 7913)
@@ -88,5 +88,10 @@
<classname>int</classname>
<description>Timeout ( in ms ) for request.</description>
</property>
+ <property>
+ <name>disabled</name>
+ <classname>boolean</classname>
+ <description>If true, disable this component on page.</description>
+ </property>
</component>
</components>
\ No newline at end of file
Modified: trunk/ui/core/src/main/config/component/support.xml
===================================================================
--- trunk/ui/core/src/main/config/component/support.xml 2008-04-17 23:19:00 UTC (rev 7912)
+++ trunk/ui/core/src/main/config/component/support.xml 2008-04-18 00:46:34 UTC (rev 7913)
@@ -127,6 +127,11 @@
<classname>int</classname>
<description>Timeout (in ms) for request</description>
</property>
+ <property>
+ <name>disabled</name>
+ <classname>boolean</classname>
+ <description>If true, disable this component on page.</description>
+ </property>
</component>
16 years, 9 months
JBoss Rich Faces SVN: r7912 - branches/3.1.x/framework/impl/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-17 19:19:00 -0400 (Thu, 17 Apr 2008)
New Revision: 7912
Modified:
branches/3.1.x/framework/impl/src/main/java/org/richfaces/component/UISwitchablePanel.java
Log:
http://jira.jboss.com/jira/browse/RF-3091
Modified: branches/3.1.x/framework/impl/src/main/java/org/richfaces/component/UISwitchablePanel.java
===================================================================
--- branches/3.1.x/framework/impl/src/main/java/org/richfaces/component/UISwitchablePanel.java 2008-04-17 22:39:14 UTC (rev 7911)
+++ branches/3.1.x/framework/impl/src/main/java/org/richfaces/component/UISwitchablePanel.java 2008-04-17 23:19:00 UTC (rev 7912)
@@ -120,7 +120,7 @@
setValue(newValue);
}
- if (AjaxRendererUtils.isAjaxRequest(facesContext) && this.getSwitchType().equals(AJAX_METHOD)) {
+ if (AjaxRendererUtils.isAjaxRequest(facesContext) && AJAX_METHOD.equals(this.getSwitchType())) {
AjaxRendererUtils.addRegionByName(facesContext,
this,
this.getId());
16 years, 9 months
JBoss Rich Faces SVN: r7911 - trunk/framework/impl/src/main/java/org/richfaces/skin.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-17 18:39:14 -0400 (Thu, 17 Apr 2008)
New Revision: 7911
Modified:
trunk/framework/impl/src/main/java/org/richfaces/skin/SkinImpl.java
Log:
Fixed test failure
Modified: trunk/framework/impl/src/main/java/org/richfaces/skin/SkinImpl.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/skin/SkinImpl.java 2008-04-17 22:39:09 UTC (rev 7910)
+++ trunk/framework/impl/src/main/java/org/richfaces/skin/SkinImpl.java 2008-04-17 22:39:14 UTC (rev 7911)
@@ -44,9 +44,6 @@
public static final String RENDER_KIT_PARAMETER = "render.kit";
- @Deprecated
- public static final String REQUEST_HASH_CODE_PARAMETER = "org.ajax4jsf.skin.HASH_CODE";
-
public static final String REQUEST_HASH_CODES_MAP_PARAMETER = "org.ajax4jsf.skin.HASH_CODES_MAP";
private Map skinParams = new HashMap();
16 years, 9 months