JBoss Rich Faces SVN: r10664 - trunk/test-applications/facelets/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-10-03 10:39:55 -0400 (Fri, 03 Oct 2008)
New Revision: 10664
Modified:
trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-DataGrid.xml
Log:
Modified: trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-DataGrid.xml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-DataGrid.xml 2008-10-03 14:39:44 UTC (rev 10663)
+++ trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-DataGrid.xml 2008-10-03 14:39:55 UTC (rev 10664)
@@ -12,11 +12,5 @@
<managed-bean-name>table</managed-bean-name>
<managed-bean-class>dataGrid.Table</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
-
- <managed-bean>
- <managed-bean-name>cell</managed-bean-name>
- <managed-bean-class>dataGrid.Cell</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
+ </managed-bean>
</faces-config>
\ No newline at end of file
16 years, 3 months
JBoss Rich Faces SVN: r10663 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/modalPanel and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-10-03 10:39:44 -0400 (Fri, 03 Oct 2008)
New Revision: 10663
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/modalPanel/modalPanelTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java
Log:
Modal Panel: test keepVisualState
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java 2008-10-03 14:21:44 UTC (rev 10662)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java 2008-10-03 14:39:44 UTC (rev 10663)
@@ -18,6 +18,7 @@
private Boolean moveable = true;
private Boolean resizeable = true;
private Boolean autosized = false;
+ private Boolean keepVisualState = false;
private String input;
/**
* @return the rendered
@@ -87,6 +88,12 @@
return null;
}
+ public String changeKeepVisualState() {
+ keepVisualState = true;
+ showWhenRendered = false;
+ return null;
+ }
+
public String reset(){
rendered = true;
showWhenRendered = false;
@@ -94,6 +101,7 @@
resizeable = true;
input = null;
autosized = false;
+ keepVisualState = false;
return null;
}
@@ -121,5 +129,17 @@
public void setAutosized(Boolean autosized) {
this.autosized = autosized;
}
+ /**
+ * @return the keepVisualState
+ */
+ public Boolean getKeepVisualState() {
+ return keepVisualState;
+ }
+ /**
+ * @param keepVisualState the keepVisualState to set
+ */
+ public void setKeepVisualState(Boolean keepVisualState) {
+ this.keepVisualState = keepVisualState;
+ }
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/modalPanel/modalPanelTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java 2008-10-03 14:21:44 UTC (rev 10662)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java 2008-10-03 14:39:44 UTC (rev 10663)
@@ -25,6 +25,7 @@
private final static String CHANGE_RENDERED_ID="change_rendered";
private final static String CHANGE_ATTRIBUTES_ID="change_attributes";
private final static String CHANGE_AUTOSIZED_ID = "set_autosized";
+ private final static String CHANGE_VISUAL_STATE_ID = "keep_visual";
private final static String HIDE_ID="hide";
private final static String SHOW_ID="show";
private final static String PANEL_C_DIV_ID = PANEL_ID + "CDiv";
@@ -289,7 +290,40 @@
}
+ @Test
+ public void testKeepVisualState(Template template) {
+ renderPage(template, RESET_METHOD_NAME);
+ String message = "KeepVisualState attribute does not work";
+ clickChangeVisualState();
+
+
+ String headerId = getParentId() + PANEL_HEADER_ID;
+ String cIdvId = getParentId() + PANEL_C_DIV_ID;
+ String resizerId = getParentId() + PANEL_ID + "ResizerSEL";
+ String contentId = getParentId() + PANEL_CONTENT_DIV_ID;
+
+ selenium.dragAndDrop(headerId, "+10,+10");
+ selenium.dragAndDrop(resizerId, "+10,+10");
+
+ Integer left = (Integer)getLeftById(cIdvId);
+ Integer top = (Integer)getTopById(cIdvId);
+
+ String width = getWidth(contentId);
+ String height = getHeight(contentId);
+
+ String commandId = getParentId() + FORM2_ID + "submit";
+ clickCommandAndWait(commandId);
+
+ Assert.assertTrue(((Integer)getLeftById(cIdvId)).equals(left), message);
+ Assert.assertTrue(((Integer)getTopById(cIdvId)).equals(top), message);
+ Assert.assertTrue(getWidth(contentId).equals(width), message);
+ Assert.assertTrue(getHeight(contentId).equals(height), message);
+
+
+ }
+
+
private String getWidth(String id) {
String w = runScript("$('"+id+"').style.width", false);
return w;
@@ -323,6 +357,12 @@
writeStatus("Click change attributes button");
clickCommandAndWait(buttonId);
}
+
+ private void clickChangeVisualState() {
+ String buttonId = getParentId() + FORM_ID + CHANGE_VISUAL_STATE_ID;
+ writeStatus("Click change visual state button");
+ clickCommandAndWait(buttonId);
+ }
private void clickShow() {
String buttonId = getParentId() + FORM_ID + SHOW_ID;
16 years, 3 months
JBoss Rich Faces SVN: r10662 - trunk/sandbox/ui/editor/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-10-03 10:21:44 -0400 (Fri, 03 Oct 2008)
New Revision: 10662
Modified:
trunk/sandbox/ui/editor/src/test/java/org/richfaces/component/EditorComponentTest.java
Log:
Adjust Junit test for Editor component
Modified: trunk/sandbox/ui/editor/src/test/java/org/richfaces/component/EditorComponentTest.java
===================================================================
--- trunk/sandbox/ui/editor/src/test/java/org/richfaces/component/EditorComponentTest.java 2008-10-03 14:20:16 UTC (rev 10661)
+++ trunk/sandbox/ui/editor/src/test/java/org/richfaces/component/EditorComponentTest.java 2008-10-03 14:21:44 UTC (rev 10662)
@@ -8,6 +8,11 @@
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
+/**
+ * Editor component Junit Test
+ * @author Alexandr Levkovsky
+ *
+ */
public class EditorComponentTest extends AbstractAjax4JsfTestCase {
UIForm form;
16 years, 3 months
JBoss Rich Faces SVN: r10661 - in trunk/sandbox/ui/editor/src: main/java/org/richfaces/component and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-10-03 10:20:16 -0400 (Fri, 03 Oct 2008)
New Revision: 10661
Added:
trunk/sandbox/ui/editor/src/test/java/org/richfaces/component/EditorComponentTest.java
trunk/sandbox/ui/editor/src/test/resources/
trunk/sandbox/ui/editor/src/test/resources/WEB-INF/
trunk/sandbox/ui/editor/src/test/resources/WEB-INF/web.xml
Modified:
trunk/sandbox/ui/editor/src/main/config/component/editor.xml
trunk/sandbox/ui/editor/src/main/java/org/richfaces/component/SeamTextConverter.java
Log:
Adjust Junit test for Editor component
Modified: trunk/sandbox/ui/editor/src/main/config/component/editor.xml
===================================================================
--- trunk/sandbox/ui/editor/src/main/config/component/editor.xml 2008-10-03 14:03:14 UTC (rev 10660)
+++ trunk/sandbox/ui/editor/src/main/config/component/editor.xml 2008-10-03 14:20:16 UTC (rev 10661)
@@ -7,6 +7,8 @@
<classname>org.richfaces.component.html.HtmlEditor</classname>
<superclass>org.richfaces.component.UIEditor</superclass>
<test>
+ <classname>org.richfaces.component.EditorComponentTest</classname>
+ <superclassname>org.ajax4jsf.tests.AbstractAjax4JsfTestCase</superclassname>
</test>
<description>
</description>
Modified: trunk/sandbox/ui/editor/src/main/java/org/richfaces/component/SeamTextConverter.java
===================================================================
--- trunk/sandbox/ui/editor/src/main/java/org/richfaces/component/SeamTextConverter.java 2008-10-03 14:03:14 UTC (rev 10660)
+++ trunk/sandbox/ui/editor/src/main/java/org/richfaces/component/SeamTextConverter.java 2008-10-03 14:20:16 UTC (rev 10661)
@@ -58,7 +58,7 @@
public String getAsString(FacesContext context, UIComponent component,
Object value) {
if (value == null) {
- return null;
+ return "";
}
SeamTextParser parser = null;
Added: trunk/sandbox/ui/editor/src/test/java/org/richfaces/component/EditorComponentTest.java
===================================================================
--- trunk/sandbox/ui/editor/src/test/java/org/richfaces/component/EditorComponentTest.java (rev 0)
+++ trunk/sandbox/ui/editor/src/test/java/org/richfaces/component/EditorComponentTest.java 2008-10-03 14:20:16 UTC (rev 10661)
@@ -0,0 +1,116 @@
+package org.richfaces.component;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.html.HtmlForm;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+public class EditorComponentTest extends AbstractAjax4JsfTestCase {
+
+ UIForm form;
+ UIEditor editor;
+
+ private final static String SEAM_TEXT_EXPRESSION_1 = "It's easy to make *emphasis*, |monospace|,\n"
+ + "~deleted text~, super^scripts^ or _underlines_.";
+
+ private final static String SEAM_TEXT_EXPRESSION_2 = "+This is a big heading\n"
+ + "You /must/ have some text following a heading!\n"
+ + "++This is a smaller heading\n"
+ + "This is the first paragraph. We can split it across multiple\n"
+ + "lines, but we must end it with a blank line.\n"
+ + "This is the second paragraph.";
+
+ private final static String SEAM_TEXT_EXPRESSION_3 = "An ordered list:\n"
+ + "\\#first item\n" + "\\#second item\n"
+ + "\\#and even the /third/ item\n" + "An unordered list:\n"
+ + "\\=an item\n" + "\\=another item\n";
+
+ private final static String SEAM_TEXT_EXPRESSION_4 = "The other guy said:\n"
+ + "\"Nyeah nyeah-nee\n"
+ + "/nyeah/ nyeah!\"\n"
+ + "But what do you think he means by \"nyeah-nee\"?";
+
+ private final static String SEAM_TEXT_EXPRESSION_5 = "You can write down equations like 2*3=6 and HTML tags\n"
+ + "like <body> using the escape character: \\.";
+
+ private final static String SEAM_TEXT_EXPRESSION_6 = "My code doesn't work:\n"
+ + "`for (int i=0; i<100; i--)\n"
+ + "{\n"
+ + "doSomething();\n"
+ + "}`\n" + "Any ideas?";
+
+ public EditorComponentTest(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ editor = (UIEditor) application.createComponent("org.richfaces.Editor");
+ form.getChildren().add(editor);
+ }
+
+ public void testRenderer() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ }
+
+ public void testSeamTextConverting1() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_1);
+ }
+
+ public void testSeamTextConverting2() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_2);
+ }
+
+ public void testSeamTextConverting3() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_3);
+ }
+
+ public void testSeamTextConverting4() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_4);
+ }
+
+ public void testSeamTextConverting5() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_5);
+ }
+
+ public void testSeamTextConverting6() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_6);
+ }
+
+ /**
+ * Method to assert converting from Seam Text to html and back
+ * @param seamTextExpression
+ * @throws Exception
+ */
+ private void assertSeamConverting(String seamTextExpression)
+ throws Exception {
+ editor.setUseSeamText(true);
+ editor.setValue(seamTextExpression);
+
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ String convertedValue = null;
+ HtmlElement component = page.getHtmlElementById(editor
+ .getClientId(facesContext));
+ convertedValue = component.getFirstDomChild().asText();
+
+ editor.setSubmittedValue(convertedValue);
+ editor.validate(facesContext);
+
+ // TODO: Must be uncomented when html convertion to Seam Text will be implemented in SeamTextConverter
+ //assertEquals(seamTextExpression, editor.getValue().toString());
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
Property changes on: trunk/sandbox/ui/editor/src/test/java/org/richfaces/component/EditorComponentTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/sandbox/ui/editor/src/test/resources/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/ui/editor/src/test/resources/WEB-INF/web.xml (rev 0)
+++ trunk/sandbox/ui/editor/src/test/resources/WEB-INF/web.xml 2008-10-03 14:20:16 UTC (rev 10661)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>testcase</display-name>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param>
+
+ <filter>
+ <description>Convert HTML to XML</description>
+ <display-name>Filter</display-name>
+ <filter-name>A4J</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ <init-param>
+ <param-name>publicid</param-name>
+ <param-value>-//W3C//DTD XHTML 1.0 Transitional//EN</param-value>
+ </init-param>
+ <init-param>
+ <param-name>systemid</param-name>
+ <param-value>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</param-value>
+ </init-param>
+ <init-param>
+ <param-name>namespace</param-name>
+ <param-value>http://www.w3.org/1999/xhtml</param-value>
+ </init-param>
+ <init-param>
+ <param-name>forceparser</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>rewriteid</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>mime-type</param-name>
+ <param-value>text/xml</param-value>
+ </init-param>
+ <init-param>
+ <param-name>log4j-init-file</param-name>
+ <param-value>WEB-INF/log4j.xml</param-value>
+ </init-param>
+ <init-param>
+ <param-name>enable-cache</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>A4J</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+ <listener>
+ <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
+ </listener>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet>
+ <servlet-name>TinyMCELoaderServlet</servlet-name>
+ <servlet-class>org.richfaces.component.TinyMceLoaderServlet</servlet-class>
+ <load-on-startup>2</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>TinyMCELoaderServlet</servlet-name>
+ <url-pattern>/a4j/g/3_3_0-SNAPSHOTorg/richfaces/renderkit/html/scripts/tiny_mce/*</url-pattern>
+ </servlet-mapping>
+</web-app>
Property changes on: trunk/sandbox/ui/editor/src/test/resources/WEB-INF/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
16 years, 3 months
JBoss Rich Faces SVN: r10660 - in trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces: testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-10-03 10:03:14 -0400 (Fri, 03 Oct 2008)
New Revision: 10660
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java
Log:
AjaxStatus: style and classes, standard HTML attributes are output to client
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-03 13:20:20 UTC (rev 10659)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-10-03 14:03:14 UTC (rev 10660)
@@ -871,10 +871,17 @@
* @param expectedExpression - expected style attribute
*/
public void assertStyleAttribute(String elementId, String expectedExpression) {
- String styleAttribute = selenium.getAttribute("//*[@id='" + elementId + "']/@style");
- if (!styleAttribute.toLowerCase().contains(expectedExpression.toLowerCase())) {
- Assert.fail("Element '" + elementId + "' with style '" + styleAttribute + "' doesn't contain '" + expectedExpression + "'");
- }
+ String styleAttribute = null;
+ try {
+ styleAttribute = selenium.getAttribute("//*[@id='" + elementId + "']/@style");
+ } catch (Throwable e) {
+ // consume exception
+ }
+
+ if (null == styleAttribute || !styleAttribute.toLowerCase().contains(expectedExpression.toLowerCase())) {
+ Assert.fail("Element '" + elementId + "' with style '" + styleAttribute + "' doesn't contain '"
+ + expectedExpression + "'");
+ }
}
/**
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-10-03 13:20:20 UTC (rev 10659)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxStatusTest.java 2008-10-03 14:03:14 UTC (rev 10660)
@@ -139,6 +139,18 @@
assertEvents(eventsExpected);
}
+ @Test
+ public void testStyleAndClassesStandardHTMLAttributesAreOutputToClient(Template template) {
+ renderPage(template);
+
+ writeStatus("Check style and classes, standard HTML attributes are output to client");
+
+ String statusElemId = getParentId() + "_form:" + STATUS_1_ID;
+
+ assertStyleAttribute(statusElemId, "font-size: 13px");
+ assertClassNames(statusElemId, new String[] { "noclass" }, "Class attribute was not output to client ", true);
+ }
+
public String getTestUrl() {
return "pages/ajaxStatus/ajaxStatusTest.xhtml";
}
16 years, 3 months
JBoss Rich Faces SVN: r10659 - in trunk/test-applications/seleniumTest/richfaces/src: main/java/org/ajax4jsf/autotest and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-10-03 09:20:20 -0400 (Fri, 03 Oct 2008)
New Revision: 10659
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/AutoTestContext.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/AutoTestServlet.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/_autotest/
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/_autotest/autotest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/_autotest/autotestsetup.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/web.xml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
autotest for standard HTML & events components
Added: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/AutoTestContext.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/AutoTestContext.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/AutoTestContext.java 2008-10-03 13:20:20 UTC (rev 10659)
@@ -0,0 +1,43 @@
+package org.ajax4jsf.autotest;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AutoTestContext {
+
+ String component;
+
+ List<String> events = new ArrayList<String>();
+
+ String rendered;
+
+ public AutoTestContext(String component) {
+ this.component = component;
+ }
+
+ public void addEvent(String ev) {
+ events.add(ev);
+ }
+
+ /**
+ * @return the component
+ */
+ public String getComponent() {
+ return component;
+ }
+
+ /**
+ * @return the events
+ */
+ public List<String> getEvents() {
+ return events;
+ }
+
+ /**
+ * @return the rendered
+ */
+ public String getRendered() {
+ return rendered;
+ }
+
+}
Added: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/AutoTestServlet.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/AutoTestServlet.java (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/autotest/AutoTestServlet.java 2008-10-03 13:20:20 UTC (rev 10659)
@@ -0,0 +1,82 @@
+/*
+ * MyServlet.java Date created: 03.10.2008
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+
+package org.ajax4jsf.autotest;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * TODO Class description goes here.
+ * @author Andrey
+ *
+ */
+public class AutoTestServlet extends HttpServlet {
+
+ private static final String COMPONENT_PARAMETER_NAME = "c";
+
+ private static final String EVENT_PARAMETER_NAME = "ev";
+
+ private static final String CONTEXT_NAME = "SeleniumAutoTestContext";
+
+ String header = "<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\">";
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException {
+ AutoTestContext context = (AutoTestContext)getServletContext().getAttribute(CONTEXT_NAME);
+ if (context == null) {
+ throw new NullPointerException("Test context is null");
+ }
+
+ PrintWriter writer = resp.getWriter();
+ writer.write(header);
+
+ writer.write("<");
+ writer.write(context.getComponent());
+ writer.write(" ");
+ writer.write("id=\"test\" ");
+
+ for (String ev : context.getEvents()) {
+ writer.write(ev + "=\"EventQueue.fire('"+ev+"')\" ");
+ }
+
+ writer.write(">");
+ writer.write("</" + context.getComponent() + ">");
+
+ writer.write("</html>");
+ }
+
+ @Override
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException {
+ String component = req.getParameter(COMPONENT_PARAMETER_NAME);
+ String [] events = req.getParameterValues(EVENT_PARAMETER_NAME);
+
+ AutoTestContext context = new AutoTestContext(component);
+ for (String event: events) {
+ context.addEvent(event);
+ }
+
+ getServletContext().setAttribute(CONTEXT_NAME, context);
+
+ resp.sendRedirect("/richfaces/faces/NEKO/pages/_autotest/autotest.xhtml");
+
+ }
+
+
+
+}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/web.xml 2008-10-03 12:22:47 UTC (rev 10658)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/WEB-INF/web.xml 2008-10-03 13:20:20 UTC (rev 10659)
@@ -96,6 +96,11 @@
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet>
+ <servlet-name>Auto Test Servlet</servlet-name>
+ <servlet-class>org.ajax4jsf.autotest.AutoTestServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
@@ -103,6 +108,10 @@
<url-pattern>/faces/TIDY/*</url-pattern>
<url-pattern>/faces/NONE/*</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Auto Test Servlet</servlet-name>
+ <url-pattern>/autotest/*</url-pattern>
+ </servlet-mapping>
<error-page>
<exception-type>javax.servlet.ServletException</exception-type>
<location>/faces/error.xhtml</location>
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/_autotest/autotest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/_autotest/autotest.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/_autotest/autotest.xhtml 2008-10-03 13:20:20 UTC (rev 10659)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.template}">
+ <ui:define name="style">
+
+ </ui:define>
+ <ui:define name="component">
+ <ui:include src="http://#{facesContext.externalContext.request.localName}:#{facesContext.externalContext.request.localPort}/#{facesContext.externalContext.request.contextPath}/autotest/test"></ui:include>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/_autotest/autotestsetup.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/_autotest/autotestsetup.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/_autotest/autotestsetup.xhtml 2008-10-03 13:20:20 UTC (rev 10659)
@@ -0,0 +1,33 @@
+<html>
+<head>
+ <script type="text/javascript">
+ function setComponent(c) {
+ $('c').value = c;
+ }
+
+ function addEvent(ev) {
+ var d = $('events');
+ var i = document.createElement('input');
+ i.name = "ev";
+ i.type="hidden";
+ i.value = ev;
+ d.appendChild(i);
+ }
+
+ function $(id) {
+ return document.getElementById(id);
+ }
+
+ function submitForm() {
+ $('f').submit();
+ }
+ </script>
+</head>
+<body>
+<form id="f" method="post" action="#{facesContext.externalContext.request.contextPath}/autotest/test">
+<input id="c" type="hidden" name="c" value="" />
+<div id="events" />
+</form>
+Loading...
+</body>
+</html>
\ No newline at end of file
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-03 12:22:47 UTC (rev 10658)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-10-03 13:20:20 UTC (rev 10659)
@@ -974,4 +974,31 @@
Assert.fail(message);
}
}
+
+ public void autoTest(Template template, String component, List<String> events) {
+ selenium.open(protocol + "://" + host + ":" + port + "/" + APPLICATION_NAME + filterPrefix + "/pages/_autotest/autotestsetup.xhtml");
+ waitForPageToLoad();
+
+ runScript("setComponent('"+component+"');", false);
+
+ for (String ev : events) {
+ runScript("addEvent('"+ev+"');", false);
+ }
+
+ runScript("submitForm();", false);
+ waitForPageToLoad();
+
+ runScript("loadTemplate('" + template + "');", false);
+ waitForPageToLoad();
+
+ String id = template.getPrefix() + "test";
+ for (String ev : events) {
+ if ("onclick".equals(ev)) {
+ clickById(id);
+ }
+
+ }
+
+ assertEvents(events);
+ }
}
16 years, 3 months
JBoss Rich Faces SVN: r10658 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-10-03 08:22:47 -0400 (Fri, 03 Oct 2008)
New Revision: 10658
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
a little assertClassNames method fix
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-03 11:07:11 UTC (rev 10657)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-10-03 12:22:47 UTC (rev 10658)
@@ -948,17 +948,17 @@
* @param isId - Pass true if ID is string, false - if ID is expression to load appropriate DOM element
*/
public void assertClassNames(String id, String[] classNames, String message, boolean isId) {
- for (String s : classNames) {
- String result = null;
- if (isId) {
- runScript("$('"+id+"').hasClassName('"+s+"')", false).toLowerCase();
- }else {
- runScript("$("+id+").hasClassName('"+s+"')", false).toLowerCase();
- }
- if (Boolean.FALSE.toString().toLowerCase().equals(result)) {
- Assert.fail(message + " Element [id="+id+"] should contain class name '"+s+"'");
- }
- }
+ for (String s : classNames) {
+ String result = null;
+ if (isId) {
+ result = runScript("$('" + id + "').hasClassName('" + s + "')", false).toLowerCase();
+ } else {
+ result = runScript("$(" + id + ").hasClassName('" + s + "')", false).toLowerCase();
+ }
+ if (Boolean.FALSE.toString().toLowerCase().equals(result)) {
+ Assert.fail(message + " Element [id=" + id + "] should contain class name '" + s + "'");
+ }
+ }
}
public void assertEvents(List<String> eventsExpected) {
16 years, 3 months
JBoss Rich Faces SVN: r10657 - trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-10-03 07:07:11 -0400 (Fri, 03 Oct 2008)
New Revision: 10657
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxstyles.js
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js
Log:
https://jira.jboss.org/jira/browse/RF-3630
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-10-03 09:37:32 UTC (rev 10656)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-10-03 11:07:11 UTC (rev 10657)
@@ -12,21 +12,19 @@
this.directInputSuggestions = directInputSuggestions;
this.filterNewValue = filterNewValue;
this.combobox = $(combobox);
- this.comboValue = $(valueFieldId);
- this.field = $(fieldId);
+ this.comboValue = document.getElementById(valueFieldId);
+ this.field = document.getElementById(fieldId);
+ this.tempItem;
+
this.BUTTON_WIDTH = 17; //px
this.classes = Richfaces.mergeStyles(userStyles,commonStyles);
- //this.field.prevValue = null;
+ this.button = document.getElementById(buttonId);
+ this.buttonBG = document.getElementById(buttonBGId);
- this.button = $(buttonId);
- this.buttonBG = $(buttonBGId);
-
this.setInputWidth();
-// var fieldDem = Richfaces.ComboBoxList.getElemXY(this.field);
-// fieldDem.height = this.field.offsetHeight;
listWidth = (!listWidth) ? this.getCurrentWidth() : listWidth;
this.comboList = new Richfaces.ComboBoxList(listId, parentListId, selectFirstOnUpdate, filterNewValue, this.classes.combolist, listWidth,
@@ -37,8 +35,6 @@
var item = this.comboList.findItemBySubstr(value);
if (item) {
this.comboList.doSelectItem(item);
-// initialize moved to the template http://jira.jboss.com/jira/browse/RF-2956
-// this.comboValue.value = item.innerHTML.unescapeHTML();
}
} else {
if (this.defaultMessage) {
@@ -56,9 +52,6 @@
}
if (Richfaces.browser.isIE6) {
- //http://jira.jboss.com/jira/browse/RF-3255
-// this.comboList.createIframe(this.comboList.listParent.parentNode, listWidth, this.combobox.id,
-// "rich-combobox-list-width rich-combobox-list-scroll rich-combobox-list-position");
this.comboList.createIframe(this.comboList.listParent.parentNode, listWidth, this.combobox.id,
"rich-combobox-list-width rich-combobox-list-scroll rich-combobox-list-position");
}
@@ -67,32 +60,25 @@
},
initHandlers : function() {
- this.button.observe("click", function(e){this.buttonClickHandler(e);}.bindAsEventListener(this));
- this.button.observe("mouseup", function(e){this.buttonMouseUpHandler(e);}.bindAsEventListener(this));
- this.button.observe("mousedown", function(e){this.buttonMousedownHandler(e);}.bindAsEventListener(this));
- this.button.observe("mouseover", function(e){this.buttonMouseOverHandler(e);}.bindAsEventListener(this));
- this.button.observe("mouseout", function(e){this.buttonMouseOutHandler(e);}.bindAsEventListener(this));
+ Event.observe(this.button, "click", this.buttonClickHandler.bindAsEventListener(this));
+ Event.observe(this.button, "mouseup", this.buttonMouseUpHandler.bindAsEventListener(this));
+ Event.observe(this.button, "mousedown", this.buttonMousedownHandler.bindAsEventListener(this));
+ Event.observe(this.button, "mouseover", this.buttonMouseOverHandler.bindAsEventListener(this));
+ Event.observe(this.button, "mouseout", this.buttonMouseOutHandler.bindAsEventListener(this));
- this.field.observe("keydown", function(e){this.fieldKeyDownHandler(e);}.bindAsEventListener(this));
- this.field.observe("blur", function(e){this.fieldBlurHandler(e);}.bindAsEventListener(this));
- this.field.observe("focus", function(e){this.fieldFocusHandler(e);}.bindAsEventListener(this));
- this.field.observe("keyup", function(e){this.dataUpdating(e);}.bindAsEventListener(this));
+ Event.observe(this.field, "keydown", this.fieldKeyDownHandler.bindAsEventListener(this));
+ Event.observe(this.field, "blur", this.fieldBlurHandler.bindAsEventListener(this));
+ Event.observe(this.field, "focus", this.fieldFocusHandler.bindAsEventListener(this));
+ Event.observe(this.field, "keyup", this.dataUpdating.bindAsEventListener(this));
- this.comboList.listParent.observe("mousedown", function(e){this.listMousedownHandler(e);}.bindAsEventListener(this));
- this.comboList.listParent.observe("mouseup", function(e){this.listMouseUpHandler(e);}.bindAsEventListener(this));
- this.comboList.listParent.observe("mousemove", function(e){this.listMouseMoveHandler(e)}.bindAsEventListener(this));
- this.comboList.listParent.observe("click", function(e){this.listClickHandler(e);}.bindAsEventListener(this));
+ Event.observe(this.comboList.listParent, "mousedown", this.listMousedownHandler.bindAsEventListener(this));
+ Event.observe(this.comboList.listParent, "mouseup", this.listMouseUpHandler.bindAsEventListener(this));
+ Event.observe(this.comboList.listParent, "mousemove", this.listMouseMoveHandler.bindAsEventListener(this));
+ Event.observe(this.comboList.listParent, "click", this.listClickHandler.bindAsEventListener(this));
},
setInputWidth : function() {
var width = (parseInt(this.field.parentNode.style.width) - this.BUTTON_WIDTH) + Richfaces.getBorderWidth(this.field, "lr");
-// if (Prototype.Browser.Gecko) {
- //border width and padding width not included in the general component width
-// width -= Richfaces.getPaddingWidth(this.field, "lr")
-// + Richfaces.getPaddingWidth(this.button, "lr")
-// + Richfaces.getBorderWidth(this.field, "lr")
-// + Richfaces.getBorderWidth(this.button, "lr");
-// }
this.field.style.width = width + "px";
},
@@ -127,10 +113,15 @@
if (this.isActive()) {
this.button.className= classCss.active + " " + classCss.hovered;
- this.button.style.backgroundImage = iconStyles.active;
+ if (!iconStyles.active.blank()) {
+ Element.setStyle(this.button,{backgroundImage : iconStyles.active});
+ }
+
} else {
this.button.className = classCss.normal + " " + classCss.hovered;
- this.button.style.backgroundImage = iconStyles.normal;
+ if (!iconStyles.normal.blank()) {
+ Element.setStyle(this.button,{backgroundImage : iconStyles.normal});
+ }
}
},
@@ -140,34 +131,36 @@
if (this.isActive()) {
this.button.className= classCss.active;
- this.button.style.backgroundImage = iconStyles.active;
+ if (!iconStyles.active.blank()) {
+ Element.setStyle(this.button,{backgroundImage : iconStyles.active});
+ }
} else {
this.button.className = classCss.normal;
- this.button.style.backgroundImage = iconStyles.normal;
+ if (!iconStyles.normal.blank()) {
+ Element.setStyle(this.button,{backgroundImage : iconStyles.normal});
+ }
}
},
listMouseMoveHandler : function(event) {
//changes item's decoration
- var item = this.comboList.getEventItem(event);
- if (item) {
- this.comboList.doActiveItem(this.comboList.getEventItem(event));
+ var item = event.target;
+ if(Element.match(item,"span")) {
+ if (item && this.tempItem != item ) {
+ this.comboList.doActiveItem(item);
+ }
+ this.tempItem = item;
}
+
},
- listMousedownHandler : function(e) {
+ listMousedownHandler : function(event) {
if (Prototype.Browser.IE) {
- if (!this.comboList.getEventItem(e)) {
+ if (!Element.match(event.target,"span")) {
this.clickOnScroll = true;
}
- this.comboList.isList = true;
- } else if (Prototype.Browser.Gecko) {
- if (this.comboList.getEventItem(e)) {
- this.comboList.isList = true;
- }
- } else {
- this.comboList.isList = true;
- }
+ }
+ this.comboList.isList = true;
},
listMouseUpHandler : function(e) {
@@ -321,7 +314,6 @@
if (this.directInputSuggestions) {
var startInd = this.field.value.length;
var endInd = value.length;
- //this.field.prevValue = this.field.value;
this.field.value = value;
Richfaces.ComboBox.textboxSelect(this.field, startInd, endInd);
}
@@ -346,13 +338,16 @@
}
var iconStyles = this.classes.buttonicon.style;
- this.button.style.backgroundImage = iconStyles.active;
-
+ if (!iconStyles.active.blank()) {
+ Element.setStyle(this.button, {backgroundImage:iconStyles.active});
+ }
+
this.field.className = this.classes.field.classes.active;
- Element.setStyle(this.field, this.classes.field.style.active);
+ Element.setStyle(this.field, this.classes.field.style.active);
+
this.isDisabled = false;
},
-
+
disable : function() {
this.button.className = this.classes.button.classes.disabled;
this.buttonBG.className = this.classes.buttonbg.classes.disabled;
@@ -360,12 +355,13 @@
Element.setStyle(this.field, this.classes.field.style.disabled);
var iconStyles = this.classes.buttonicon.style;
- this.button.style.backgroundImage = iconStyles.disabled;
-
+ if(!iconStyles.disabled.blank()) {
+ Element.setStyle(this.button,{backgroundImage : iconStyles.disabled});
+ }
+
this.button.disabled = true;
this.field.disabled = true;
-
this.isDisabled = true;
},
@@ -373,11 +369,14 @@
this.button.className = this.classes.button.classes.normal;
this.buttonBG.className = this.classes.buttonbg.classes.normal;
this.field.className = this.classes.field.classes.normal;
- Element.setStyle(this.field, this.classes.field.style.normal);
-
+ var fieldStyles = this.classes.field.style.normal;
+ Element.setStyle(this.field, fieldStyles);
+
var iconStyles = this.classes.buttonicon.style;
- this.button.style.backgroundImage = iconStyles.normal;
-
+ if(!iconStyles.normal.blank()) {
+ Element.setStyle(this.button,{backgroundImage : iconStyles.normal});
+ }
+
this.button.disabled = false;
this.field.disabled = false;
this.isDisabled = false;
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js 2008-10-03 09:37:32 UTC (rev 10656)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js 2008-10-03 11:07:11 UTC (rev 10657)
@@ -22,7 +22,7 @@
RichComboUtils.Condition = {
ElementPresent : function(element) {
return function () {
- var el = $(element);
+ var el = document.getElementById(element);
return el && el.offsetHeight > 0;
};
}
@@ -86,10 +86,8 @@
Richfaces.getStyles = function(el, sides, styles) {
var val = 0;
for(var i = 0, len = sides.length; i < len; i++){
- //if (el.getStyle) {
var w = parseInt(Element.getStyle(el, styles[sides.charAt(i)]), 10);
if(!isNaN(w)) val += w;
- //}
}
return val;
}
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxstyles.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxstyles.js 2008-10-03 09:37:32 UTC (rev 10656)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxstyles.js 2008-10-03 11:07:11 UTC (rev 10657)
@@ -11,7 +11,7 @@
style : {
normal: "",
active: "",
- disabled: ""}
+ disabled: ""}
},
buttonbg : {
@@ -45,7 +45,7 @@
classes :{
active : "rich-combobox-list-cord rich-combobox-list-scroll rich-combobox-list-decoration rich-combobox-list-position"},
style : {active: ""
- }
+ }
},
item : {normal : "rich-combobox-item",
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js 2008-10-03 09:37:32 UTC (rev 10656)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js 2008-10-03 11:07:11 UTC (rev 10657)
@@ -5,14 +5,13 @@
initialize: function(listId, parentListId, selectFirstOnUpdate, filterNewValues, classes, width, height, itemsText, onlistcall, fieldId, shadowId,decorationId,
showDelay, hideDelay) {
- this.list = $(listId);
+ this.list = document.getElementById(listId);
this.listParent = $(parentListId);
this.listParentContainer = this.listParent.parentNode;
- //this.iframe = $(iframeId);
this.iframe = null;
- this.fieldElem = $(fieldId);
+ this.fieldElem = document.getElementById(fieldId);
this.itemsText = itemsText;
- this.shadowElem = $(shadowId);
+ this.shadowElem = document.getElementById(shadowId);
this.onlistcall = onlistcall;
if (this.onlistcall) {
@@ -40,7 +39,7 @@
initDimensions : function() {
this.listParent.style.visibility = "hidden";
- this.listParent.show();
+ this.listParent.style.display = "";
var el = this.listParent.childNodes[1].firstChild;
this.LAYOUT_BORDER_V = Richfaces.getBorderWidth(el, "tb");
@@ -48,7 +47,7 @@
this.LAYOUT_PADDING_V = Richfaces.getPaddingWidth(el, "tb");
this.LAYOUT_PADDING_H = Richfaces.getPaddingWidth(el, "lr");
- this.listParent.hide();
+ this.listParent.style.display = "none";
this.listParent.style.visibility = "visible";
},
@@ -77,13 +76,12 @@
this.fieldDimensions.left = pos[0];
this.fieldDimensions.top = pos[1];
-// Richfaces.ComboBoxList.getElemXY(this.fieldElem);
this.fieldDimensions.height = this.fieldElem.parentNode.offsetHeight;
this.listParent.style.visibility = "hidden";
- this.listParent.show();
+ this.listParent.style.display = "";
this.setSize();
- this.listParent.hide();
+ this.listParent.style.display = "none";
this.listParent.style.visibility = "visible";
//attach list to the document body
@@ -100,9 +98,9 @@
var items = this.getItems();
if (items.length != 0) {
if (this.iframe) {
- this.iframe.show();
+ this.iframe.style.display="";
}
- this.listParent.show();
+ this.listParent.style.display = "";
if (this.selectFirstOnUpdate) {
if (this.selectedItem) {
this.doActiveItem(this.selectedItem);
@@ -148,14 +146,14 @@
this.outjectListFromBody(this.listParentContainer, this.listParent);
this.resetState();
if (this.iframe) {
- this.iframe.hide();
+ this.iframe.style.display= "none";
}
var component = this.listParent.parentNode;
component.style.position = "static";
component.style.zIndex = 0;
- this.listParent.hide();
+ this.listParent.style.display = "none";
},
visible : function() {
@@ -209,7 +207,6 @@
setWidth : function(width) {
var positionElem = this.listParent.childNodes[1];
var combobox = this.listParent.parentNode;
- //positionElem.style.width = width;
var correction = parseInt(width) - Richfaces.getBorderWidth(positionElem.firstChild, "lr") - Richfaces.getPaddingWidth(positionElem.firstChild, "lr") + "px";
this.list.style.width = correction;
combobox.style.width = correction;
@@ -220,7 +217,6 @@
setPosition : function(fieldTop, fieldLeft, fieldHeight) {
var component = this.listParent.parentNode;
- //component.style.position = "relative";
component.style.zIndex = 2;
var docHeight = Richfaces.getDocumentHeight();
@@ -231,18 +227,11 @@
var showPoint = fieldHeight;
if (parseInt(listHeight) > (docHeight - comBottom)) {
if (topPosition > (docHeight - comBottom)) {
- //topPosition = fieldTop - parseInt(listHeight);
showPoint = -parseInt(listHeight);
}
}
- /*this.listParent.style.left = fieldLeft + "px";
- this.listParent.style.top = topPosition + "px";
-
- if (this.iframe) {
- this.iframe.style.top = topPosition + "px";
- this.iframe.style.left = fieldLeft + "px";
- }*/
+
this.clonePosition(this.listParent, this.fieldElem, showPoint);
if (this.iframe) {
this.clonePosition(this.iframe, this.fieldElem, showPoint);
@@ -301,14 +290,6 @@
item.className = className;
},
- getEventItem : function(event) {
- var item = Event.findElement(event, "span");
- /*if ((item == null) || (item.id == this.listParent.id) || (item.id == this.list.id)) {
- return;
- }*/
- return item;
- },
-
moveActiveItem : function(event) {
var item = this.activeItem;
if (event.keyCode == Event.KEY_UP) {
@@ -396,6 +377,7 @@
}
this.list.innerHTML = items.join("");
//was created new item list, so necessary to recreate selectedItem
+
if (this.selectedItem) {
var item = this.findItemBySubstr(text);
if (item) {
@@ -418,16 +400,15 @@
iframe.style.position = "absolute";
iframe.frameBorder="0";
iframe.scrolling="no";
-// iframe.style.backgroundColor="#FFFFFF";
iframe.style.width = width;
-// iframe.style.zIndex = "2";
+
iframe.className = classes;
-// parentElem.appendChild(iframe);
+
parentElem.insertBefore(iframe,parentElem.firstChild);
- this.iframe = $(iframe.id);
+ this.iframe = document.getElementById(iframe.id);
},
PX_REGEX: /px$/,
@@ -486,28 +467,14 @@
Richfaces.ComboBoxList.getElemXY = function(elem) {
- // for FF support
- /*var originalVisibility = elem.style.visibility;
- var originalPosition = elem.style.position;
- var originalDisplay = elem.style.display;
-
- elem.style.visibility = 'hidden';
- elem.style.position = 'absolute';
- elem.style.display = 'block';*/
-
var x = elem.offsetLeft;
var y = elem.offsetTop;
- //for (var parent = Element.getOffsetParent(elem); parent != document.body; parent = Element.getOffsetParent(parent)) {
for (var parent = elem.offsetParent; parent; parent = parent.offsetParent) {
x += parent.offsetLeft;
y += parent.offsetTop;
}
-
- /*elem.style.display = originalDisplay;
- elem.style.visibility = originalVisibility;
- elem.style.position = originalPosition;*/
-
+
return {left: x, top: y};
}
16 years, 3 months
JBoss Rich Faces SVN: r10656 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-10-03 05:37:32 -0400 (Fri, 03 Oct 2008)
New Revision: 10656
Modified:
trunk/docs/userguide/en/src/main/docbook/included/simpleTogglePanel.xml
Log:
RF-4501 - information is added
Modified: trunk/docs/userguide/en/src/main/docbook/included/simpleTogglePanel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/simpleTogglePanel.xml 2008-10-03 09:05:15 UTC (rev 10655)
+++ trunk/docs/userguide/en/src/main/docbook/included/simpleTogglePanel.xml 2008-10-03 09:37:32 UTC (rev 10656)
@@ -97,12 +97,12 @@
><property><rich:simpleTogglePanel></property></emphasis>component also has an <emphasis>
<property>"opened"</property>
</emphasis> attribute responsible for keeping a panel state. It gives an
- opportunity to manage state of the component from a model.
+ opportunity to manage state of the component from a model.
If the value of this attribute is"true" the component is expanded.
</para>
-
+
<!--SIMPLE EXAMPLE NEEDED -->
-
+
<itemizedlist>
<listitem><para> <emphasis><property>"onmouseover "</property></emphasis></para></listitem>
<listitem><para> <emphasis><property>"onclick "</property></emphasis></para></listitem>
@@ -118,9 +118,26 @@
</mediaobject>
</figure>
<para>
+ <para>
+ With help of
+ <emphasis>
+ <property>
+ "openMarker"
+ </property>
+ </emphasis>
+ and
+ <emphasis>
+ <property>
+ "closeMarker"
+ </property>
+ </emphasis> facets you can set toggle icon for
+ <property>
+ simpleTogglePanel
+ </property>.
+ </para>
Information about the <emphasis><property>"process"</property></emphasis> attribute usage you can find <link linkend="process">here</link>.
</para>
-
+
</section>
<section>
<title>Look-and-Feel Customization</title>
@@ -129,16 +146,16 @@
</emphasis> Default style classes are mapped on <emphasis>
<property>skin parameters.</property>
</emphasis></para>
-
+
<para>There are two ways to redefine the appearance of all <emphasis role="bold">
<property><rich:simpleTooglePanel></property>
</emphasis> components at once:</para>
-
+
<itemizedlist>
<listitem>
<para>Redefine the corresponding skin parameters</para>
</listitem>
-
+
<listitem>
<para>Add to your style sheets <emphasis>
<property>style classes</property>
@@ -148,7 +165,7 @@
</listitem>
</itemizedlist>
</section>
-
+
<section>
<title>Skin Parameters Redefinition</title>
<table>
@@ -241,9 +258,9 @@
</section>
<section>
<title>Definition of Custom Style Classes</title>
-
+
<para>On the screenshot there are classes names that define styles for component elements.</para>
-
+
<figure>
<title>Style classes</title>
<mediaobject>
@@ -275,7 +292,7 @@
<entry>rich-stglpnl-marker</entry>
<entry>Defines styles for a wrapper <div> element of a marker</entry>
</row>
-
+
<row>
<entry>rich-stglpanel-body</entry>
<entry>Defines styles for a component content</entry>
@@ -283,8 +300,8 @@
</tbody>
</tgroup>
</table>
-
-
+
+
<table>
<title>Style component classes</title>
<tgroup cols="2">
@@ -313,12 +330,12 @@
</tbody>
</tgroup>
</table>
-
+
<para>In order to redefine styles for all <emphasis role="bold">
<property><rich:simpleTogglePanel></property>
</emphasis> components on a page using CSS, it's enough to create classes with the
same names (possible classes could be found in the tables <link linkend="simpTogPanC"> above</link>) and define necessary properties in them. </para>
-
+
<para>
<emphasis role="bold">Example:</emphasis>
</para>
@@ -326,10 +343,10 @@
.rich-stglpanel-header{
font-style:italic;
}
-...]]></programlisting>
-
+...]]></programlisting>
+
<para>This is a result:</para>
-
+
<figure>
<title>Redefinition styles with predefined classes</title>
<mediaobject>
@@ -338,13 +355,13 @@
</imageobject>
</mediaobject>
</figure>
-
+
<para>In the example the font style for header was changed.</para>
-
+
<para>Also it's possible to change styles of particular <emphasis role="bold"
><property><rich:simpleTogglePanel></property></emphasis> component. In this case you should create own style classes and use them in corresponding <emphasis role="bold"
><property><rich:simpleTogglePanel></property></emphasis> <emphasis><property>styleClass</property></emphasis> attributes. An example is placed below:</para>
-
+
<para>
<emphasis role="bold">Example:</emphasis>
</para>
@@ -352,18 +369,18 @@
.myClass{
background-color:#ffead9;
}
-...]]></programlisting>
+...]]></programlisting>
<para>The <emphasis><property>"bodyClass"</property></emphasis> attribute for <emphasis role="bold"
><property><rich:simpleTogglePanel></property></emphasis> is defined as it's shown in the example below:</para>
-
+
<para>
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[<rich:simpleTogglePanel ... bodyClass="myClass"/>
-]]></programlisting>
-
+]]></programlisting>
+
<para>This is a result:</para>
-
+
<figure>
<title>Redefinition styles with own classes and <emphasis><property>styleClass</property></emphasis> attributes</title>
<mediaobject>
@@ -371,12 +388,12 @@
<imagedata fileref="images/simpleTogglePanel_oc.png"/>
</imageobject>
</mediaobject>
- </figure>
-
+ </figure>
+
<para>As it could be seen on the picture above,background color for body was changed.</para>
-
-
-
+
+
+
</section>
<section>
<title>Relevant Resources Links</title>
16 years, 3 months
JBoss Rich Faces SVN: r10655 - in trunk/test-applications/jsp/src/main/webapp: DropDownMenu and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: tromanovich
Date: 2008-10-03 05:05:15 -0400 (Fri, 03 Oct 2008)
New Revision: 10655
Modified:
trunk/test-applications/jsp/src/main/webapp/Columns/Columns.jsp
trunk/test-applications/jsp/src/main/webapp/DropDownMenu/DropDownMenuProperty.jsp
trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp
trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInputProperty.jsp
trunk/test-applications/jsp/src/main/webapp/InplaceSelect/InplaceSelectProperty.jsp
trunk/test-applications/jsp/src/main/webapp/SortingAndFiltering/SortingAndFiltering.jsp
trunk/test-applications/jsp/src/main/webapp/Tree/Tree.jsp
trunk/test-applications/jsp/src/main/webapp/Tree/TreeProperty.jsp
trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Tree.xml
Log:
Modified: trunk/test-applications/jsp/src/main/webapp/Columns/Columns.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Columns/Columns.jsp 2008-10-03 09:00:29 UTC (rev 10654)
+++ trunk/test-applications/jsp/src/main/webapp/Columns/Columns.jsp 2008-10-03 09:05:15 UTC (rev 10655)
@@ -100,7 +100,7 @@
</rich:dataTable>
<rich:spacer height="20" width="150"></rich:spacer>
- <rich:dataTable value="#{columns.data1}" var="cust">
+ <rich:dataTable id="latsTable" value="#{columns.data1}" var="cust" >
<f:facet name="header">
<rich:columnGroup>
<rich:column>
@@ -115,5 +115,7 @@
</f:facet>
</rich:column>
</rich:dataTable>
+<a4j:commandButton value="reRender"
+ reRender="lastTable"></a4j:commandButton>
</f:subview>
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/DropDownMenu/DropDownMenuProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/DropDownMenu/DropDownMenuProperty.jsp 2008-10-03 09:00:29 UTC (rev 10654)
+++ trunk/test-applications/jsp/src/main/webapp/DropDownMenu/DropDownMenuProperty.jsp 2008-10-03 09:05:15 UTC (rev 10655)
@@ -51,10 +51,12 @@
<h:outputText value="GroupDirection:" />
<h:selectOneRadio value="#{dDMenu.groupDirection}">
- <f:selectItem itemLabel="top-up" itemValue="top-up" />
- <f:selectItem itemLabel="top-down" itemValue="top-down" />
- <f:selectItem itemLabel="bottom-up" itemValue="bottom-up" />
- <f:selectItem itemLabel="bottom-down" itemValue="bottom-down" />
+ <f:selectItem itemLabel="right" itemValue="right" />
+ <f:selectItem itemLabel="left" itemValue="left" />
+ <f:selectItem itemLabel="left-down" itemValue="left-down" />
+ <f:selectItem itemLabel="left-up" itemValue="left-up" />
+ <f:selectItem itemLabel="right-down" itemValue="right-down" />
+ <f:selectItem itemLabel="right-up" itemValue="right-up" />
<f:selectItem itemLabel="auto" itemValue="auto" />
<a4j:support event="onclick" reRender="ddmId" />
</h:selectOneRadio>
Modified: trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp 2008-10-03 09:00:29 UTC (rev 10654)
+++ trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp 2008-10-03 09:05:15 UTC (rev 10655)
@@ -2,7 +2,7 @@
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
-<<script type="text/javascript">
+<script type="text/javascript">
<!--
function onClick() {
Modified: trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInputProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInputProperty.jsp 2008-10-03 09:00:29 UTC (rev 10654)
+++ trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInputProperty.jsp 2008-10-03 09:05:15 UTC (rev 10655)
@@ -107,7 +107,7 @@
value="cancel"></a4j:commandLink>
<br />
<a4j:commandLink
- onclick="$('formID:inplaceInputSubviewID:inplaceInputId').component.getValue()"
+ onclick="alert($('formID:inplaceInputSubviewID:inplaceInputId').component.getValue())"
value="getValue"></a4j:commandLink>
<br />
<a4j:commandLink
Modified: trunk/test-applications/jsp/src/main/webapp/InplaceSelect/InplaceSelectProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/InplaceSelect/InplaceSelectProperty.jsp 2008-10-03 09:00:29 UTC (rev 10654)
+++ trunk/test-applications/jsp/src/main/webapp/InplaceSelect/InplaceSelectProperty.jsp 2008-10-03 09:05:15 UTC (rev 10655)
@@ -102,11 +102,11 @@
value="cancel"></a4j:commandLink>
<br />
<a4j:commandLink
- onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.getValue()"
+ onclick="alert ($('formID:inplaceSelectSubviewID:inplaceSelectID').component.getValue())"
value="getValue"></a4j:commandLink>
<br />
<a4j:commandLink
- onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.setValue('setValue')"
+ onclick="$('formID:inplaceSelectSubviewID:inplaceSelectID').component.setValue('passeds','passeds')"
value="setValue"></a4j:commandLink>
<br />
@@ -122,7 +122,7 @@
<br />
<a href="#" id="getValueID">getValue()</a>
<br />
- <a href="#" id="setValueID">setValue('newValue')</a>
+ <a href="#" id="setValueID">setValue('passeds','passeds')</a>
</f:verbatim>
<rich:componentControl attachTo="editID" event="onclick"
@@ -132,9 +132,13 @@
<rich:componentControl attachTo="cancelID" event="onclick"
for="inplaceSelectID" operation="cancel"></rich:componentControl>
<rich:componentControl attachTo="getValueID" event="onclick"
- for="inplaceSelectID" operation="getValue"></rich:componentControl>
+ for="inplaceSelectID" operation="getValue" name="alert">
+ </rich:componentControl>
<rich:componentControl attachTo="setValueID" event="onclick"
- for="inplaceSelectID" operation="setValue('newValue')"></rich:componentControl>
+ for="inplaceSelectID" operation="setValue">
+ <f:param name="value" value="passeds"/>
+ <f:param name="label" value="passeds"/>
+ </rich:componentControl>
<br />
<br />
<div style="FONT-WEIGHT: bold;">rich:findComponent</div>
Modified: trunk/test-applications/jsp/src/main/webapp/SortingAndFiltering/SortingAndFiltering.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/SortingAndFiltering/SortingAndFiltering.jsp 2008-10-03 09:00:29 UTC (rev 10654)
+++ trunk/test-applications/jsp/src/main/webapp/SortingAndFiltering/SortingAndFiltering.jsp 2008-10-03 09:05:15 UTC (rev 10655)
@@ -80,6 +80,7 @@
<rich:column sortBy="#{data.int0}"
selfSorted="#{sortingAndFiltering.selfSorted}"
sortOrder="#{sortingAndFiltering.sortOrder}" filterBy="#{data.int0}">
+
<f:facet name="header">
<h:outputText value="#1" />
</f:facet>
Modified: trunk/test-applications/jsp/src/main/webapp/Tree/Tree.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Tree/Tree.jsp 2008-10-03 09:00:29 UTC (rev 10654)
+++ trunk/test-applications/jsp/src/main/webapp/Tree/Tree.jsp 2008-10-03 09:05:15 UTC (rev 10655)
@@ -36,20 +36,20 @@
<h:messages />
</a4j:outputPanel>
- <rich:tree id="tree" switchType="#{bean.switchType}"
- value="#{bean.data}" var="data" selectedClass="#{style.selectedClass}"
+ <rich:tree id="tree" switchType="#{treeBean.switchType}"
+ value="#{treeBean.data}" var="dataTree" selectedClass="#{style.selectedClass}"
styleClass="#{style.styleClass}" style="#{style.style}"
highlightedClass="#{style.highlightedClass}"
- nodeFace="#{data.name != 'param-value' ? 'input' : 'text'}"
- changeExpandListener="#{bean.onExpand}"
- nodeSelectListener="#{bean.onSelect}" binding="#{bean.tree}"
+ nodeFace="#{dataTree.name != 'param-value' ? 'input' : 'text'}"
+ changeExpandListener="#{treeBean.onExpand}"
+ nodeSelectListener="#{treeBean.onSelect}" binding="#{treeBean.tree}"
onselected="window.status='selectedNode: '+event.selectedNode;"
onexpand="window.status='expandedNode: '+event.expandedNode"
oncollapse="window.status='collapsedNode: '+ event.collapsedNode"
ajaxSubmitSelection="true" reRender="outputText, selectOneListbox"
preserveModel="none" dragIndicator="treeIndicator" immediate="false"
- acceptedTypes="file1" dragType="#{bean.dragOn ? 'file1' : ''}"
- icon="#{bean.icon}" dropListener="#{bean.processDrop}"
+ acceptedTypes="file1" dragType="#{treeBean.dragOn ? 'file1' : ''}"
+ icon="#{treeBean.icon}" dropListener="#{treeBean.processDrop}"
onclick="#{event.onclick}" ondblclick="#{event.ondblclick}"
ondragend="#{event.ondragend}" ondragenter="#{event.ondragenter}"
ondragexit="#{event.ondragexit}" ondragstart="#{event.ondragstart}"
@@ -60,26 +60,26 @@
onmouseover="#{event.onmouseover}" onmouseup="#{event.onmouseup}"
onbeforedomupdate="#{event.onbeforedomupdate}"
oncomplete="#{event.oncomplete}" ondropout="#{event.ondropout}"
- ondropover="#{event.ondropover}" adviseNodeOpened="#{bean.adviseNodeOpened}"
- adviseNodeSelected="#{bean.adviseNodeSelected}">
+ ondropover="#{event.ondropover}" adviseNodeOpened="#{treeBean.adviseNodeOpened}"
+ adviseNodeSelected="#{treeBean.adviseNodeSelected}">
<!--
<f:facet name="icon">
- <h:outputText value="icon" rendered="#{bean.renderFacets}" />
+ <h:outputText value="icon" rendered="#{treeBean.renderFacets}" />
</f:facet>
<f:facet name="iconLeaf">
- <h:outputText value="leaf" rendered="#{bean.renderFacets}" />
+ <h:outputText value="leaf" rendered="#{treeBean.renderFacets}" />
</f:facet>
<f:facet name="iconExpanded">
- <h:outputText value="expanded" rendered="#{bean.renderFacets}" />
+ <h:outputText value="expanded" rendered="#{treeBean.renderFacets}" />
</f:facet>
<f:facet name="iconCollapsed">
- <h:outputText value="collapsed" rendered="#{bean.renderFacets}" />
+ <h:outputText value="collapsed" rendered="#{treeBean.renderFacets}" />
</f:facet>
-->
<rich:dndParam name="treeParam" value="Tree Parameter" />
<rich:dndParam name="accept" value="accept" />
- <rich:treeNode type="input" dropListener="#{bean.processDrop}"
+ <rich:treeNode type="input" dropListener="#{treeBean.processDrop}"
oncollapse="Element.removeClassName(event['treeItem'].getElement(), 'colored')"
onexpand="Element.addClassName(event['treeItem'].getElement(), 'colored')"
onbeforedomupdate="#{event.onbeforedomupdate}"
@@ -94,8 +94,8 @@
onmousedown="#{event.onmousedown}" onmousemove="#{event.onmousemove}"
onmouseout="#{event.onmouseout}" onmouseover="#{event.onmouseover}"
onmouseup="#{event.onmouseup}" onselected="#{event.onselected}">
- <h:outputText value="#{data} : " />
- <h:inputText value="#{data.name}" required="true" styleClass="inputs">
+ <h:outputText value="#{dataTree} : " />
+ <h:inputText value="#{dataTree.name}" required="true" styleClass="inputs">
</h:inputText>
<rich:dndParam name="nodeParam" value="Node Parameter" />
@@ -103,7 +103,7 @@
</rich:treeNode>
<rich:treeNode type="text" nodeClass="customNode"
acceptedTypes="file2" onselected="return false;">
- <h:outputText value="#{data}" />
+ <h:outputText value="#{dataTree}" />
</rich:treeNode>
</rich:tree>
@@ -112,30 +112,30 @@
</f:verbatim>
<h:outputText value="Enter path to expand:" />
- <h:inputText value="#{bean.pathToExpand}">
+ <h:inputText value="#{treeBean.pathToExpand}">
<a4j:support event="onchange" reRender="tree"
- action="#{bean.expandNode}" />
+ action="#{treeBean.expandNode}" />
</h:inputText>
<rich:separator></rich:separator>
<h:panelGrid columns="2">
<h:outputText value="Change tree switchType:" />
- <h:selectOneRadio value="#{bean.switchType}" onclick="submit()">
+ <h:selectOneRadio value="#{treeBean.switchType}" onclick="submit()">
<f:selectItem itemLabel="client" itemValue="client" />
<f:selectItem itemLabel="server" itemValue="server" />
<f:selectItem itemLabel="ajax" itemValue="ajax" />
</h:selectOneRadio>
<h:outputText value="Drag switch:" />
- <h:selectBooleanCheckbox value="#{bean.dragOn}" onchange="submit();"></h:selectBooleanCheckbox>
+ <h:selectBooleanCheckbox value="#{treeBean.dragOn}" onchange="submit();"></h:selectBooleanCheckbox>
<h:outputText value="Render facets:" />
- <h:selectBooleanCheckbox value="#{bean.renderFacets}"
+ <h:selectBooleanCheckbox value="#{treeBean.renderFacets}"
onchange="submit();"></h:selectBooleanCheckbox>
- <h:commandButton value="#{bean.commandButtonCaption}"
- actionListener="#{bean.changeIcons}" />
+ <h:commandButton value="#{treeBean.commandButtonCaption}"
+ actionListener="#{treeBean.changeIcons}" />
</h:panelGrid>
<f:verbatim>
@@ -144,8 +144,8 @@
</f:verbatim>
<rich:tree id="testTree" var="_data" switchType="ajax"
- ajaxSubmitSelection="true" preserveModel="none" value="#{bean.data1}"
- nodeSelectListener="#{bean.onSelectInc}" nodeFace="node">
+ ajaxSubmitSelection="true" preserveModel="none" value="#{treeBean.data1}"
+ nodeSelectListener="#{treeBean.onSelectInc}" nodeFace="node">
<rich:treeNode type="node">
<h:outputText value="#{_data}" />
</rich:treeNode>
Modified: trunk/test-applications/jsp/src/main/webapp/Tree/TreeProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Tree/TreeProperty.jsp 2008-10-03 09:00:29 UTC (rev 10654)
+++ trunk/test-applications/jsp/src/main/webapp/Tree/TreeProperty.jsp 2008-10-03 09:05:15 UTC (rev 10655)
@@ -6,7 +6,7 @@
<f:subview id="treePropertySubviewID">
<br />
<br />
- <h:commandButton value="add test" action="#{bean.addHtmlTree}"></h:commandButton>
+ <h:commandButton value="add test" action="#{treeBean.addHtmlTree}"></h:commandButton>
<div style="FONT-WEIGHT: bold;">rich:findComponent</div>
<h:panelGrid columns="2">
<rich:column>
@@ -15,5 +15,10 @@
<rich:column id="findID">
<h:outputText value="#{rich:findComponent('tree').adviseNodeSelected}" />
</rich:column>
+ <rich:column>
+ <a4j:commandLink
+ onclick="$('formID:treeSubviewID:tree').component.isRowAvailable()"
+ value="isRowAvailable"></a4j:commandLink>
+ </rich:column>
</h:panelGrid>
</f:subview>
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Tree.xml
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Tree.xml 2008-10-03 09:00:29 UTC (rev 10654)
+++ trunk/test-applications/jsp/src/main/webapp/WEB-INF/faces-config-Tree.xml 2008-10-03 09:05:15 UTC (rev 10655)
@@ -3,7 +3,7 @@
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<managed-bean>
- <managed-bean-name>bean</managed-bean-name>
+ <managed-bean-name>treeBean</managed-bean-name>
<managed-bean-class>tree.Bean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
16 years, 3 months