JBoss Rich Faces SVN: r7940 - trunk/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-04-18 11:17:08 -0400 (Fri, 18 Apr 2008)
New Revision: 7940
Modified:
trunk/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
Log:
http://jira.jboss.com/jira/browse/RF-1070
Modified: trunk/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
===================================================================
--- trunk/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2008-04-18 15:12:07 UTC (rev 7939)
+++ trunk/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2008-04-18 15:17:08 UTC (rev 7940)
@@ -228,7 +228,7 @@
if (this.target)
form.target = this.target;
- Richfaces.jsFormSubmit(this.myId, form.name, this.target,this.params);
+ Richfaces.jsFormSubmit(this.myId, form.id, this.target,this.params);
//form.submit();
}
else if ("ajax" == this.mode) {
16 years, 9 months
JBoss Rich Faces SVN: r7939 - in trunk/samples/richfaces-demo/src/main: java/org/richfaces/demo/push and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-04-18 11:12:07 -0400 (Fri, 18 Apr 2008)
New Revision: 7939
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/push/
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/push/PushBean.java
trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/examples/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/examples/push.xhtml
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/usage.xhtml
Log:
Push example added
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/push/PushBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/push/PushBean.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/push/PushBean.java 2008-04-18 15:12:07 UTC (rev 7939)
@@ -0,0 +1,104 @@
+/**
+ *
+ */
+package org.richfaces.demo.push;
+
+import java.util.Date;
+import java.util.EventListener;
+import java.util.EventObject;
+import java.util.UUID;
+
+import org.ajax4jsf.event.PushEventListener;
+
+/**
+ * @author Ilya Shaikovsky
+ *
+ */
+
+public class PushBean implements Runnable {
+
+ private String uuid = "";
+
+ private boolean enabled = false;
+
+ private Date startDate;
+
+ PushEventListener listener;
+
+ private Thread thread;
+
+ // private int eventsFired counter;
+
+ public void addListener(EventListener listener) {
+ synchronized (listener) {
+ System.out.println("PushBean.addListener()");
+ if (this.listener != listener) {
+ this.listener = (PushEventListener) listener;
+ }
+ }
+ }
+
+ public void run() {
+ System.out.println("PushBean.run() executed");
+ while (thread != null) {
+ try {
+ System.out.println(((new Date()).getTime()-startDate.getTime())>=60000);
+ if (((new Date()).getTime()-startDate.getTime())>=20000) {
+ stop();
+ }
+ uuid = UUID.randomUUID().toString();
+ listener.onEvent(new EventObject(this));
+ Thread.sleep(10000);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ // e.printStackTrace();
+ }
+ }
+ }
+
+ public String getUuid() {
+ System.out.println(uuid + "returned");
+ return uuid;
+ }
+
+ public void start() {
+ if (thread == null) {
+ thread = new Thread(this);
+ thread.setDaemon(true);
+ thread.start();
+ System.out.println("PushBean.start()");
+ setStartDate(new Date());
+ setEnabled(true);
+ System.out.println("thread started");
+ }
+ }
+
+ public void stop() {
+ if (thread != null) {
+ //thread.stop();
+ setStartDate(null);
+ setEnabled(false);
+ thread = null;
+ }
+ }
+
+ public Thread getThread() {
+ return thread;
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public Date getStartDate() {
+ return startDate;
+ }
+
+ public void setStartDate(Date startDate) {
+ this.startDate = startDate;
+ }
+}
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/examples/push.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/examples/push.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/examples/push.xhtml 2008-04-18 15:12:07 UTC (rev 7939)
@@ -0,0 +1,30 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <h:form>
+ <a4j:push interval="1000" eventProducer="#{push.addListener}"
+ reRender="push,out" enabled="#{push.enabled}" id="push"/>
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="Push Example"/>
+ </f:facet>
+ <h:panelGrid columns="1" id="out">
+ <h:outputText rendered="#{!push.enabled}" value="Press Start to run push example"/>
+ <h:panelGroup rendered="#{push.enabled}">
+ <h:outputText value="Generated UUID:"/>
+ <h:outputText value="#{push.uuid}"/>
+ </h:panelGroup>
+ <h:panelGroup>
+ <a4j:commandButton value="Start" action="#{push.start}"
+ ajaxSingle="true" rendered="#{!push.enabled}" reRender="push"/>
+ <a4j:commandButton value="Stop" action="#{push.stop}"
+ ajaxSingle="true" rendered="#{push.enabled}" reRender="push"/>
+ </h:panelGroup>
+ </h:panelGrid>
+ </rich:panel>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/usage.xhtml 2008-04-18 15:11:33 UTC (rev 7938)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/push/usage.xhtml 2008-04-18 15:12:07 UTC (rev 7939)
@@ -1,79 +1,77 @@
-<!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:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich">
- <ui:composition template="/templates/component-sample.xhtml">
- <ui:define name="sample">
- <style>
- .viewsourcepanel {
- padding:10px;
- width:100%;
- overflow:auto;
- border-width:0;
- background-color:#FFFFFF;
- }
- .viewsourcebody {
- padding:0;
- }
-
- </style>
- <p>
- The <a4j:push> periodically perform AJAX request to server, to simulate 'push' data.
- </p>
- <p>
- The main difference between <a4j:push> and <a4j:poll> components
- is that <a4j:push> makes request to minimal code only (not to JSF tree)
- in order to check the presence of messages in the queue. If the message exists
- the complete request will be performed. The component doesn't poll registered
- beans but registers EventListener which receives messages about events.
- </p>
- <p>
- Attribute 'interval' is used as for poll component. It specifies the interval in ms.
- for call push request. Simple example of usage:
- </p>
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+ <style>
+.viewsourcepanel {
+ padding: 10px;
+ width: 100%;
+ overflow: auto;
+ border-width: 0;
+ background-color: #FFFFFF;
+}
+
+.viewsourcebody {
+ padding: 0;
+}
+</style>
+ <p>The <a4j:push> periodically perform AJAX request to
+ server, to simulate 'push' data.</p>
+ <p>The main difference between <a4j:push> and
+ <a4j:poll> components is that <a4j:push> makes request to
+ minimal code only (not to JSF tree) in order to check the presence of
+ messages in the queue. If the message exists the complete request will
+ be performed. The component doesn't poll registered beans but
+ registers EventListener which receives messages about events.</p>
+ <p>Attribute 'interval' is used as for poll component. It
+ specifies the interval in ms. for call push request. Simple example of
+ usage:</p>
<p>
- <fieldset class="demo_fieldset">
- <legend class="demo_legend">Page code:</legend>
- <rich:panel styleClass="viewsourcepanel" bodyClass="viewsourcebody">
- <rich:insert highlight="xhtml" src="/richfaces/push/snippets/page.xhtml"/>
- </rich:panel>
- </fieldset>
- </p>
+ <fieldset class="demo_fieldset"><legend class="demo_legend">Page
+ code:</legend> <rich:panel styleClass="viewsourcepanel"
+ bodyClass="viewsourcebody">
+ <rich:insert highlight="xhtml"
+ src="/richfaces/push/snippets/page.xhtml" />
+ </rich:panel></fieldset>
+ </p>
<p>
- <fieldset class="demo_fieldset">
- <legend class="demo_legend">Code for registration of listener:</legend>
- <rich:panel styleClass="viewsourcepanel" bodyClass="viewsourcebody">
- <rich:insert highlight="java" src="/richfaces/push/snippets/listenerReg.java"/>
- </rich:panel>
- </fieldset>
- </p>
+ <fieldset class="demo_fieldset"><legend class="demo_legend">Code
+ for registration of listener:</legend> <rich:panel styleClass="viewsourcepanel"
+ bodyClass="viewsourcebody">
+ <rich:insert highlight="java"
+ src="/richfaces/push/snippets/listenerReg.java" />
+ </rich:panel></fieldset>
+ </p>
<p>
- <fieldset class="demo_fieldset">
- <legend class="demo_legend">Component can get message using current code:</legend>
- <rich:panel styleClass="viewsourcepanel" bodyClass="viewsourcebody">
- <rich:insert highlight="java" src="/richfaces/push/snippets/listenermessage.java"/>
- </rich:panel>
- </fieldset>
- </p>
- <p>
- Thus, component 'push' uses asynchronous model instead of polls.
- </p>
- <ui:remove>
- <fieldset class="demo_fieldset">
- <legend class="demo_legend">Push Demo</legend>
- <div class="sample-container">
- <ui:include src="/richfaces/push/examples/push.xhtml"/>
- <ui:include src="/templates/include/sourceview.xhtml">
- <ui:param name="sourcepath" value="/richfaces/push/examples/push.xhtml"/>
- <ui:param name="openlabel" value="View Page Source" />
- </ui:include>
- </div>
- </fieldset>
- </ui:remove>
- </ui:define>
-
- </ui:composition>
-</html>
+ <fieldset class="demo_fieldset"><legend class="demo_legend">Component
+ can get message using current code:</legend> <rich:panel
+ styleClass="viewsourcepanel" bodyClass="viewsourcebody">
+ <rich:insert highlight="java"
+ src="/richfaces/push/snippets/listenermessage.java" />
+ </rich:panel></fieldset>
+ </p>
+ <p>Thus, component 'push' uses asynchronous model instead of
+ polls.</p>
+ <p>
+ Push example using <b>Runabble</b> interface (should be described.)
+ </p>
+ <fieldset class="demo_fieldset"><legend
+ class="demo_legend">Push Demo</legend>
+ <div class="sample-container"><ui:include
+ src="/richfaces/push/examples/push.xhtml" /> <ui:include
+ src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath"
+ value="/richfaces/push/examples/push.xhtml" />
+ <ui:param name="openlabel" value="View Page Source" />
+ </ui:include></div>
+ </fieldset>
+
+ </ui:define>
+
+</ui:composition>
+</html>
16 years, 9 months
JBoss Rich Faces SVN: r7937 - in trunk/test-applications/seleniumTest/src/test/java/org: richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-04-18 11:02:01 -0400 (Fri, 18 Apr 2008)
New Revision: 7937
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java
Log:
refactoring
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 15:00:39 UTC (rev 7936)
+++ trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java 2008-04-18 15:02:01 UTC (rev 7937)
@@ -1,5 +1,6 @@
package org.ajax4jsf.test.base;
+import org.ajax4jsf.javascript.ScriptUtils;
import org.testng.Assert;
import com.thoughtworks.selenium.DefaultSelenium;
@@ -297,6 +298,27 @@
public boolean isVisibleById(String id) {
return selenium.isVisible("id=" + id);
}
+
+ /**
+ * Invokes JS method on client.
+ * @param id - DOM id of component
+ * @param method - string method name
+ * @param parameters - parameters
+ * @return
+ */
+ public String invokeFromComponent(String id, String method, Object parameters) {
+ String _return = null;
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("$('");
+ buffer.append(id);
+ buffer.append("').component.");
+ buffer.append(method);
+ buffer.append("(");
+ buffer.append(ScriptUtils.toScript(parameters));
+ buffer.append(");");
+ _return = runScript(buffer.toString());
+ return _return;
+ }
/**
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java 2008-04-18 15:00:39 UTC (rev 7936)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/ProgressBarTest.java 2008-04-18 15:02:01 UTC (rev 7937)
@@ -91,30 +91,18 @@
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());
+ invokeFromComponent(id, (enable ? "enable" : "disable"), null);
}
private void setProgressBarValue(String id, Object value) {
- StringBuffer script = new StringBuffer("$('");
- script.append(id).append("').component.").append("setValue(").append(
- value).append(");");
- runScript(script.toString());
+ invokeFromComponent(id, "setValue", value);
}
private Integer getProgressBarValue(String id) {
- StringBuffer script = new StringBuffer("$('");
- script.append(id).append("').component.").append("getValue();");
- String value = runScript(script.toString());
+ String value = invokeFromComponent(id, "getValue", null); //runScript(script.toString());
Integer v = Integer.parseInt(value);
return v;
}
16 years, 9 months
JBoss Rich Faces SVN: r7936 - in trunk/test-applications/seleniumTest/src: main/webapp/WEB-INF and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-04-18 11:00:39 -0400 (Fri, 18 Apr 2008)
New Revision: 7936
Added:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RichPanelTestBean.java
trunk/test-applications/seleniumTest/src/main/webapp/pages/simpleTogglePanel/
trunk/test-applications/seleniumTest/src/main/webapp/pages/simpleTogglePanel/simpleTogglePanel.xhtml
trunk/test-applications/seleniumTest/src/main/webapp/pages/simpleTogglePanel/simpleTogglePanelDescription.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java
Removed:
trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TabPanelTestBean.java
Modified:
trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/seleniumTest/src/main/webapp/pages/tabPanel/tabPanelTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java
Log:
Selenium tests for simple toggle panel.
Copied: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RichPanelTestBean.java (from rev 7921, trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TabPanelTestBean.java)
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RichPanelTestBean.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/RichPanelTestBean.java 2008-04-18 15:00:39 UTC (rev 7936)
@@ -0,0 +1,73 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf;
+
+import javax.faces.event.ActionEvent;
+
+public class RichPanelTestBean {
+ private String value;
+ private int value2;
+
+ public RichPanelTestBean() {
+ value = "";
+ value2 = 0;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void actionListener(ActionEvent event) {
+ this.value = event.getComponent().getId();
+ }
+
+ public String action1() {
+ this.value2 = 1;
+ return null;
+ }
+
+ public String action2() {
+ this.value2 = 2;
+ return null;
+ }
+
+ public String increment() {
+ if (4 == this.value2) {
+ this.value2 = 0;
+ }
+ this.value2++;
+ return null;
+ }
+
+ public int getValue2() {
+ return value2;
+ }
+
+ public void setValue2(int value2) {
+ this.value2 = value2;
+ }
+
+}
Deleted: trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TabPanelTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TabPanelTestBean.java 2008-04-18 13:57:50 UTC (rev 7935)
+++ trunk/test-applications/seleniumTest/src/main/java/org/ajax4jsf/TabPanelTestBean.java 2008-04-18 15:00:39 UTC (rev 7936)
@@ -1,44 +0,0 @@
-package org.ajax4jsf;
-
-import javax.faces.event.ActionEvent;
-
-public class TabPanelTestBean {
- private String value;
- private String value2;
-
- public TabPanelTestBean() {
- value = "";
- value2 = "";
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public void actionListener(ActionEvent event) {
- this.value = event.getComponent().getId();
- }
-
- public String action1() {
- this.value2 = "1";
- return null;
- }
-
- public String action2() {
- this.value2 = "2";
- return null;
- }
-
- public String getValue2() {
- return value2;
- }
-
- public void setValue2(String value2) {
- this.value2 = value2;
- }
-
-}
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 13:57:50 UTC (rev 7935)
+++ trunk/test-applications/seleniumTest/src/main/webapp/WEB-INF/faces-config.xml 2008-04-18 15:00:39 UTC (rev 7936)
@@ -32,9 +32,9 @@
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
- <managed-bean-name>tabPanelBean</managed-bean-name>
- <managed-bean-class>org.ajax4jsf.TabPanelTestBean</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
+ <managed-bean-name>panelBean</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.RichPanelTestBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/src/main/webapp/pages/simpleTogglePanel/simpleTogglePanel.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/pages/simpleTogglePanel/simpleTogglePanel.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/pages/simpleTogglePanel/simpleTogglePanel.xhtml 2008-04-18 15:00:39 UTC (rev 7936)
@@ -0,0 +1,64 @@
+<!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="style">
+
+ </ui:define>
+ <ui:define name="component">
+ <rich:simpleTogglePanel switchType="ajax" id="panel1" label="ajax switchType"
+ action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"
+ opened="false"
+ reRender="_value,_value2" >
+ <f:facet name="closeMarker">
+ <h:outputText value="Close It" />
+ </f:facet>
+ <f:facet name="openMarker">
+ <h:outputText value="Open It" />
+ </f:facet>
+ <h:panelGroup id="content1" >
+ <h:outputText value="content" />
+ </h:panelGroup>
+ </rich:simpleTogglePanel>
+
+ <rich:simpleTogglePanel switchType="server" id="panel2" label="server switchType"
+ action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"
+ opened="false" >
+ <f:facet name="closeMarker">
+ <h:outputText value="Close It" />
+ </f:facet>
+ <f:facet name="openMarker">
+ <h:outputText value="Open It" />
+ </f:facet>
+ <h:panelGroup id="content2" >
+ <h:outputText value="content" />
+ </h:panelGroup>
+ </rich:simpleTogglePanel>
+
+ <rich:simpleTogglePanel switchType="client" id="panel3" label="client switchType"
+ opened="false" >
+ <f:facet name="closeMarker">
+ <h:outputText value="Close It" />
+ </f:facet>
+ <f:facet name="openMarker">
+ <h:outputText value="Open It" />
+ </f:facet>
+ <h:panelGroup id="content3" >
+ <h:outputText value="content" />
+ </h:panelGroup>
+ </rich:simpleTogglePanel>
+ <br/>
+ <h:inputText value="#{panelBean.value}" id="_value"></h:inputText>
+ <h:outputText value="#{panelBean.value2}" id="_value2"></h:outputText>
+ <br/>
+ </ui:define>
+ <ui:define name="description">
+ <ui:include src="simpleTogglePanelDescription.xhtml" />
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/src/main/webapp/pages/simpleTogglePanel/simpleTogglePanelDescription.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/pages/simpleTogglePanel/simpleTogglePanelDescription.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/src/main/webapp/pages/simpleTogglePanel/simpleTogglePanelDescription.xhtml 2008-04-18 15:00:39 UTC (rev 7936)
@@ -0,0 +1,5 @@
+<html>
+<table border="1" style="border-color: #F1EEE9" cellpadding="5" cellspacing="0">
+
+</table>
+</html>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/src/main/webapp/pages/tabPanel/tabPanelTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/src/main/webapp/pages/tabPanel/tabPanelTest.xhtml 2008-04-18 13:57:50 UTC (rev 7935)
+++ trunk/test-applications/seleniumTest/src/main/webapp/pages/tabPanel/tabPanelTest.xhtml 2008-04-18 15:00:39 UTC (rev 7936)
@@ -14,15 +14,15 @@
<rich:tabPanel id="panel1" switchType="ajax" >
<rich:tab label="tab1"
id="tab1"
- action="#{tabPanelBean.action1}"
- actionListener="#{tabPanelBean.actionListener}"
+ action="#{panelBean.action1}"
+ actionListener="#{panelBean.actionListener}"
switchType="server"
>
</rich:tab>
<rich:tab label="tab2"
id="tab2"
- action="#{tabPanelBean.action2}"
- actionListener="#{tabPanelBean.actionListener}"
+ action="#{panelBean.action2}"
+ actionListener="#{panelBean.actionListener}"
reRender="_value,_value2"
>
</rich:tab>
@@ -39,8 +39,8 @@
</rich:tabPanel>
<br/>
- <h:inputText value="#{tabPanelBean.value}" id="_value"></h:inputText>
- <h:outputText value="#{tabPanelBean.value2}" id="_value2"></h:outputText>
+ <h:inputText value="#{panelBean.value}" id="_value"></h:inputText>
+ <h:outputText value="#{panelBean.value2}" id="_value2"></h:outputText>
<br/>
</ui:define>
<ui:define name="description">
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SimpleTogglePanelTest.java 2008-04-18 15:00:39 UTC (rev 7936)
@@ -0,0 +1,105 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+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 SimpleTogglePanelTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public SimpleTogglePanelTest() {
+ 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 testTabPanelComponent() throws Exception {
+ renderPage("/faces/pages/simpleTogglePanel/simpleTogglePanel.xhtml");
+
+ _testSimpleTogglePanelComponent(COMPONENT_PREFIX_INSIDE_PANEL);
+ _testSimpleTogglePanelComponent(COMPONENT_PREFIX_INSIDE_TABLE);
+ }
+
+ private void _testSimpleTogglePanelComponent(String parentId) {
+ String inputId = parentId + "_value";
+ String outputId = parentId + "_value2";
+
+ String ajaxHeader = parentId + "panel1_header";
+ String serverHeader = parentId + "panel2_header";
+ String clientHeader = parentId + "panel3_header";
+
+ String ajaxBody = parentId + "panel1_body";
+ String serverBody = parentId + "panel2_body";
+ String clientBody = parentId + "panel3_body";
+
+ clickById(clientHeader);
+ Assert.assertTrue(isVisibleById(clientBody));
+ clickById(clientHeader);
+ Assert.assertFalse(isVisibleById(clientBody));
+
+ clickById(ajaxHeader);
+ waitForAjaxCompletion(5000);
+ AssertValueEquals(inputId, "panel1");
+ AssertTextEquals(outputId, "1");
+ Assert.assertTrue(isVisibleById(ajaxBody));
+
+ clickById(ajaxHeader);
+ waitForAjaxCompletion(5000);
+ AssertValueEquals(inputId, "panel1");
+ AssertTextEquals(outputId, "2");
+ Assert.assertFalse(isVisibleById(ajaxBody));
+
+ clickById(serverHeader);
+ waitForPageToLoad();
+ AssertValueEquals(inputId, "panel2");
+ AssertTextEquals(outputId, "3");
+ Assert.assertTrue(isVisibleById(serverBody));
+
+ clickById(serverHeader);
+ waitForPageToLoad();
+ AssertValueEquals(inputId, "panel2");
+ AssertTextEquals(outputId, "4");
+ Assert.assertFalse(isVisibleById(serverBody));
+ }
+
+}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java 2008-04-18 13:57:50 UTC (rev 7935)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/TabPanelTest.java 2008-04-18 15:00:39 UTC (rev 7936)
@@ -1,3 +1,24 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
package org.richfaces;
import org.ajax4jsf.test.base.RichSeleniumTest;
16 years, 9 months
JBoss Rich Faces SVN: r7935 - branches/3.1.x/test-applications/jsp/src/main/webapp/styles.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-04-18 09:57:50 -0400 (Fri, 18 Apr 2008)
New Revision: 7935
Modified:
branches/3.1.x/test-applications/jsp/src/main/webapp/styles/styles.css
Log:
+.test class
Modified: branches/3.1.x/test-applications/jsp/src/main/webapp/styles/styles.css
===================================================================
--- branches/3.1.x/test-applications/jsp/src/main/webapp/styles/styles.css 2008-04-18 13:32:51 UTC (rev 7934)
+++ branches/3.1.x/test-applications/jsp/src/main/webapp/styles/styles.css 2008-04-18 13:57:50 UTC (rev 7935)
@@ -249,4 +249,11 @@
.body {
background-color: pink;
+}
+.test {
+ background-color: pink;
+ color: red;
+ font-size: 12 px;
+ font-family: cursive;
+ font-style: inherit;
}
\ No newline at end of file
16 years, 9 months
JBoss Rich Faces SVN: r7934 - trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-04-18 09:32:51 -0400 (Fri, 18 Apr 2008)
New Revision: 7934
Modified:
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
Log:
the latest changes
Modified: trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
--- trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2008-04-18 12:52:21 UTC (rev 7933)
+++ trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2008-04-18 13:32:51 UTC (rev 7934)
@@ -167,8 +167,13 @@
this.addSelectedItem(activeElem);
this.setActiveItem(activeElem);
} else if (event.shiftKey) {
- this.selectItemGroup(activeElem);
- this.activeItem = activeElem; //given event works with pseudoActiveItem
+ if (!this.pseudoActiveItem) {
+ this.selectionItem(activeElem);
+ this.setActiveItem(activeElem);
+ } else {
+ this.selectItemGroup(activeElem);
+ this.activeItem = activeElem; //given event works with pseudoActiveItem
+ }
} else {
this.selectionItem(activeElem);
this.setActiveItem(activeElem);
16 years, 9 months
JBoss Rich Faces SVN: r7933 - branches/3.1.x/test-applications/jsp/src/main/webapp/CustomizePage.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-04-18 08:52:21 -0400 (Fri, 18 Apr 2008)
New Revision: 7933
Modified:
branches/3.1.x/test-applications/jsp/src/main/webapp/CustomizePage/CustomizePage.jsp
Log:
add modal panel binding
Modified: branches/3.1.x/test-applications/jsp/src/main/webapp/CustomizePage/CustomizePage.jsp
===================================================================
--- branches/3.1.x/test-applications/jsp/src/main/webapp/CustomizePage/CustomizePage.jsp 2008-04-18 12:29:02 UTC (rev 7932)
+++ branches/3.1.x/test-applications/jsp/src/main/webapp/CustomizePage/CustomizePage.jsp 2008-04-18 12:52:21 UTC (rev 7933)
@@ -29,6 +29,11 @@
<h:form id="test">
</h:form>
+ <h:form>
+ <h:commandButton value="getMPanelID" actionListener="#{modalPanel.checkBinding}">
+ </h:commandButton>
+ <h:outputText value="#{modalPanel.bindLabel}" />
+ </h:form>
</body>
</f:view>
</html>
16 years, 9 months
JBoss Rich Faces SVN: r7932 - trunk/test-applications/facelets/src/main/webapp/InplaceInput.
by richfaces-svn-commits@lists.jboss.org
Author: gmaksimenko
Date: 2008-04-18 08:29:02 -0400 (Fri, 18 Apr 2008)
New Revision: 7932
Modified:
trunk/test-applications/facelets/src/main/webapp/InplaceInput/InplaceInput.xhtml
Log:
Change in test for binding
Modified: trunk/test-applications/facelets/src/main/webapp/InplaceInput/InplaceInput.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/InplaceInput/InplaceInput.xhtml 2008-04-18 12:28:45 UTC (rev 7931)
+++ trunk/test-applications/facelets/src/main/webapp/InplaceInput/InplaceInput.xhtml 2008-04-18 12:29:02 UTC (rev 7932)
@@ -50,7 +50,9 @@
onmouseup="#{event.onmouseup}"
onselect="#{event.onselect}"
onviewactivated="#{evant.onviewactivated}"
- onviewactivation="#{event.onviewactivation}">
+ onviewactivation="#{event.onviewactivation}"
+ binding="#{inplaceInput.myInplaceInput}"
+ viewClass = "ccc">
</rich:inplaceInput>
are easy to exploit. <h:commandButton value="ok"></h:commandButton>
<h:panelGrid columns="2">
16 years, 9 months
JBoss Rich Faces SVN: r7931 - trunk/test-applications/facelets/src/main/java/inplaceInput.
by richfaces-svn-commits@lists.jboss.org
Author: gmaksimenko
Date: 2008-04-18 08:28:45 -0400 (Fri, 18 Apr 2008)
New Revision: 7931
Modified:
trunk/test-applications/facelets/src/main/java/inplaceInput/InplaceInput.java
Log:
Change in test for binding
Modified: trunk/test-applications/facelets/src/main/java/inplaceInput/InplaceInput.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/inplaceInput/InplaceInput.java 2008-04-18 12:00:52 UTC (rev 7930)
+++ trunk/test-applications/facelets/src/main/java/inplaceInput/InplaceInput.java 2008-04-18 12:28:45 UTC (rev 7931)
@@ -24,7 +24,7 @@
private boolean rendered;
private boolean immediate;
private String valueCL;
- private HtmlInplaceInput myInplaceInput;
+ private HtmlInplaceInput myInplaceInput = null;
private String bindLabel;
private String layout;
@@ -56,8 +56,8 @@
minInputWidth = "100";
required = false;
requiredMessage = "requiredMessage";
- tabindex = 1;
- editEvent = "click";
+ tabindex = 0;
+ editEvent = "onclick";
defaultLabel = "defaultLabel";
controlsVerticalPosition = "top";
controlsHorizontalPosition = "left";
@@ -67,7 +67,6 @@
rendered = true;
immediate = false;
valueCL = "---";
- myInplaceInput = new HtmlInplaceInput();
bindLabel = "Click Binding";
layout = "inline";
}
16 years, 9 months