JBoss Rich Faces SVN: r7840 - branches/3.2.x/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-04-15 10:39:29 -0400 (Tue, 15 Apr 2008)
New Revision: 7840
Modified:
branches/3.2.x/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
Log:
http://jira.jboss.com/jira/browse/RF-3059
Modified: branches/3.2.x/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
===================================================================
--- branches/3.2.x/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-04-15 13:54:18 UTC (rev 7839)
+++ branches/3.2.x/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-04-15 14:39:29 UTC (rev 7840)
@@ -178,7 +178,7 @@
save : function($super) {
this.applyTmpValue();
if (!this.comboList.isList || this.clickOnBar) {
- var unescapeText = this.tempValueKeeper.value.unescapeHTML();
+ var unescapeText = this.tempValueKeeper.value;
this.saveValue(this.currentItemValue, unescapeText);
}
16 years, 9 months
JBoss Rich Faces SVN: r7839 - trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-04-15 09:54:18 -0400 (Tue, 15 Apr 2008)
New Revision: 7839
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.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-15 13:45:04 UTC (rev 7838)
+++ trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java 2008-04-15 13:54:18 UTC (rev 7839)
@@ -130,11 +130,15 @@
* Checks if page containing component test has been rendered completely
*/
public void checkPageRendering() {
- String t1 = getTextById("_Selenium_Test_ControlPoint1");
- String t2 = getTextById("_Selenium_Test_ControlPoint2");
- if (t1 == null || t2 == null || !"Control1".equals(t1) || !"Control2".equals(t2)) {
- Assert.fail("The page has been not rendered properlly");
- }
+ try {
+ String t1 = getTextById("_Selenium_Test_ControlPoint1");
+ String t2 = getTextById("_Selenium_Test_ControlPoint2");
+ if (t1 == null || t2 == null || !"Control1".equals(t1) || !"Control2".equals(t2)) {
+ Assert.fail("The page has been not rendered properlly");
+ }
+ }catch (Exception e) {
+ Assert.fail("The page has been not rendered properlly by the following error: " + e);
+ }
}
/**
16 years, 9 months
JBoss Rich Faces SVN: r7838 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-04-15 09:45:04 -0400 (Tue, 15 Apr 2008)
New Revision: 7838
Modified:
trunk/docs/userguide/en/src/main/docbook/included/inplaceInput.xml
Log:
http://jira.jboss.com/jira/browse/RF-1226
InplaceInput article corrected.
Modified: trunk/docs/userguide/en/src/main/docbook/included/inplaceInput.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/inplaceInput.xml 2008-04-15 13:43:21 UTC (rev 7837)
+++ trunk/docs/userguide/en/src/main/docbook/included/inplaceInput.xml 2008-04-15 13:45:04 UTC (rev 7838)
@@ -214,10 +214,10 @@
a confirmation window with a message "Are you sure you want to change value?" comes up.
</para>
- <para>
- The <emphasis><property>"selectOnEdit"</property></emphasis> (with possible values "true", "false") gives you an
- option to make the text (displayed by <emphasis><property>"value"</property></emphasis> attribute) in the input field selected right after the change from <property>view</property>/<property>changed</property> state to <property>edit</property> occurs.
-
+ <para>
+ Using the boolean <emphasis><property>"selectOnEdit"</property></emphasis> attribute set to true,
+ the text in the input field will be selected when
+ the change from <property>view</property>/<property>changed</property> state to <property>edit</property> occurs.
</para>
<para>This is the result:</para>
@@ -234,8 +234,8 @@
<para>
- If the <emphasis role="bold"><property><rich:inplaceInput></property></emphasis> loses focus input data is saved automatically
- and the component displays new value. Additionally, the data is saved when "Enter" is pressed.
+ If the <emphasis role="bold"><property><rich:inplaceInput></property></emphasis> loses focus, input data is saved automatically
+ and the component displays a new value. Additionally, the data is saved when "Enter" is pressed.
Nevertheless, you can use the <emphasis><property>"showControls"</property></emphasis>
attribute, which makes "Save" and "Cancel" buttons appear next to the input field.
If the controls are used, data is not saved automatically when the form loses focus: user has to confirm that he/she wants to save/discard the data explicitly.
16 years, 9 months
JBoss Rich Faces SVN: r7837 - trunk/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-04-15 09:43:21 -0400 (Tue, 15 Apr 2008)
New Revision: 7837
Added:
trunk/docs/userguide/en/src/main/resources/images/inplaceInputSelect.png
Log:
http://jira.jboss.com/jira/browse/RF-1226
InplaceInput article corrected.
Added: trunk/docs/userguide/en/src/main/resources/images/inplaceInputSelect.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/inplaceInputSelect.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 9 months
JBoss Rich Faces SVN: r7836 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-04-15 09:43:00 -0400 (Tue, 15 Apr 2008)
New Revision: 7836
Modified:
trunk/docs/userguide/en/src/main/docbook/included/inplaceInput.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/inplaceInput.xml
Log:
http://jira.jboss.com/jira/browse/RF-1226
InplaceInput article corrected.
Modified: trunk/docs/userguide/en/src/main/docbook/included/inplaceInput.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/inplaceInput.desc.xml 2008-04-15 11:11:39 UTC (rev 7835)
+++ trunk/docs/userguide/en/src/main/docbook/included/inplaceInput.desc.xml 2008-04-15 13:43:00 UTC (rev 7836)
@@ -36,13 +36,13 @@
<para>Optional "inline" or "block" element rendering on a page</para>
</listitem>
<listitem>
- <para>Edit mode activation when the component got focus with the "Tab"</para>
+ <para>Edit mode activation when the component gets focus with the "Tab"</para>
</listitem>
<listitem>
<para>Sizes synchronizations between modes</para>
</listitem>
<listitem>
- <para>Hight controls customization</para>
+ <para>Controls customization</para>
</listitem>
</itemizedlist>
</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/inplaceInput.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/inplaceInput.xml 2008-04-15 11:11:39 UTC (rev 7835)
+++ trunk/docs/userguide/en/src/main/docbook/included/inplaceInput.xml 2008-04-15 13:43:00 UTC (rev 7836)
@@ -66,7 +66,7 @@
<title>Details of Usage</title>
<para>
- As it was mentioned earlier the
+ The
<emphasis role="bold"><property><rich:inplaceInput></property></emphasis>
component was designed to facilitate displaying and inputting(editing) some data.
</para>
@@ -105,16 +105,17 @@
<programlisting role="XML"><![CDATA[...
<rich:inplaceInput value="#{bean.value}" defaultLabel="click to edit"/>
...]]> </programlisting>
- <para>
+
+<!-- <para>
The managed bean code:
- </para>
- <programlisting role="JAVA"><![CDATA[...
+ </para>-->
+<!-- <programlisting role="JAVA"><![CDATA[...
private String value = null;
-...]]> </programlisting>
+...]]> </programlisting>-->
<para>
- In the example above the <emphasis><property>"value"</property></emphasis> attribute is "null";
- therefore "click to edit" value is displayed since it is placed into the
- <emphasis><property>"defaultLabel"</property></emphasis> attribute.
+ In the example above the <emphasis><property>"value"</property></emphasis> attribute is not initialized
+ therefore "click to edit" text, that
+ <emphasis><property>"defaultLabel"</property></emphasis>, contains is displayed.
</para>
<para>
This is the result:
@@ -155,15 +156,15 @@
</itemizedlist>
<para>
- The <emphasis><property>"editEvent"</property></emphasis> attribute provides an option to assign an JavaScript action
- that initiates the change of the state from <property>view</property> to <property>edit</property>.
+ The <emphasis><property>"editEvent"</property></emphasis> attribute provides an option to assign a JavaScript action
+ to initiate the change of the state from <property>view</property>/<property>changed</property> to <property>edit</property>.
The default value is "onclick".
</para>
<para>
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
-<rich:inplaceInput value="#{bean.value}" editEvent="onmouseover"/>
+<rich:inplaceInput value="#{bean.value}" editEvent="ondblclick"/>
...]]> </programlisting>
<!--note>
@@ -215,15 +216,32 @@
<para>
The <emphasis><property>"selectOnEdit"</property></emphasis> (with possible values "true", "false") gives you an
- option to make the text in the input field selected right after the change from <property>view</property> state to <property>edit</property> occurs.
+ option to make the text (displayed by <emphasis><property>"value"</property></emphasis> attribute) in the input field selected right after the change from <property>view</property>/<property>changed</property> state to <property>edit</property> occurs.
+
</para>
+ <para>This is the result:</para>
+
+ <figure>
+ <title>Usage of the <emphasis><property>"selectOnEdit"</property></emphasis> attribute</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/inplaceInputSelect.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+
+
<para>
If the <emphasis role="bold"><property><rich:inplaceInput></property></emphasis> loses focus input data is saved automatically
- and the component displays new value.
+ and the component displays new value. Additionally, the data is saved when "Enter" is pressed.
Nevertheless, you can use the <emphasis><property>"showControls"</property></emphasis>
- attribute, which makes "Save" and "Cancel" buttons appear next to the input field.
- </para>
+ attribute, which makes "Save" and "Cancel" buttons appear next to the input field.
+ If the controls are used, data is not saved automatically when the form loses focus: user has to confirm that he/she wants to save/discard the data explicitly.
+ In both cases(with controls or without them) the input data can be discarded by pressing "Esc" key.
+
+ </para>
<para>
<emphasis role="bold">Example:</emphasis>
</para>
16 years, 9 months
JBoss Rich Faces SVN: r7835 - in trunk/test-applications/seleniumTest/src: test/java/org/ajax4jsf/test/base and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-04-15 07:11:39 -0400 (Tue, 15 Apr 2008)
New Revision: 7835
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommandButton/
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/RichSeleniumTest.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java
Removed:
trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommonButton/
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java
Log:
refactoring
Copied: trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommandButton (from rev 7831, trunk/test-applications/seleniumTest/src/main/webapp/pages/ajaxCommonButton)
Added: trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/RichSeleniumTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/RichSeleniumTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/RichSeleniumTest.java 2008-04-15 11:11:39 UTC (rev 7835)
@@ -0,0 +1,8 @@
+package org.ajax4jsf.test.base;
+
+public interface RichSeleniumTest {
+
+ public void startSelenium (String browser);
+
+ public void stopSelenium();
+}
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-15 10:28:49 UTC (rev 7834)
+++ trunk/test-applications/seleniumTest/src/test/java/org/ajax4jsf/test/base/SeleniumTestBase.java 2008-04-15 11:11:39 UTC (rev 7835)
@@ -1,9 +1,6 @@
package org.ajax4jsf.test.base;
import org.testng.Assert;
-import org.testng.annotations.AfterTest;
-import org.testng.annotations.BeforeTest;
-import org.testng.annotations.Parameters;
import com.thoughtworks.selenium.DefaultSelenium;
@@ -13,13 +10,16 @@
* @author Andrey Markavtsov
*
*/
-public class SeleniumTestBase {
+public abstract class SeleniumTestBase {
/** Specifies the time to wait for page rendering */
private static final Integer pageRenderTime = 5000;
+
+ /** Specifies the time to wait for ajax processing */
+ protected static final int ajaxCompletionTime = 3000;
/** The default selenium instance */
- protected DefaultSelenium selenium;
+ public DefaultSelenium selenium;
/** Host */
public String host;
@@ -37,10 +37,6 @@
public static final String COMPONENT_PREFIX_INSIDE_PANEL = "_Selenium_Test_Form2:";
- public SeleniumTestBase() {
- /* Default constructor */
- }
-
public SeleniumTestBase(String protocol, String host, String port) {
this.host = host;
this.port = port;
@@ -52,18 +48,16 @@
* @param browser
* @return
*/
- public DefaultSelenium createSeleniumClient(String url, String browser) {
+ private DefaultSelenium createSeleniumClient(String url, String browser) {
return new DefaultSelenium(host, 4444, browser, url);
}
/**
* This method are invoking before selenium tests started
*/
- @BeforeTest
- @Parameters( { "browser" })
- public void startSelenium(String browser) {
- selenium = createSeleniumClient(protocol + "://" + host + ":" + port + "/", browser);
- selenium.start();
+ protected void startSelenium(String browser) {
+ selenium = createSeleniumClient(protocol + "://" + host + ":" + port + "/", browser);
+ selenium.start();
}
/**
@@ -116,8 +110,7 @@
/**
* This method are invoking after selenium tests completed
*/
- @AfterTest
- public void stopSelenium() {
+ protected void stopSelenium() {
selenium.stop();
selenium = null;
}
@@ -153,6 +146,16 @@
public void waitForAjaxCompletion(int miliseconds) {
selenium.waitForCondition("selenium.browserbot.getCurrentWindow().done==true", String.valueOf(miliseconds));
}
+
+ /**
+ * Waits while AJAX request will be completed
+ *
+ * @param miliseconds -
+ * time to wait
+ */
+ public void waitForAjaxCompletion() {
+ selenium.waitForCondition("selenium.browserbot.getCurrentWindow().done==true", String.valueOf(ajaxCompletionTime));
+ }
/**
* Asserts DOM node value equals to value defined
Deleted: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java 2008-04-15 10:28:49 UTC (rev 7834)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java 2008-04-15 11:11:39 UTC (rev 7835)
@@ -1,70 +0,0 @@
-package org.richfaces;
-
-import org.ajax4jsf.test.base.SeleniumTestBase;
-import org.testng.annotations.Test;
-
-public class AjaxCommandButtonTest extends SeleniumTestBase {
-
- public AjaxCommandButtonTest() {
- super("http", "localhost", "8080");
- }
-
- @Test
- public void testAjaxCommandButtonComponent() throws Exception {
- renderPage("/faces/pages/ajaxCommandButton/ajaxButtonTest.xhtml");
-
- _testAjaxCommandButtonComponent(COMPONENT_PREFIX_INSIDE_TABLE);
- _testAjaxCommandButtonComponent(COMPONENT_PREFIX_INSIDE_PANEL);
- }
-
- private void _testAjaxCommandButtonComponent(String parentId) {
- // test inside DataTable
- String buttonId = parentId + "b1";
- String inputId = parentId + "_value";
-
- clickById(buttonId);
- waitForAjaxCompletion(3000);
- AssertValueEquals(inputId, "3");
-
- clickById(buttonId);
- waitForAjaxCompletion(1000);
- AssertValueEquals(inputId, "6");
-
- buttonId = parentId + "b2";
-
- clickById(buttonId);
- waitForAjaxCompletion(1000);
- AssertValueEquals(inputId, "6");
-
- buttonId = parentId + "b3";
-
- clickById(buttonId);
- waitForAjaxCompletion(1000);
- AssertValueEquals(inputId, "6");
-
- buttonId = parentId + "b4";
-
- clickById(buttonId);
- waitForAjaxCompletion(1000);
- AssertValueEquals(inputId, "1");
-
- buttonId = parentId + "b5";
-
- clickById(buttonId);
- waitForAjaxCompletion(1000);
- AssertValueEquals(inputId, "2");
-
- buttonId = parentId + "b1";
-
- clickById(buttonId);
- waitForAjaxCompletion(1000);
- AssertValueEquals(inputId, "5");
-
- buttonId = parentId + "b3";
-
- clickById(buttonId);
- waitForAjaxCompletion(1000);
- AssertValueEquals(inputId, "5");
- }
-
-}
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandButtonTest.java 2008-04-15 11:11:39 UTC (rev 7835)
@@ -0,0 +1,92 @@
+package org.richfaces;
+
+import org.ajax4jsf.test.base.RichSeleniumTest;
+import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+import org.testng.annotations.Test;
+
+
+public class AjaxCommandButtonTest extends SeleniumTestBase implements RichSeleniumTest {
+
+ public AjaxCommandButtonTest() {
+ 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 testAjaxCommandButtonComponent() throws Exception {
+ renderPage("/faces/pages/ajaxCommandButton/ajaxButtonTest.xhtml");
+
+ _testAjaxCommandButtonComponent(COMPONENT_PREFIX_INSIDE_TABLE);
+ _testAjaxCommandButtonComponent(COMPONENT_PREFIX_INSIDE_PANEL);
+ }
+
+ private void _testAjaxCommandButtonComponent(String parentId) {
+ // test inside DataTable
+ String buttonId = parentId + "b1";
+ String inputId = parentId + "_value";
+
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "3");
+
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "6");
+
+ buttonId = parentId + "b2";
+
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "6");
+
+ buttonId = parentId + "b3";
+
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "6");
+
+ buttonId = parentId + "b4";
+
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "1");
+
+ buttonId = parentId + "b5";
+
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "2");
+
+ buttonId = parentId + "b1";
+
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "5");
+
+ buttonId = parentId + "b3";
+
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ AssertValueEquals(inputId, "5");
+ }
+
+}
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java 2008-04-15 10:28:49 UTC (rev 7834)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/AjaxCommandLinkTest.java 2008-04-15 11:11:39 UTC (rev 7835)
@@ -1,69 +1,90 @@
package org.richfaces;
+import org.ajax4jsf.test.base.RichSeleniumTest;
import org.ajax4jsf.test.base.SeleniumTestBase;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-public class AjaxCommandLinkTest extends SeleniumTestBase {
+public class AjaxCommandLinkTest extends SeleniumTestBase implements RichSeleniumTest {
public AjaxCommandLinkTest() {
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 testAjaxCommandLinkComponent() throws Exception {
renderPage("/faces/pages/ajaxCommandLink/ajaxLinkTest.xhtml");
- _testAjaxCommandButtonComponent(COMPONENT_PREFIX_INSIDE_TABLE);
- _testAjaxCommandButtonComponent(COMPONENT_PREFIX_INSIDE_PANEL);
+ _testAjaxCommandLinkComponent(COMPONENT_PREFIX_INSIDE_TABLE);
+ _testAjaxCommandLinkComponent(COMPONENT_PREFIX_INSIDE_PANEL);
}
- private void _testAjaxCommandButtonComponent(String parentId) {
+ private void _testAjaxCommandLinkComponent(String parentId) {
// test inside DataTable
String LinkId = parentId + "l1";
String inputId = parentId + "_value";
clickById(LinkId);
- waitForAjaxCompletion(3000);
+ waitForAjaxCompletion();
AssertValueEquals(inputId, "3");
clickById(LinkId);
- waitForAjaxCompletion(1000);
+ waitForAjaxCompletion();
AssertValueEquals(inputId, "6");
LinkId = parentId + "l2";
clickById(LinkId);
- waitForAjaxCompletion(1000);
+ waitForAjaxCompletion();
AssertValueEquals(inputId, "6");
LinkId = parentId + "l3";
clickById(LinkId);
- waitForAjaxCompletion(1000);
+ waitForAjaxCompletion();
AssertValueEquals(inputId, "6");
LinkId = parentId + "l4";
clickById(LinkId);
- waitForAjaxCompletion(1000);
+ waitForAjaxCompletion();
AssertValueEquals(inputId, "1");
LinkId = parentId + "l5";
clickById(LinkId);
- waitForAjaxCompletion(1000);
+ waitForAjaxCompletion();
AssertValueEquals(inputId, "2");
LinkId = parentId + "l1";
clickById(LinkId);
- waitForAjaxCompletion(1000);
+ waitForAjaxCompletion();
AssertValueEquals(inputId, "5");
LinkId = parentId + "l3";
clickById(LinkId);
- waitForAjaxCompletion(1000);
+ waitForAjaxCompletion();
AssertValueEquals(inputId, "5");
}
16 years, 9 months
JBoss Rich Faces SVN: r7834 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-04-15 06:28:49 -0400 (Tue, 15 Apr 2008)
New Revision: 7834
Modified:
trunk/docs/userguide/en/src/main/docbook/included/progressBar.xml
Log:
http://jira.jboss.com/jira/browse/RF-1690
Code sample fixed
Modified: trunk/docs/userguide/en/src/main/docbook/included/progressBar.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/progressBar.xml 2008-04-15 10:04:40 UTC (rev 7833)
+++ trunk/docs/userguide/en/src/main/docbook/included/progressBar.xml 2008-04-15 10:28:49 UTC (rev 7834)
@@ -206,7 +206,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
-<rich:progressBar value="#{bean.incValue}" id="progrs" label="bean.incValue1"/>
+<rich:progressBar value="#{bean.incValue}" id="progrs" label="#{bean.incValue}"/>
...]]></programlisting>
</listitem>
16 years, 9 months
JBoss Rich Faces SVN: r7833 - in trunk/ui/componentControl/src/main: java/org/richfaces/renderkit and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vbaranov
Date: 2008-04-15 06:04:40 -0400 (Tue, 15 Apr 2008)
New Revision: 7833
Modified:
trunk/ui/componentControl/src/main/config/component/componentControl.xml
trunk/ui/componentControl/src/main/java/org/richfaces/renderkit/ComponentControlRendererBase.java
trunk/ui/componentControl/src/main/resources/org/richfaces/renderkit/html/script/controlUtils.js
trunk/ui/componentControl/src/main/templates/htmlComponentControl.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1531
Modified: trunk/ui/componentControl/src/main/config/component/componentControl.xml
===================================================================
--- trunk/ui/componentControl/src/main/config/component/componentControl.xml 2008-04-15 09:59:49 UTC (rev 7832)
+++ trunk/ui/componentControl/src/main/config/component/componentControl.xml 2008-04-15 10:04:40 UTC (rev 7833)
@@ -105,7 +105,7 @@
<description>
Defines an Id of a component or HTML element listened by the control component
</description>
- <defaultvalue>"immediate"</defaultvalue>
+ <defaultvalue>"onavailable"</defaultvalue>
</property>
<property hidden="true">
Modified: trunk/ui/componentControl/src/main/java/org/richfaces/renderkit/ComponentControlRendererBase.java
===================================================================
--- trunk/ui/componentControl/src/main/java/org/richfaces/renderkit/ComponentControlRendererBase.java 2008-04-15 09:59:49 UTC (rev 7832)
+++ trunk/ui/componentControl/src/main/java/org/richfaces/renderkit/ComponentControlRendererBase.java 2008-04-15 10:04:40 UTC (rev 7833)
@@ -1,38 +1,160 @@
package org.richfaces.renderkit;
+import java.io.IOException;
+
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import org.ajax4jsf.renderkit.ComponentVariables;
+import org.ajax4jsf.renderkit.ComponentsVariableResolver;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
+import org.ajax4jsf.renderkit.RendererUtils;
+import org.ajax4jsf.resource.InternetResource;
import org.richfaces.component.UIComponentControl;
import org.richfaces.component.util.HtmlUtil;
public class ComponentControlRendererBase extends HeaderResourcesRendererBase {
- protected Class getComponentClass() {
- return UIComponentControl.class;
+ /**
+ * Constant for "immediate" attach timing option
+ */
+ private static final String IMMEDIATE = "immediate";
+
+ /**
+ * Constant for "onAvailable" attach timing option
+ */
+ private static final String ON_AVAILABLE = "onavailable";
+
+ /**
+ * Constant for "onload" attach timing option
+ */
+ private static final String ON_LOAD = "onload";
+
+ protected Class<UIComponentControl> getComponentClass() {
+ return UIComponentControl.class;
+ }
+
+ /**
+ * Additional scripts.
+ */
+ private final InternetResource[] additionalScripts = { new org.ajax4jsf.javascript.PrototypeScript(),
+ new org.ajax4jsf.javascript.AjaxScript(), getResource("/org/richfaces/renderkit/html/scripts/available.js") };
+
+ /**
+ * Perform validation of the component control configuration. Throws FacesException in case validation fails.
+ * @param clientId - id of the component
+ * @param name - component name
+ * @param attachTiming - timing options
+ * @param forAttr - client ids of target components
+ * @param operation - operation performed on target components
+ */
+ protected void checkValidity(String clientId, String name, String attachTiming, String forAttr, String operation) {
+ if (!ON_LOAD.equals(attachTiming) && !IMMEDIATE.equals(attachTiming) && !ON_AVAILABLE.equals(attachTiming)) {
+ throw new FacesException("The attachTiming attribute of the controlComponent (id='" + clientId
+ + "') has an invalid value:'" + attachTiming + "'. It may have only the following values: '"
+ + IMMEDIATE + "', '" + ON_LOAD + "', '" + ON_AVAILABLE + "'");
}
- protected void checkValidity(String clientId, String name, String attachTiming, String forAttr, String operation) {
+ if (operation == null || operation.trim().length() == 0) {
+ throw new FacesException("The operation attribute of the controlComponent (id='" + clientId
+ + "') must be specified");
+ }
+ }
- if ( ! "onload".equals(attachTiming) &&
- ! "immediate".equals(attachTiming) ) {
- throw new FacesException(
- "The attachTiming attribute of the controlComponent (id='"+clientId+"') has an invalid value:'"+ attachTiming +
- "'. It may have only the following values: 'immediate', 'onload', 'onJScall'");
- }
+ protected String replaceClientIds(FacesContext context, UIComponent component, String selector) {
+ return HtmlUtil.expandIdSelector(HtmlUtil.idsToIdSelector(selector), component, context);
+ }
- if (operation==null || operation.trim().length() == 0) {
- throw new FacesException(
- "The operation attribute of the controlComponent (id='"+clientId+"') must be specified" );
- }
+ /**
+ * Prepare Java script according to the timing option of the component control
+ * and write it to the ResponceWriter
+ * @param context - FacesContext
+ * @param component - component control
+ * @throws IOException - is thrown in case of writing to ResponceWriter exception
+ */
+ protected void attachEventAccordingToTimingOption(FacesContext context, UIComponent component) throws IOException {
+ if (!(component instanceof UIComponentControl)) {
+ return;
+ }
+ UIComponentControl componentControl = (UIComponentControl) component;
+ String attachTo = componentControl.getAttachTo();
+ String attachTiming = componentControl.getAttachTiming();
+ boolean isImmediate = attachTiming.equals(IMMEDIATE);
+ boolean isOnLoad = attachTiming.equals(ON_LOAD);
+ boolean isOnAvailable = attachTiming.equals(ON_AVAILABLE);
+ if (!(isImmediate || isOnLoad || isOnAvailable)) {
+ // unknown value of property "attachTiming"
+ return;
}
- protected String replaceClientIds(FacesContext context, UIComponent component, String selector) {
- return HtmlUtil.expandIdSelector(HtmlUtil.idsToIdSelector(selector), component, context);
+ ResponseWriter writer = context.getResponseWriter();
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(this, componentControl);
+
+ writer.startElement("script", componentControl);
+ getUtils().writeAttribute(writer, "type", "text/javascript");
+ writer.writeText("//", null);
+ writer.write("<![CDATA[");
+
+ String attachEventBodyStart = "\n{\n Richfaces.componentControl.attachEvent('";
+ StringBuilder attachEventBodyEnd = new StringBuilder();
+ attachEventBodyEnd.append("', '");
+ attachEventBodyEnd.append(convertToString(variables.getVariable("event")));
+ attachEventBodyEnd.append("', '");
+ attachEventBodyEnd.append(convertToString(variables.getVariable("forAttr")));
+ attachEventBodyEnd.append("', '");
+ attachEventBodyEnd.append(convertToString(variables.getVariable("operation")));
+ attachEventBodyEnd.append("', function() { return {");
+ attachEventBodyEnd.append(convertToString(variables.getVariable("params")));
+ attachEventBodyEnd.append("}; }, ");
+ attachEventBodyEnd.append(convertToString(componentControl.isDisableDefault()));
+ attachEventBodyEnd.append(");\n }");
+
+ String pattern = "\\s*,\\s*";
+ // "attachTo" attribute may contain several ids splitted by ","
+ String[] result = attachTo.split(pattern);
+ for (int i = 0; i < result.length; i++) {
+ if (isOnLoad) {
+ writer.write("\n jQuery(document).ready(function()");
+ } else if (isOnAvailable) {
+ UIComponent target = RendererUtils.getInstance().findComponentFor(context, component, result[i]);
+ String clientId = (target != null) ? target.getClientId(context) : result[i];
+ writer.write("\n Richfaces.onAvailable('" + clientId + "', function()");
+ } else if (isImmediate) {
+ }
+ writer.write(attachEventBodyStart);
+ writer.write(replaceClientIds(context, component, result[i]));
+ writer.write(attachEventBodyEnd.toString());
+
+ if (isOnLoad || isOnAvailable) {
+ writer.write(");");
+ }
}
+ writer.writeText("//", null);
+ writer.write("]]>");
+ writer.endElement("script");
+ }
+
+ /**
+ * Gets additional scripts.
+ *
+ * @return array of resources
+ */
+ protected InternetResource[] getScripts() {
+ return additionalScripts;
+ }
+
+ /**
+ * Returns String representation of object. If object is null,
+ * returns empty String.
+ * @param obj - object
+ * @return String representation of object.
+ */
+ private static String convertToString(Object obj ) {
+ return ( obj == null ? "" : obj.toString() );
+ }
}
Modified: trunk/ui/componentControl/src/main/resources/org/richfaces/renderkit/html/script/controlUtils.js
===================================================================
--- trunk/ui/componentControl/src/main/resources/org/richfaces/renderkit/html/script/controlUtils.js 2008-04-15 09:59:49 UTC (rev 7832)
+++ trunk/ui/componentControl/src/main/resources/org/richfaces/renderkit/html/script/controlUtils.js 2008-04-15 10:04:40 UTC (rev 7833)
@@ -30,18 +30,13 @@
};
Richfaces.componentControl.attachEvent = function(attachTo, aevent, forAttr, operation, params, disableDefault) {
- var pattern = /\s*,\s*/;
- // "attachTo" attribute may contain several ids splitted by ","
- result = attachTo.split(pattern);
- for(i=0; i < result.length; i++) {
- jQuery(result[i]).bind(Richfaces.effectEventOnOut(aevent),function(cevent) {
- Richfaces.componentControl.performOperation(cevent, forAttr, operation, params, disableDefault);
- }).each(function() {
- Richfaces.componentControl.applyDecorations(this, forAttr, function(element) {
- //TODO: handle component decoration
- });
+ jQuery(attachTo).bind(Richfaces.effectEventOnOut(aevent),function(cevent) {
+ Richfaces.componentControl.performOperation(cevent, forAttr, operation, params, disableDefault);
+ }).each(function() {
+ Richfaces.componentControl.applyDecorations(this, forAttr, function(element) {
+ //TODO: handle component decoration
});
- }
+ });
};
Richfaces.componentControl.performOperation = function( cevent, forAttr, operation, params, disableDefault) {
Modified: trunk/ui/componentControl/src/main/templates/htmlComponentControl.jspx
===================================================================
--- trunk/ui/componentControl/src/main/templates/htmlComponentControl.jspx 2008-04-15 09:59:49 UTC (rev 7832)
+++ trunk/ui/componentControl/src/main/templates/htmlComponentControl.jspx 2008-04-15 10:04:40 UTC (rev 7833)
@@ -48,31 +48,9 @@
<jsp:scriptlet><![CDATA[ } ]]></jsp:scriptlet>
-<jsp:scriptlet><![CDATA[ if ( "immediate".equals(attachTiming) && ! "#".equals(attachTo) ) { ]]></jsp:scriptlet>
-<script type="text/javascript">
- //<![CDATA[
- {
+<jsp:scriptlet><![CDATA[ if (! "#".equals(attachTo) ) { ]]>
+ attachEventAccordingToTimingOption(context, component);
+<![CDATA[ } ]]>
+</jsp:scriptlet>
-Richfaces.componentControl.attachEvent(
- '#{attachTo}', '#{event}', '#{forAttr}', '#{operation}', function() { return {#{params}}; }, #{component.disableDefault} );
-
-}
-//]]>
-</script>
-<jsp:scriptlet><![CDATA[ } ]]></jsp:scriptlet>
-
-
-
-<jsp:scriptlet><![CDATA[ if ( "onload".equals(attachTiming) && ! "#".equals(attachTo) ) {]]></jsp:scriptlet>
-<script type="text/javascript">
- //<![CDATA[
- jQuery(document).ready(function() {
- Richfaces.componentControl.attachEvent(
- '#{attachTo}', '#{event}', '#{forAttr}', '#{operation}', function() { return {#{params}}; }, #{component.disableDefault} );
- });
-
-//]]>
-</script>
-<jsp:scriptlet><![CDATA[ } ]]></jsp:scriptlet>
-
</f:root>
\ No newline at end of file
16 years, 9 months
JBoss Rich Faces SVN: r7832 - trunk/ui/inplaceInput/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-04-15 05:59:49 -0400 (Tue, 15 Apr 2008)
New Revision: 7832
Modified:
trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml
Log:
RF-2220 Default values
Default values for InplaceInput attributes were added
Modified: trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml
===================================================================
--- trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-04-14 19:34:43 UTC (rev 7831)
+++ trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-04-15 09:59:49 UTC (rev 7832)
@@ -35,19 +35,19 @@
<property>
<name>layout</name>
<classname>java.lang.String</classname>
- <description>Defines how the component is displayed in the layout, can be block or inline</description>
+ <description>Defines how the component is displayed in the layout. Possible values are "block", "inline". . Default value is "inline". </description>
<defaultvalue><![CDATA["inline"]]></defaultvalue>
</property>
<property>
<name>maxInputWidth</name>
<classname>java.lang.String</classname>
- <description>Sets the maximum width of the input field</description>
+ <description>Sets the maximum width of the input field. Default value is "500px".</description>
<defaultvalue><![CDATA["500px"]]></defaultvalue>
</property>
<property>
<name>minInputWidth </name>
<classname>java.lang.String</classname>
- <description>Sets the minimum width of the input field</description>
+ <description>Sets the minimum width of the input field. Default value is "40px".</description>
<defaultvalue><![CDATA["40px"]]></defaultvalue>
</property>
<property>
@@ -65,59 +65,59 @@
<property>
<name>showControls</name>
<classname>boolean</classname>
- <description>The attribute serves to display "save" and "cancel" controls</description>
+ <description>Serves to display "save" and "cancel" controls. Default value is "false".</description>
<defaultvalue>false</defaultvalue>
</property>
<property>
<name>editEvent</name>
<classname>java.lang.String</classname>
- <description>The attribute provides an option to assign an JavaScript action that initiates the change of the state</description>
+ <description>Provides an option to assign an JavaScript action that initiates the change of the state. Default value is "onclick".</description>
<defaultvalue><![CDATA["onclick"]]></defaultvalue>
</property>
<property>
<name>controlsVerticalPosition</name>
<classname>java.lang.String</classname>
- <description>The attribute postions the controls vertically</description>
+ <description>Positions the controls vertically. Possible values are "bottom", "center", "top". Default value is "center".</description>
<defaultvalue><![CDATA["center"]]></defaultvalue>
</property>
<property>
<name>controlsHorizontalPosition</name>
<classname>java.lang.String</classname>
- <description>The attribute postions the controls horizontally</description>
+ <description>Positions the controls horizontally. Possible values are "left", "center", "right". Default value is "right".</description>
<defaultvalue><![CDATA["right"]]></defaultvalue>
</property>
<property>
<name>oneditactivation</name>
<classname>java.lang.String</classname>
- <description>The attributes provide a possibility to assign JavaScript on edit state activation</description>
+ <description>Provides a possibility to assign JavaScript on edit state activation</description>
</property>
<property>
<name>onviewactivation</name>
<classname>java.lang.String</classname>
- <description>The attributes provide a possibility to assign JavaScript on view state activation</description>
+ <description>Provides a possibility to assign JavaScript on view state activation</description>
</property>
<property>
<name>oneditactivated</name>
<classname>java.lang.String</classname>
- <description>The attributes provide a possibility to assign JavaScript to be executed when edit state is activated</description>
+ <description>Provides a possibility to assign JavaScript to be executed when edit state is activated</description>
</property>
<property>
<name>onviewactivated</name>
<classname>java.lang.String</classname>
- <description>The attributes provide a possibility to assign JavaScript to be executed when view state is activated</description>
+ <description>Provides a possibility to assign JavaScript to be executed when view state is activated</description>
</property>
<property>
<name>selectOnEdit</name>
<classname>boolean</classname>
- <description>The attribute make the input field select when switched to edit state</description>
+ <description>Makes the input field select when switched to edit state. Default value is "false"</description>
<defaultvalue>false</defaultvalue>
</property>
<property>
<name>tabindex</name>
<classname>int</classname>
- <description>The attribute serves to define the tabbing order</description>
+ <description>Serves to define the tabbing order</description>
</property>
<property>
<name>saveControlIcon</name>
@@ -138,7 +138,7 @@
<property>
<name>viewClass</name>
<classname>java.lang.String</classname>
- <description>Style class for view state</description>
+ <description>CSS style class for view state</description>
</property>
<property>
<name>editClass</name>
16 years, 9 months
JBoss Rich Faces SVN: r7831 - branches/3.1.x/framework/impl/src/main/resources/org/ajax4jsf/javascript/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-14 15:34:43 -0400 (Mon, 14 Apr 2008)
New Revision: 7831
Modified:
branches/3.1.x/framework/impl/src/main/resources/org/ajax4jsf/javascript/scripts/form.js
Log:
http://jira.jboss.com/jira/browse/RF-2950
Modified: branches/3.1.x/framework/impl/src/main/resources/org/ajax4jsf/javascript/scripts/form.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/resources/org/ajax4jsf/javascript/scripts/form.js 2008-04-14 18:52:56 UTC (rev 7830)
+++ branches/3.1.x/framework/impl/src/main/resources/org/ajax4jsf/javascript/scripts/form.js 2008-04-14 19:34:43 UTC (rev 7831)
@@ -19,6 +19,7 @@
} else {
var input = document.createElement("input");
input.type="hidden";
+ input.id=param;
input.name=param;
input.value=parameters[param];
form.appendChild(input);
16 years, 9 months