JBoss Rich Faces SVN: r19376 - trunk/bom.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-09-29 10:13:52 -0400 (Wed, 29 Sep 2010)
New Revision: 19376
Modified:
trunk/bom/pom.xml
Log:
RF-9386 upgraded myfaces to 2.0.2
Modified: trunk/bom/pom.xml
===================================================================
--- trunk/bom/pom.xml 2010-09-29 14:12:37 UTC (rev 19375)
+++ trunk/bom/pom.xml 2010-09-29 14:13:52 UTC (rev 19376)
@@ -139,12 +139,12 @@
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
- <version>2.0.1</version>
+ <version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>2.0.1</version>
+ <version>2.0.2</version>
</dependency>
<!-- Misc -->
14 years, 2 months
JBoss Rich Faces SVN: r19375 - trunk/ui/input/ui/src/main/config.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-09-29 10:12:37 -0400 (Wed, 29 Sep 2010)
New Revision: 19375
Modified:
trunk/ui/input/ui/src/main/config/faces-config.xml
Log:
add step attribute
Modified: trunk/ui/input/ui/src/main/config/faces-config.xml
===================================================================
--- trunk/ui/input/ui/src/main/config/faces-config.xml 2010-09-29 14:05:48 UTC (rev 19374)
+++ trunk/ui/input/ui/src/main/config/faces-config.xml 2010-09-29 14:12:37 UTC (rev 19375)
@@ -503,6 +503,14 @@
</property-extension>
</property>
<property>
+ <property-name>step</property-name>
+ <property-class>java.lang.String</property-class>
+ <default-value>"1"</default-value>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ </property-extension>
+ </property>
+ <property>
<property-name>style</property-name>
<property-class>java.lang.String</property-class>
<property-extension>
14 years, 2 months
JBoss Rich Faces SVN: r19374 - in trunk/examples/input-demo/src/main/webapp: resources/tests and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-09-29 10:05:48 -0400 (Wed, 29 Sep 2010)
New Revision: 19374
Modified:
trunk/examples/input-demo/src/main/webapp/qunit/autocomplete-qunit.xhtml
trunk/examples/input-demo/src/main/webapp/resources/tests/autocomplete-qunit.js
Log:
https://jira.jboss.org/browse/RF-9071
Modified: trunk/examples/input-demo/src/main/webapp/qunit/autocomplete-qunit.xhtml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/qunit/autocomplete-qunit.xhtml 2010-09-29 13:13:25 UTC (rev 19373)
+++ trunk/examples/input-demo/src/main/webapp/qunit/autocomplete-qunit.xhtml 2010-09-29 14:05:48 UTC (rev 19374)
@@ -30,9 +30,14 @@
<p>Page</p>
<h:form id="form">
- <input:autocomplete id="autocompleteDefault" value="a" fetchValue="#{country.name}" autocompleteMethod="#{autoCompleteBean.autocomplete}" var="country">
+ <input:autocomplete id="autocompleteDefault" value="a" fetchValue="#{country.name}" autocompleteMethod="#{autoCompleteBean.autocomplete}" var="country"
+ onchange="return onEvent.call(this, event);" onselectitem="return onEvent.call(this, event);" onblur="return onEvent.call(this, event);" onfocus="return onEvent.call(this, event);">
#{country.name} #{country.iso} #{country.domain}
</input:autocomplete><br />
+ <input:autocomplete id="autocompleteDefault2" fetchValue="#{country.name}" autocompleteMethod="#{autoCompleteBean.autocomplete}" var="country"
+ onselectitem="return onEvent.call(this, event);" showButton="true" mode="client">
+ #{country.name} #{country.iso} #{country.domain}
+ </input:autocomplete><br />
<input:autocomplete id="autocompleteClientMode" mode="client" fetchValue="#{country.name}" autocompleteMethod="#{autoCompleteBean.autocomplete}" var="country" showButton="true">
#{country.name} #{country.iso} #{country.domain}
</input:autocomplete><br />
Modified: trunk/examples/input-demo/src/main/webapp/resources/tests/autocomplete-qunit.js
===================================================================
--- trunk/examples/input-demo/src/main/webapp/resources/tests/autocomplete-qunit.js 2010-09-29 13:13:25 UTC (rev 19373)
+++ trunk/examples/input-demo/src/main/webapp/resources/tests/autocomplete-qunit.js 2010-09-29 14:05:48 UTC (rev 19374)
@@ -25,7 +25,9 @@
var AUTOCOMPLETE_ID = "form:autocomplete";
+ // Constructor tests
test("RichFaces.ui.Autocomplete constructor test", function () {
+ expect(15);
var c = RichFaces.$(AUTOCOMPLETE_ID+'Default');
ok(c instanceof RichFaces.ui.AutocompleteBase, "inctance of RichFaces.ui.AutocompleteBase");
@@ -46,7 +48,9 @@
equals(c.options.filterFunction, undefined, "options.filterFunction");
});
+ // Client API tests
test("RichFaces.ui.Autocomplete client api function's", function () {
+ expect(5);
var CLIENT_API_BASE = ['show','hide','getNamespace','getInputValue','setInputValue'];
var CLIENT_API = [];
var c = RichFaces.$(AUTOCOMPLETE_ID+'Default');
@@ -58,6 +62,7 @@
});
test("RichFaces.ui.Autocomplete client api: show/hide [attachToDom=true]", function () {
+ expect(6);
var c = RichFaces.$(AUTOCOMPLETE_ID+'Default');
var e = RichFaces.getDomElement(AUTOCOMPLETE_ID+'DefaultList');
equals(e.parentNode.tagName.toLowerCase(), "div", "before show list attached to");
@@ -73,44 +78,163 @@
});
test("RichFaces.ui.Autocomplete client api: getNamespace", function () {
+ expect(1);
var c = RichFaces.$(AUTOCOMPLETE_ID+'Default');
equals(c.getNamespace(), '.'+RichFaces.Event.createNamespace(c.name, AUTOCOMPLETE_ID+'Default'), "getNamespace");
});
test("RichFaces.ui.Autocomplete client api: getInputValue / setInputValue", function () {
+ expect(2);
var c = RichFaces.$(AUTOCOMPLETE_ID+'Default');
equals(c.getInputValue(), 'a', "getInputValue");
c.setInputValue("b");
equals(c.getInputValue(), 'b', "getInputValue after setInputValue");
});
-
-/*
- test("RichFaces.ui.Tab test events", function () {
- var componentId = TAB_ID;
- var c = RichFaces.$(componentId);
-
- expect(5);
- var beforeitemchngeHandler = function (event, comp, data) {
- ok(true, "beforeitemchnge handler invouked");
-
- same(data.id, componentId, "component id");
- same(data.oldItem.getName(), c.items[0].getName(), "old item");
- same(data.newItem.getName(), c.items[1].getName(), "new item");
-
- return true;
+
+ //Inline user's event handlers tests
+ window.checkInlineEvent = function (event, c, checkData) {
+ var richContainer = event[RichFaces.RICH_CONTAINER];
+ ok(richContainer, "rich container is present in event");
+ ok(richContainer.component, "component is present in rich container");
+ equals(richContainer.component, c, "component");
+ if (checkData) {
+ ok(typeof richContainer.data!="undefined", "data is present in rich container");
+ equals(richContainer.data, RichFaces.getDomElement(AUTOCOMPLETE_ID+'Default2Input').value, "data");
+ }
+ };
+
+ test("RichFaces.ui.Autocomplete inline event handlers: focus/blur", function () {
+ expect(10);
+ var c = RichFaces.$(AUTOCOMPLETE_ID+'Default');
+
+ window.onEvent = function (event) {
+ ok(event, "event is present");
+ equals(event.type, "focus", "event type after focus");
+ checkInlineEvent(event, c);
};
+ var input = RichFaces.getDomElement(AUTOCOMPLETE_ID+'DefaultInput');
+ input.focus();
+
+ window.onEvent = function (event) {
+ ok(event, "event is present");
+ equals(event.type, "blur", "event type after blur");
+ checkInlineEvent(event, c);
+ };
+ input = RichFaces.getDomElement(AUTOCOMPLETE_ID+'Default2Input');
+ input.focus();
+ window.onEvent = function (){};
+ });
+
+ test("RichFaces.ui.Autocomplete inline event handlers: change", function () {
+ expect(5);
+ var c = RichFaces.$(AUTOCOMPLETE_ID+'Default');
+
+ window.onEvent = function (event) {
+ if (event.type!="change") return;
+ ok(event, "event is present");
+ equals(event.type, "change", "event type");
+ checkInlineEvent(event, c);
+ };
+ var input = RichFaces.getDomElement(AUTOCOMPLETE_ID+'DefaultInput');
+ input.value="";
+ input.focus();
+ input.value="a";
+ input = RichFaces.getDomElement(AUTOCOMPLETE_ID+'Default2Input');
+ input.focus();
+ window.onEvent = function (){};
+ });
+
+ test("RichFaces.ui.Autocomplete inline event handlers: selectitem", function () {
+ expect(7);
+ var c = RichFaces.$(AUTOCOMPLETE_ID+'Default2');
+
+ window.onEvent = function (event) {
+ if (event.type!="selectitem") return;
+ ok(event, "event is present");
+ equals(event.type, "selectitem", "event type");
+ checkInlineEvent(event, c, true);
+ };
+ var input = RichFaces.getDomElement(AUTOCOMPLETE_ID+'Default2Input');
+ input.value="a";
+ var button = RichFaces.getDomElement(AUTOCOMPLETE_ID+'Default2Button');
+ RichFaces.Event.fire(button,"mousedown");
+ c.__onEnter.call(c, {which:13});
+ c.hide();
+ input = RichFaces.getDomElement(AUTOCOMPLETE_ID+'ClientModeInput');
+ input.focus();
+ window.onEvent = function (){};
+ });
+
+ //Binded user's event handlers tests
+ window.checkBindedEvent = function (event, element, c) {
+ equals(element.id, c.id, "element id");
+ equals(RichFaces.$(element.id), c, "component");
+ };
+
+ test("RichFaces.ui.Autocomplete binded event handlers: focus/blur", function () {
+ expect(10);
+ var c = RichFaces.$(AUTOCOMPLETE_ID+'Default');
+ RichFaces.Event.bindById(AUTOCOMPLETE_ID+'Default', {"focus": function (event, element) {
+ ok(event, "event is present");
+ ok(element, "element is present");
+ equals(event.type, "focus", "event type after focus");
+ checkBindedEvent(event, element, c);
+ },
+ "blur": function (event, element) {
+ ok(event, "event is present");
+ ok(element, "element is present");
+ equals(event.type, "blur", "event type after blur");
+ checkBindedEvent(event, element, c);
+ }
+ });
+ var input = RichFaces.getDomElement(AUTOCOMPLETE_ID+'DefaultInput');
+ input.focus();
+ input = RichFaces.getDomElement(AUTOCOMPLETE_ID+'Default2Input');
+ input.focus();
+ RichFaces.Event.unbindById(AUTOCOMPLETE_ID+'Default', "focus blur");
+ });
+
+ test("RichFaces.ui.Autocomplete binded event handlers: change", function () {
+ expect(5);
+ var c = RichFaces.$(AUTOCOMPLETE_ID+'Default');
+ RichFaces.Event.bindById(AUTOCOMPLETE_ID+'Default', "change", function (event, element) {
+ ok(event, "event is present");
+ ok(element, "element is present");
+ equals(event.type, "change", "event type");
+ checkBindedEvent(event, element, c);
+ });
+ var input = RichFaces.getDomElement(AUTOCOMPLETE_ID+'DefaultInput');
+ input.value="";
+ input.focus();
+ input.value="a"
+ input = RichFaces.getDomElement(AUTOCOMPLETE_ID+'Default2Input');
+ input.focus();
+ RichFaces.Event.unbindById(AUTOCOMPLETE_ID+'Default', "change");
+ });
+
+ test("RichFaces.ui.Autocomplete binded event handlers: selectitem", function () {
+ expect(7);
+ var c = RichFaces.$(AUTOCOMPLETE_ID+'Default2');
+
+ RichFaces.Event.bindById(AUTOCOMPLETE_ID+'Default2', "selectitem", function (event, element, data) {
+ ok(event, "event is present");
+ ok(element, "element is present");
+ ok(data, "data is present");
+ equals(data, RichFaces.getDomElement(AUTOCOMPLETE_ID+'Default2Input').value, "data");
+ equals(event.type, "selectitem", "event type");
+ checkBindedEvent(event, element, c);
+ });
+ var input = RichFaces.getDomElement(AUTOCOMPLETE_ID+'Default2Input');
+ input.value="a";
+ var button = RichFaces.getDomElement(AUTOCOMPLETE_ID+'Default2Button');
+ RichFaces.Event.fire(button,"mousedown");
+ c.__onEnter.call(c, {which:13});
+ c.hide();
+ input = RichFaces.getDomElement(AUTOCOMPLETE_ID+'ClientModeInput');
+ input.focus();
+ RichFaces.Event.unbindById(AUTOCOMPLETE_ID+'Default2', "selectitem");
+ });
+
+ // TODO add modes test ?? or create selenium tests for modes ??
- var beforeitemchngeHandlerWrapper = RichFaces.Event.bindById(componentId, "beforeitemchange", beforeitemchngeHandler);
-
- var itemchangeHandler = handler("itemchnge handler invouked", undefined);
- var itemchangeHandlerWrapper = RichFaces.Event.bindById(componentId, "itemchange", itemchangeHandler);
-
- c.switchToItem("name2");
-
- RichFaces.Event.unbindById(componentId, "beforeitemchange", beforeitemchngeHandlerWrapper);
- RichFaces.Event.unbindById(componentId, "itemchange", itemchangeHandlerWrapper);
-
- c.switchToItem("name1");
- });
- */
});
14 years, 2 months
JBoss Rich Faces SVN: r19373 - in modules/tests/metamer/trunk/application/src/main/webapp: resources/images and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-09-29 09:13:25 -0400 (Wed, 29 Sep 2010)
New Revision: 19373
Added:
modules/tests/metamer/trunk/application/src/main/webapp/resources/images/right.png
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hGraphicImage.xhtml
Log:
* page for graphicImage rewritten (for testing)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hGraphicImage.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hGraphicImage.xhtml 2010-09-29 13:04:48 UTC (rev 19372)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hGraphicImage.xhtml 2010-09-29 13:13:25 UTC (rev 19373)
@@ -40,37 +40,36 @@
</ui:define>
<ui:define name="component">
- <h:graphicImage id="image" library="images" name="richfaces.jpg">
- <a4j:ajax id="inputAjax" bypassUpdates="#{a4jAjaxBean.attributes['bypassUpdates'].value}"
- data="#{a4jAjaxBean.attributes['data'].value}"
- disabled="#{a4jAjaxBean.attributes['disabled'].value}"
- event="click"
- execute="#{a4jAjaxBean.attributes['execute'].value}"
- immediate="#{a4jAjaxBean.attributes['immediate'].value}"
- limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
- listener="#{a4jAjaxBean.attributes.listener}"
- onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
- onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
- oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
- onerror="#{a4jAjaxBean.attributes['onerror'].value}"
- onevent="#{a4jAjaxBean.attributes['onevent'].value}"
- queueId="#{a4jAjaxBean.attributes['queueId'].value}"
- render="#{a4jAjaxBean.attributes['render'].value}"
- status="#{a4jAjaxBean.attributes['status'].value}"
- />
- </h:graphicImage>
+ <h:panelGrid columns="2">
+ <h:inputText id="input" value="#{a4jAjaxBean.input}"/>
+ <h:graphicImage id="image" library="images" name="right.png" style="width: 20px;" title="Submit">
+ <a4j:ajax id="inputAjax" bypassUpdates="#{a4jAjaxBean.attributes['bypassUpdates'].value}"
+ data="#{a4jAjaxBean.attributes['data'].value}"
+ disabled="#{a4jAjaxBean.attributes['disabled'].value}"
+ event="click"
+ execute="#{a4jAjaxBean.attributes['execute'].value}"
+ immediate="#{a4jAjaxBean.attributes['immediate'].value}"
+ limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
+ listener="#{a4jAjaxBean.attributes.listener}"
+ onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
+ onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
+ oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
+ onerror="#{a4jAjaxBean.attributes['onerror'].value}"
+ onevent="#{a4jAjaxBean.attributes['onevent'].value}"
+ queueId="#{a4jAjaxBean.attributes['queueId'].value}"
+ render="#{a4jAjaxBean.attributes['render'].value}"
+ status="#{a4jAjaxBean.attributes['status'].value}"
+ />
+ </h:graphicImage>
+ </h:panelGrid>
<br/><br/>
<a4j:outputPanel id="output1" layout="block">
- <h:outputText value="#{timeBean.date}">
- <f:convertDateTime pattern="HH:mm:ss.SSS" />
- </h:outputText>
+ <h:outputText value="#{a4jAjaxBean.input}"/>
</a4j:outputPanel>
<a4j:outputPanel id="output2" layout="block">
- <h:outputText value="#{timeBean.date}">
- <f:convertDateTime pattern="HH:mm:ss.SSS" />
- </h:outputText>
+ <h:outputText value="#{a4jAjaxBean.input}"/>
</a4j:outputPanel>
</ui:define>
Added: modules/tests/metamer/trunk/application/src/main/webapp/resources/images/right.png
===================================================================
(Binary files differ)
Property changes on: modules/tests/metamer/trunk/application/src/main/webapp/resources/images/right.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years, 2 months
JBoss Rich Faces SVN: r19372 - modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-09-29 09:04:48 -0400 (Wed, 29 Sep 2010)
New Revision: 19372
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hCommandButton.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hCommandButtonWrapped.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hCommandLink.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hGraphicImage.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hInputSecret.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hInputText.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hInputTextarea.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectBooleanCheckbox.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectManyCheckbox.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectManyListbox.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectManyMenu.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectOneListbox.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectOneMenu.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectOneRadio.xhtml
Log:
* attribute 'listener' added to all pages
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hCommandButton.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hCommandButton.xhtml 2010-09-29 13:02:16 UTC (rev 19371)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hCommandButton.xhtml 2010-09-29 13:04:48 UTC (rev 19372)
@@ -49,6 +49,7 @@
execute="#{a4jAjaxBean.attributes['execute'].value}"
immediate="#{a4jAjaxBean.attributes['immediate'].value}"
limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
+ listener="#{a4jAjaxBean.attributes.listener}"
onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hCommandButtonWrapped.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hCommandButtonWrapped.xhtml 2010-09-29 13:02:16 UTC (rev 19371)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hCommandButtonWrapped.xhtml 2010-09-29 13:04:48 UTC (rev 19372)
@@ -48,6 +48,7 @@
execute="#{a4jAjaxBean.attributes['execute'].value}"
immediate="#{a4jAjaxBean.attributes['immediate'].value}"
limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
+ listener="#{a4jAjaxBean.attributes.listener}"
onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
@@ -60,9 +61,12 @@
<h:commandButton id="commandButton" value="Submit" />
</a4j:ajax>
- <a4j:outputPanel id="output" layout="block">
+ <a4j:outputPanel id="output1" layout="block">
<h:outputText value="#{a4jAjaxBean.input}"/>
</a4j:outputPanel>
+ <a4j:outputPanel id="output2" layout="block">
+ <h:outputText value="#{a4jAjaxBean.input}"/>
+ </a4j:outputPanel>
</ui:define>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hCommandLink.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hCommandLink.xhtml 2010-09-29 13:02:16 UTC (rev 19371)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hCommandLink.xhtml 2010-09-29 13:04:48 UTC (rev 19372)
@@ -49,6 +49,7 @@
execute="#{a4jAjaxBean.attributes['execute'].value}"
immediate="#{a4jAjaxBean.attributes['immediate'].value}"
limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
+ listener="#{a4jAjaxBean.attributes.listener}"
onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hGraphicImage.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hGraphicImage.xhtml 2010-09-29 13:02:16 UTC (rev 19371)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hGraphicImage.xhtml 2010-09-29 13:04:48 UTC (rev 19372)
@@ -48,6 +48,7 @@
execute="#{a4jAjaxBean.attributes['execute'].value}"
immediate="#{a4jAjaxBean.attributes['immediate'].value}"
limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
+ listener="#{a4jAjaxBean.attributes.listener}"
onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hInputSecret.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hInputSecret.xhtml 2010-09-29 13:02:16 UTC (rev 19371)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hInputSecret.xhtml 2010-09-29 13:04:48 UTC (rev 19372)
@@ -48,6 +48,7 @@
execute="#{a4jAjaxBean.attributes['execute'].value}"
immediate="#{a4jAjaxBean.attributes['immediate'].value}"
limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
+ listener="#{a4jAjaxBean.attributes.listener}"
onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hInputText.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hInputText.xhtml 2010-09-29 13:02:16 UTC (rev 19371)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hInputText.xhtml 2010-09-29 13:04:48 UTC (rev 19372)
@@ -48,6 +48,7 @@
execute="#{a4jAjaxBean.attributes['execute'].value}"
immediate="#{a4jAjaxBean.attributes['immediate'].value}"
limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
+ listener="#{a4jAjaxBean.attributes.listener}"
onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hInputTextarea.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hInputTextarea.xhtml 2010-09-29 13:02:16 UTC (rev 19371)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hInputTextarea.xhtml 2010-09-29 13:04:48 UTC (rev 19372)
@@ -48,6 +48,7 @@
execute="#{a4jAjaxBean.attributes['execute'].value}"
immediate="#{a4jAjaxBean.attributes['immediate'].value}"
limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
+ listener="#{a4jAjaxBean.attributes.listener}"
onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectBooleanCheckbox.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectBooleanCheckbox.xhtml 2010-09-29 13:02:16 UTC (rev 19371)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectBooleanCheckbox.xhtml 2010-09-29 13:04:48 UTC (rev 19372)
@@ -48,6 +48,7 @@
execute="#{a4jAjaxBean.attributes['execute'].value}"
immediate="#{a4jAjaxBean.attributes['immediate'].value}"
limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
+ listener="#{a4jAjaxBean.attributes.listener}"
onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectManyCheckbox.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectManyCheckbox.xhtml 2010-09-29 13:02:16 UTC (rev 19371)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectManyCheckbox.xhtml 2010-09-29 13:04:48 UTC (rev 19372)
@@ -54,6 +54,7 @@
execute="#{a4jAjaxBean.attributes['execute'].value}"
immediate="#{a4jAjaxBean.attributes['immediate'].value}"
limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
+ listener="#{a4jAjaxBean.attributes.listener}"
onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectManyListbox.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectManyListbox.xhtml 2010-09-29 13:02:16 UTC (rev 19371)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectManyListbox.xhtml 2010-09-29 13:04:48 UTC (rev 19372)
@@ -54,6 +54,7 @@
execute="#{a4jAjaxBean.attributes['execute'].value}"
immediate="#{a4jAjaxBean.attributes['immediate'].value}"
limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
+ listener="#{a4jAjaxBean.attributes.listener}"
onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectManyMenu.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectManyMenu.xhtml 2010-09-29 13:02:16 UTC (rev 19371)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectManyMenu.xhtml 2010-09-29 13:04:48 UTC (rev 19372)
@@ -54,6 +54,7 @@
execute="#{a4jAjaxBean.attributes['execute'].value}"
immediate="#{a4jAjaxBean.attributes['immediate'].value}"
limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
+ listener="#{a4jAjaxBean.attributes.listener}"
onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectOneListbox.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectOneListbox.xhtml 2010-09-29 13:02:16 UTC (rev 19371)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectOneListbox.xhtml 2010-09-29 13:04:48 UTC (rev 19372)
@@ -53,6 +53,7 @@
execute="#{a4jAjaxBean.attributes['execute'].value}"
immediate="#{a4jAjaxBean.attributes['immediate'].value}"
limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
+ listener="#{a4jAjaxBean.attributes.listener}"
onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectOneMenu.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectOneMenu.xhtml 2010-09-29 13:02:16 UTC (rev 19371)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectOneMenu.xhtml 2010-09-29 13:04:48 UTC (rev 19372)
@@ -54,6 +54,7 @@
execute="#{a4jAjaxBean.attributes['execute'].value}"
immediate="#{a4jAjaxBean.attributes['immediate'].value}"
limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
+ listener="#{a4jAjaxBean.attributes.listener}"
onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectOneRadio.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectOneRadio.xhtml 2010-09-29 13:02:16 UTC (rev 19371)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hSelectOneRadio.xhtml 2010-09-29 13:04:48 UTC (rev 19372)
@@ -54,6 +54,7 @@
execute="#{a4jAjaxBean.attributes['execute'].value}"
immediate="#{a4jAjaxBean.attributes['immediate'].value}"
limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
+ listener="#{a4jAjaxBean.attributes.listener}"
onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
14 years, 2 months
JBoss Rich Faces SVN: r19371 - trunk/core/impl/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-09-29 09:02:16 -0400 (Wed, 29 Sep 2010)
New Revision: 19371
Modified:
trunk/core/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
Log:
small fix: RICH_CONTAINER moved from richfaces-base-component.js to richfaces.js
Modified: trunk/core/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-09-29 12:37:23 UTC (rev 19370)
+++ trunk/core/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-09-29 13:02:16 UTC (rev 19371)
@@ -4,8 +4,6 @@
(function ($, richfaces, params) {
-
- var RICH_CONTAINER = "richfaces";
richfaces.blankFunction = function (){}; //TODO: add it to global library
@@ -177,7 +175,7 @@
* @type String
* */
name: "BaseComponent",
-
+
/**
* Method for converting object to string
*
@@ -230,7 +228,7 @@
source = source || this.id;
var element = richfaces.getDomElement(source);
if (element) {
- element[RICH_CONTAINER] = element[RICH_CONTAINER] || {};
+ element[richfaces.RICH_CONTAINER] = element[richfaces.RICH_CONTAINER] || {};
element.richfaces.component = this;
}
return element;
@@ -270,7 +268,7 @@
eventObj.initEvent( eventType, true, false );
}
}
- eventObj[RICH_CONTAINER] = {component:this, data: data};
+ eventObj[richfaces.RICH_CONTAINER] = {component:this, data: data};
var eventHandler = this.options['on'+eventType];
Modified: trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-09-29 12:37:23 UTC (rev 19370)
+++ trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-09-29 13:02:16 UTC (rev 19371)
@@ -13,6 +13,8 @@
(function(jQuery, richfaces) {
+ richfaces.RICH_CONTAINER = "richfaces";
+
// get DOM element by id or DOM element or jQuery object
richfaces.getDomElement = function (source) {
var type = typeof source;
14 years, 2 months
JBoss Rich Faces SVN: r19370 - in modules/tests/metamer/trunk/application/src/main: java/org/richfaces/tests/metamer/bean and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-09-29 08:37:23 -0400 (Wed, 29 Sep 2010)
New Revision: 19370
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hInputTextWrapped.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAjaxBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/A4JAjaxBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/list.xhtml
Log:
* added page with a4j:ajax wrapping 3 text inputs
* added method for testing attribute 'listener' and 'onerror'
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java 2010-09-29 12:02:10 UTC (rev 19369)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attributes.java 2010-09-29 12:37:23 UTC (rev 19370)
@@ -47,6 +47,7 @@
import javax.faces.component.behavior.BehaviorBase;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
+import javax.faces.event.AjaxBehaviorEvent;
import javax.faces.model.SelectItem;
import org.richfaces.tests.metamer.bean.RichBean;
@@ -106,7 +107,7 @@
}
logger.debug(attributes.keySet().toString());
-
+
loadHelp();
loadSelectOptions();
}
@@ -145,7 +146,7 @@
} catch (MissingResourceException mre) {
return;
}
-
+
Enumeration<String> keys = rb.getKeys();
String key = null;
Attribute attribute = null;
@@ -408,7 +409,7 @@
}
RichBean.logToPage("* action listener invoked");
-
+
// if no select options for "actionListener" are defined in property file and it is an EL expression
if (!hasSelectOptions("actionListener") && isStringEL(listener)) {
method =
@@ -427,6 +428,45 @@
}
/**
+ * An action listener for tested JSF component. Can be modified dynamically.
+ *
+ * @param event
+ * event representing the activation of a user interface component
+ */
+ public void listener(AjaxBehaviorEvent event) {
+ ELContext elContext = FacesContext.getCurrentInstance().getELContext();
+ MethodExpression method = null;
+
+ if (attributes.get("listener") == null) {
+ return;
+ }
+
+ String listener = (String) attributes.get("listener").getValue();
+
+ if (listener == null) {
+ return;
+ }
+
+ RichBean.logToPage("* listener invoked");
+
+ // if no select options for "listener" are defined in property file and it is an EL expression
+ if (!hasSelectOptions("listener") && isStringEL(listener)) {
+ method =
+ getExpressionFactory().createMethodExpression(elContext, listener, void.class,
+ new Class[]{AjaxBehaviorEvent.class});
+ method.invoke(elContext, new Object[]{event});
+ }
+
+ // if select options for "listener" are defined in property file
+ if (hasSelectOptions("listener")) {
+ method =
+ getExpressionFactory().createMethodExpression(elContext, getMethodEL(listener), void.class,
+ new Class[]{AjaxBehaviorEvent.class});
+ method.invoke(elContext, new Object[]{event});
+ }
+ }
+
+ /**
* Method used for creating EL expressions for methods.
*
* @param methodName
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAjaxBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAjaxBean.java 2010-09-29 12:02:10 UTC (rev 19369)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAjaxBean.java 2010-09-29 12:37:23 UTC (rev 19370)
@@ -19,7 +19,6 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*******************************************************************************/
-
package org.richfaces.tests.metamer.bean;
import java.io.Serializable;
@@ -27,10 +26,14 @@
import java.util.List;
import javax.annotation.PostConstruct;
+import javax.faces.FacesException;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
+import javax.faces.event.AjaxBehaviorEvent;
+import javax.faces.model.SelectItem;
import org.ajax4jsf.component.behavior.AjaxBehavior;
+import org.richfaces.tests.metamer.Attribute;
import org.richfaces.tests.metamer.Attributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -46,6 +49,7 @@
public class A4JAjaxBean implements Serializable {
private static final long serialVersionUID = -546567867L;
+ private static final int ACTION_STRING_LENGTH = 6;
private static Logger logger;
private Attributes attributes;
private String input;
@@ -64,10 +68,21 @@
attributes = Attributes.getBehaviorAttributes(AjaxBehavior.class, getClass());
// the 'event' attribute for behavior tag must be a literal
attributes.remove("event");
-
+
attributes.setAttribute("render", "output1, output2");
attributes.setAttribute("execute", "@form");
-
+
+ // FIXME not found attribute
+ Attribute listenerAttr = new Attribute("listener");
+ List<SelectItem> selectOptions = new ArrayList<SelectItem>();
+ selectOptions.add(new SelectItem("doubleStringListener", "doubleStringListener"));
+ selectOptions.add(new SelectItem("first6CharsListener", "first6CharsListener"));
+ selectOptions.add(new SelectItem("toUpperCaseListener", "toUpperCaseListener"));
+ selectOptions.add(new SelectItem("causeErrorListener", "causeErrorListener"));
+ selectOptions.add(new SelectItem(null, "null"));
+ listenerAttr.setSelectOptions(selectOptions);
+ attributes.put(listenerAttr.getName(), listenerAttr);
+
cars = new ArrayList<String>();
cars.add("Ferrari");
cars.add("Lexus");
@@ -132,5 +147,55 @@
public void setBoolVal(boolean boolVal) {
this.boolVal = boolVal;
}
-
+
+ /**
+ * An action listener that takes the first six characters from input and stores it to input.
+ *
+ * @param event
+ * an event representing the activation of a user interface component (not used)
+ */
+ public void first6CharsListener(AjaxBehaviorEvent event) {
+ if (input == null) {
+ input = "";
+ } else {
+ int endIndex = input.length() > ACTION_STRING_LENGTH ? ACTION_STRING_LENGTH : input.length();
+ input = (String) input.subSequence(0, endIndex);
+ }
+ }
+
+ /**
+ * An action listener that takes user's input, doubles it and stores it to input.
+ *
+ * @param event
+ * an event representing the activation of a user interface component (not used)
+ */
+ public void doubleStringListener(AjaxBehaviorEvent event) {
+ if (input == null) {
+ input = "";
+ } else {
+ input = input.concat(input);
+ }
+ }
+
+ /**
+ * An action listener that takes user's input, converts it to upper case and stores it to input3.
+ *
+ * @param event
+ * an event representing the activation of a user interface component (not used)
+ */
+ public void toUpperCaseListener(AjaxBehaviorEvent event) {
+ if (input == null) {
+ input = "";
+ } else {
+ input = input.toUpperCase();
+ }
+ }
+
+ /**
+ * An action listener causing error. Suitable for testing onerror attribute.
+ * @param event an event representing the activation of a user interface component (not used)
+ */
+ public void causeErrorListener(AjaxBehaviorEvent event) {
+ throw new FacesException("Ajax request caused an error. This is intentional behavior.");
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-09-29 12:02:10 UTC (rev 19369)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-09-29 12:37:23 UTC (rev 19370)
@@ -19,7 +19,6 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*******************************************************************************/
-
package org.richfaces.tests.metamer.bean;
import java.io.Serializable;
@@ -32,12 +31,11 @@
import javax.annotation.PostConstruct;
import javax.el.ExpressionFactory;
import javax.el.ValueExpression;
-import javax.faces.application.FacesMessage;
+import javax.faces.FacesException;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
-import javax.faces.validator.ValidatorException;
import javax.servlet.http.HttpSession;
import org.slf4j.Logger;
@@ -68,6 +66,7 @@
private String container;
public enum Skinning {
+
NONE, SKINNING, SKINNING_CLASSES
}
@@ -334,10 +333,10 @@
* Action that causes an error. Suitable for testing 'onerror' attribute.
*
* @return method never returns any value
- * @throws ValidationException
+ * @throws FacesException
* thrown always
*/
public String causeError() {
- throw new ValidatorException(new FacesMessage("Ajax request caused an error. This is intentional behavior."));
+ throw new FacesException("Ajax request caused an error. This is intentional behavior.");
}
}
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/A4JAjaxBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/A4JAjaxBean.properties 2010-09-29 12:02:10 UTC (rev 19369)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/A4JAjaxBean.properties 2010-09-29 12:37:23 UTC (rev 19370)
@@ -0,0 +1,6 @@
+attr.listener.first6CharsListener=first6CharsListener
+attr.listener.doubleStringListener=doubleStringListener
+attr.listener.toUpperCaseListener=toUpperCaseListener
+attr.listener.causeErrorListener=causeErrorListener
+attr.listener.null=
+
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hInputTextWrapped.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hInputTextWrapped.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/hInputTextWrapped.xhtml 2010-09-29 12:37:23 UTC (rev 19370)
@@ -0,0 +1,80 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+
+<!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ <h:outputStylesheet library="css" name="a4jAjax.css"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <a4j:ajax id="inputAjax" bypassUpdates="#{a4jAjaxBean.attributes['bypassUpdates'].value}"
+ data="#{a4jAjaxBean.attributes['data'].value}"
+ disabled="#{a4jAjaxBean.attributes['disabled'].value}"
+ event="keyup"
+ execute="#{a4jAjaxBean.attributes['execute'].value}"
+ immediate="#{a4jAjaxBean.attributes['immediate'].value}"
+ limitRender="#{a4jAjaxBean.attributes['limitRender'].value}"
+ listener="#{a4jAjaxBean.attributes.listener}"
+ onbeforedomupdate="#{a4jAjaxBean.attributes['onbeforedomupdate'].value}"
+ onbegin="#{a4jAjaxBean.attributes['onbegin'].value}"
+ oncomplete="#{a4jAjaxBean.attributes['oncomplete'].value}"
+ onerror="#{a4jAjaxBean.attributes['onerror'].value}"
+ onevent="#{a4jAjaxBean.attributes['onevent'].value}"
+ queueId="#{a4jAjaxBean.attributes['queueId'].value}"
+ render="#{a4jAjaxBean.attributes['render'].value}"
+ status="#{a4jAjaxBean.attributes['status'].value}"
+ >
+ <h:inputText id="input1" value="#{a4jAjaxBean.input}"/><br/>
+ <h:inputText id="input2" value="#{a4jAjaxBean.input}"/><br/>
+ <h:inputText id="input3" value="#{a4jAjaxBean.input}"/><br/>
+ </a4j:ajax>
+
+ <a4j:outputPanel id="output1" layout="block">
+ <h:outputText value="#{a4jAjaxBean.input}"/>
+ </a4j:outputPanel>
+ <a4j:outputPanel id="output2" layout="block">
+ <h:outputText value="#{a4jAjaxBean.input}"/>
+ </a4j:outputPanel>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{a4jAjaxBean.attributes}" id="attributes" render="log"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/list.xhtml 2010-09-29 12:02:10 UTC (rev 19369)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAjax/list.xhtml 2010-09-29 12:37:23 UTC (rev 19370)
@@ -45,6 +45,10 @@
Simple page that contains <b>h:inputText</b> with <b>a4j:ajax</b> and input boxes for all its attributes.
</metamer:testPageLink>
+ <metamer:testPageLink id="hInputTextWrapped" outcome="hInputTextWrapped" value="Input Text Wrapped">
+ Simple page that contains <b>h:inputText</b> nested in <b>a4j:ajax</b> and input boxes for all its attributes.
+ </metamer:testPageLink>
+
<metamer:testPageLink id="hInputSecret" outcome="hInputSecret" value="Input Secret">
Simple page that contains <b>h:inputSecret</b> with <b>a4j:ajax</b> and input boxes for all its attributes.
</metamer:testPageLink>
14 years, 2 months
JBoss Rich Faces SVN: r19369 - in trunk/examples/richfaces-showcase/src/main: webapp/richfaces and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-09-29 08:02:10 -0400 (Wed, 29 Sep 2010)
New Revision: 19369
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSpinner/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSpinner/samples/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSpinner/samples/spinners-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSpinner/spinners.xhtml
Modified:
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
Log:
RF-9201
Modified: trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-09-29 11:19:44 UTC (rev 19368)
+++ trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-09-29 12:02:10 UTC (rev 19369)
@@ -367,6 +367,16 @@
</samples>
</demo>
<demo>
+ <id>inputNumberSpinner</id>
+ <name>rich:inputNumberSpinner</name>
+ <samples>
+ <sample>
+ <id>spinners</id>
+ <name>Different Spinners samples</name>
+ </sample>
+ </samples>
+ </demo>
+ <demo>
<id>inplaceInput</id>
<name>rich:inplaceInput</name>
<samples>
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSpinner/samples/spinners-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSpinner/samples/spinners-sample.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSpinner/samples/spinners-sample.xhtml 2010-09-29 12:02:10 UTC (rev 19369)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <p>Here is an example of default inputNumberSpinner:</p>
+
+ <rich:inputNumberSpinner value="50"/>
+
+ <p>Here is one more inputNumberSpinner:</p>
+
+ <rich:inputNumberSpinner value="50" step="10"/>
+
+</ui:composition>
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSpinner/spinners.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSpinner/spinners.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSpinner/spinners.xhtml 2010-09-29 12:02:10 UTC (rev 19369)
@@ -0,0 +1,20 @@
+<!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: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>
+ <p>InputNumberSpinner is a highly customizable component that is used to define a numeric
+ input in a given range. A user can use a spinner control or just type some text into an input field.</p>
+
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+</ui:composition>
+
+</html>
\ No newline at end of file
14 years, 2 months
JBoss Rich Faces SVN: r19368 - trunk/examples/input-demo/src/main/webapp/examples.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-09-29 07:19:44 -0400 (Wed, 29 Sep 2010)
New Revision: 19368
Modified:
trunk/examples/input-demo/src/main/webapp/examples/inputNumberSlider.xhtml
Log:
RF-9218
Modified: trunk/examples/input-demo/src/main/webapp/examples/inputNumberSlider.xhtml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/examples/inputNumberSlider.xhtml 2010-09-29 11:19:09 UTC (rev 19367)
+++ trunk/examples/input-demo/src/main/webapp/examples/inputNumberSlider.xhtml 2010-09-29 11:19:44 UTC (rev 19368)
@@ -39,12 +39,17 @@
<f:selectItems value="#{skinBean.skins}"/>
</h:selectOneMenu>
<br />
+ <h:outputText value="Date: "/>
+ <h:outputText id="date" value="#{inputNumberSliderBean.date}" />
+ <br />
<ins:inputNumberSlider id="ins" value="#{inputNumberSliderBean.value}" accesskey="#{inputNumberSliderBean.accesskey}" delay="#{inputNumberSliderBean.delay}"
disabled="#{inputNumberSliderBean.disabled}" enableManualInput="#{inputNumberSliderBean.enableManualInput}"
inputPosition="#{inputNumberSliderBean.inputPosition}" inputSize="#{inputNumberSliderBean.inputSize}" showArrows="#{inputNumberSliderBean.showArrows}"
showBoundaryValues="#{inputNumberSliderBean.showBoundaryValues}" showInput="#{inputNumberSliderBean.showInput}"
showToolTip="#{inputNumberSliderBean.showToolTip}" maxValue="#{inputNumberSliderBean.maxValue}" minValue="#{inputNumberSliderBean.minValue}"
- step="#{inputNumberSliderBean.step}" />
+ step="#{inputNumberSliderBean.step}" >
+ <f:ajax render="date" />
+ </ins:inputNumberSlider>
<br />
<h:outputText value="Accesskey: "/>
<h:inputText value="#{inputNumberSliderBean.accesskey}">
14 years, 2 months
JBoss Rich Faces SVN: r19367 - in trunk/ui/input/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-09-29 07:19:09 -0400 (Wed, 29 Sep 2010)
New Revision: 19367
Modified:
trunk/ui/input/ui/src/main/config/faces-config.xml
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js
trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml
Log:
RF-9218
Modified: trunk/ui/input/ui/src/main/config/faces-config.xml
===================================================================
--- trunk/ui/input/ui/src/main/config/faces-config.xml 2010-09-29 11:01:54 UTC (rev 19366)
+++ trunk/ui/input/ui/src/main/config/faces-config.xml 2010-09-29 11:19:09 UTC (rev 19367)
@@ -151,6 +151,14 @@
</property-extension>
</property>
<property>
+ <property-name>onchange</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:generate>true</cdk:generate>
+ <cdk:event-name default="true">change</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
<property-name>showArrows</property-name>
<property-class>boolean</property-class>
<default-value>false</default-value>
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js 2010-09-29 11:01:54 UTC (rev 19366)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputNumberSlider.js 2010-09-29 11:19:09 UTC (rev 19367)
@@ -68,20 +68,20 @@
},
decrease: function (event) {
- this.setValue(this.value - this.step);
+ this.setValue(this.value - this.step, event);
},
increase: function (event) {
- this.setValue(this.value + this.step);
+ this.setValue(this.value + this.step, event);
},
- setValue: function (value) {
+ setValue: function (value, event) {
if (!this.disabled) {
- this.__setValue(value);
+ this.__setValue(value, event);
}
},
- __setValue: function (value) {
+ __setValue: function (value, event) {
if (!isNaN(value)) {
value = Math.round(value / this.step) * this.step; //TODO Add normal support of float values. E.g. '0.3' should be instead of '0.30000000000000004'.
if (value > this.maxValue) {
@@ -96,34 +96,37 @@
this.tooltip.text(value);
this.tooltip.setPosition(this.handle,{from: 'LT', offset: [0, -3]}); //TODO Seems offset doesn't work now.
this.value = value;
+ if (this.onchange && (!event || event.type)) {
+ this.onchange.call(this.element[0], event);
+ }
}
}
},
- __inputHandler: function () {
+ __inputHandler: function (event) {
var value = Number(this.input.val());
if (isNaN(value)) {
this.input.val(this.value);
} else {
- this.__setValue(value);
+ this.__setValue(value, event);
}
},
__keydownHandler: function (event) {
if (event.keyCode == 37) { //LEFT
- this.__setValue(Number(this.input.val()) - this.step);
+ this.__setValue(Number(this.input.val()) - this.step, event);
event.preventDefault();
} else if (event.keyCode == 39) { //RIGHT
- this.__setValue(Number(this.input.val()) + this.step);
+ this.__setValue(Number(this.input.val()) + this.step, event);
event.preventDefault();
}
},
__decreaseHandler: function (event) {
var component = this;
- component.decrease();
+ component.decrease(event);
this.intervalId = window.setInterval(function() {
- component.decrease();
+ component.decrease(event);
}, this.delay);
jQuery(document).one("mouseup", true, jQuery.proxy(this.__clearInterval, this));
this.decreaseButton.addClass(this.decreaseSelectedClass);
@@ -132,9 +135,9 @@
__increaseHandler: function (event) {
var component = this;
- component.increase();
+ component.increase(event);
this.intervalId = window.setInterval(function() {
- component.increase();
+ component.increase(event);
}, this.delay);
jQuery(document).one("mouseup",jQuery.proxy(this.__clearInterval, this));
this.increaseButton.addClass(this.increaseSelectedClass);
@@ -163,7 +166,7 @@
__mousemoveHandler: function (event) {
var value = this.range * (event.pageX - this.track.position().left) / (this.track.width()
- this.handle.width()) + this.minValue;
- this.__setValue(value);
+ this.__setValue(value, event);
event.preventDefault();
},
Modified: trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml 2010-09-29 11:01:54 UTC (rev 19366)
+++ trunk/ui/input/ui/src/main/templates/inputnumberslider.template.xml 2010-09-29 11:19:09 UTC (rev 19367)
@@ -68,11 +68,14 @@
<c:if test="#{component.attributes['showToolTip']}">
<span class="rf-insl-tt #{component.attributes['toolTipClass']}">#{getInputValue(facesContext, component)}</span>
</c:if>
+ <!-- TODO Rewrite the next line when the CDK will support normal way to take event handlers from attributes and behaviors. -->
+ <cdk:object name="onchange" type="String" value="#{convertToString(RenderKitUtils.getAttributeAndBehaviorsValue(facesContext, component, RenderKitUtils.attributes().generic('onchange', 'onchange', 'change').first()))}" />
<script type="text/javascript">new RichFaces.ui.InputNumberSlider('#{clientId}', {
delay: #{component.attributes['delay']},
disabled: #{component.attributes['disabled']},
maxValue: #{component.attributes['maxValue']},
minValue: #{component.attributes['minValue']},
+ onchange: #{onchange.length() > 0 ? 'function (event) {' + onchange + '}' : 'null' },
step: #{component.attributes['step']},
tabIndex: #{RenderKitUtils.shouldRenderAttribute(component.attributes['tabindex']) ? component.attributes['tabindex'] : 'null'}
}, {
14 years, 2 months