JBoss Rich Faces SVN: r19565 - in trunk/ui/input/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-10-14 05:58:10 -0400 (Thu, 14 Oct 2010)
New Revision: 19565
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
Log:
implement attachToBody
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2010-10-14 08:33:01 UTC (rev 19564)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2010-10-14 09:58:10 UTC (rev 19565)
@@ -51,6 +51,7 @@
@ResourceDependency(name = "jquery.js"),
@ResourceDependency(name = "jquery.position.js"),
@ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name = "jquery.position.js"),
@ResourceDependency(name = "richfaces-event.js"),
@ResourceDependency(name = "richfaces-base-component.js"),
@ResourceDependency(name = "richfaces-selection.js"),
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-10-14 08:33:01 UTC (rev 19564)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-10-14 09:58:10 UTC (rev 19565)
@@ -4,7 +4,11 @@
rf.ui.InplaceSelect = function(id, options) {
$super.constructor.call(this, id, options)
+
+ options['attachTo'] = id;
+ options['attachToBody'] = true;
this.select = new rf.ui.SelectList(options.listCord, this, options);
+
this.selectItems = options.selectItems;
this.selValueInput = $(document.getElementById(options.selValueInput));
this.openPopup = false;
@@ -45,15 +49,12 @@
this.openPopup = false;
},
- processItem: function(event, element) {
- if(element) {
- var key = $(element).attr("id");
- var value = this.getItemValue(key);
- this.saveItemValue(value);
- var label = this.getItemLabel(key);
- //inplace label
- this.setValue(label);
- }
+ processItem: function(item) {
+ var key = $(item).attr("id");
+ var value = this.getItemValue(key);
+ this.saveItemValue(value);
+ var label = this.getItemLabel(key);
+ this.setValue(label);
this.select.hide();
this.openPopup = false;
@@ -96,19 +97,19 @@
switch(code) {
case rf.KEYS.DOWN:
e.preventDefault();
- this.select.__onKeyDown(e);
+ this.select.__selectNext();
this.__setInputFocus();
break;
case rf.KEYS.UP:
e.preventDefault();
- this.select.__onKeyUp(e);
+ this.select.__selectPrev();
this.__setInputFocus();
break;
case rf.KEYS.RETURN:
e.preventDefault();
- this.select.__onEnter(e);
+ this.select.__selectCurrent();
return false;
break;
}
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js 2010-10-14 08:33:01 UTC (rev 19564)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js 2010-10-14 09:58:10 UTC (rev 19565)
@@ -7,7 +7,10 @@
this.attachToDom(id);
this.popup = $(document.getElementById(id));
- this.visible = options.visible;;
+ this.visible = options.visible;
+ this.attachTo = options.attachTo;
+ this.attachToBody = options.attachToBody;
+
this.popup.bind("mouseover", $.proxy(this.__onMouseOver, this));
this.popup.bind("click", $.proxy(this.__onClick, this));
};
@@ -22,15 +25,25 @@
name : "popup",
show: function() {
- this.popup.css('display', '');
- //add attachToBody logic
- this.visible = true;
+ if(!this.visible) {
+ if(this.attachToBody) {
+ this.parentElement = this.popup.parent();
+ this.popup.detach().appendTo("body");
+ }
+ this.popup.setPosition({id: this.attachTo}, {type:"DROPDOWN", offset:[0,20]}).show();
+ this.visible = true;
+ }
},
hide: function() {
- this.popup.css('display', 'none');
- //add attachToBody logic
- this.visible = false;
+ if(this.visible) {
+ this.popup.hide();
+ this.visible = false;
+ if (this.attachToBody && this.parentElement) {
+ this.popup.detach().appendTo(this.parentElement);
+ this.parentElement = null;
+ }
+ }
},
isVisible: function() {
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2010-10-14 08:33:01 UTC (rev 19564)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2010-10-14 09:58:10 UTC (rev 19565)
@@ -4,7 +4,9 @@
var INTERFACE = {
SelectListener : {
- processItem: function(e, element){}
+ processItem: function(item){},
+ selectItem: function(item){},
+ unselectItem: function(item){}
}
};
@@ -13,8 +15,7 @@
this.selectListener = listener;
this.selectItemCss = options.selectItemCss;
this.itemCss = options.itemCss;
-
- //TODO: from option map?
+
this.index = -1;
this.__updateItemsList();
};
@@ -23,26 +24,34 @@
var $super = rf.ui.PopupList.$super;
$.extend(rf.ui.PopupList.prototype, ( function () {
-
- var isSelectListener = function(obj) {
- for (var method in INTERFACE.SelectListener) {
- if ( (typeof obj[method] != typeof INTERFACE.SelectListener[method]) ) {
- return false;
- }
- }
- return true;
- };
return{
name : "popupList",
-
- processItem: function(e, element) {
- if(isSelectListener(this.selectListener)) {
- this.selectListener.processItem(e, element);
+
+
+ processItem: function(item) {
+ if(this.selectListener.processItem && typeof this.selectListener.processItem == 'function') {
+ this.selectListener.processItem(item);
}
},
+ selectItem: function(item) {
+ if(this.selectListener.selectItem && typeof this.selectListener.selectItem == 'function') {
+ this.selectListener.selectItem(item);
+ } else {
+ item.addClass(this.selectItemCss);
+ }
+ },
+
+ unselectItem: function(item) {
+ if(this.selectListener.unselectItem && typeof this.selectListener.unselectItem == 'function') {
+ this.selectListener.unselectItem(item);
+ } else {
+ item.removeClass(this.selectItemCss);
+ }
+ },
+
__updateItemsList: function () {
this.items = this.popup.find("."+this.itemCss);
},
@@ -58,7 +67,7 @@
var item;
if (this.index != -1) {
item = this.items.eq(this.index);
- this.__unSelectItem(item);
+ this.unselectItem(item);
}
if (index==undefined) {
@@ -83,33 +92,22 @@
}
item = this.items.eq(this.index);
- this.__selectItem(item);
+ this.selectItem(item);
},
- __selectItem: function(item) {
- item.addClass(this.selectItemCss);
- },
-
- __unSelectItem: function(item) {
- item.removeClass(this.selectItemCss);
- },
-
- //remove event, rename ???
- __onEnter: function(e) {
+ __selectCurrent: function() {
var item;
- if(this.items) {
+ if(this.items && this.index >= 0) {
item = this.items.eq(this.index);
- this.processItem(e, item);
+ this.processItem(item);
}
},
- //remove event, rename
- __onKeyUp: function(e) {
+ __selectPrev: function() {
this.__selectByIndex(-1, true);
},
- //remove event, rename
- __onKeyDown: function(e) {
+ __selectNext: function() {
this.__selectByIndex(1, true);
},
@@ -122,7 +120,7 @@
__onClick: function(e) {
var item = this.__getItem(e);
- this.processItem(e, item);
+ this.processItem(item);
this.__select(item);
},
13 years, 8 months
JBoss Rich Faces SVN: r19564 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: a4jActionListener and 22 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-10-14 04:33:01 -0400 (Thu, 14 Oct 2010)
New Revision: 19564
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerConsoleStatusTestListener.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerProperties.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerSeleniumLoggingTestListener.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerTestInfo.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jActionListener/TestA4JActionListener.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestCommand.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestSelectMany.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestSelectOne.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestTextInput.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/TestHSelectBooleanCheckbox.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/TestHSelectManyCheckbox.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/TestHSelectOneRadio.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAttachQueue/AttachQueueAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAttachQueue/TestNestedAttachQueue.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jCommandButton/TestA4JCommandButton.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jCommandLink/TestA4JCommandLink.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jJSFunction/TestJSFunctionSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/IntervalAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/AbstractPushTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/PushAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestCounter.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestInterval.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/QueueAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/QueueModel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/TestFormQueue.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/TestGlobalQueue.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRegion/NestedRegionModel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRegion/TestNestedRegion.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/RepeatAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/SimpleModel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestMatrix.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/AbstracStatusTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestFacets.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestInstantAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestReferencedUsage.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Inject.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/IssueTracking.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Templates.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Use.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Uses.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/hCommandButton/TestHCommandButton.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/AbstractModel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/AssertingDataScroller.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataGrid.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataScroller.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataTable.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richComponentControl/ComponentControlDataScroller.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richComponentControl/TestDataScroller.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractDataGridTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractScrollerTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestScrollerInTableFooter.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestScrollerOutsideTable.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/AbstractScrollerTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/PaginationTester.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestScrollerInTableFooter.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestScrollerOutsideTable.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestScroller.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/RichJQueryAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/TestSimple.java
Log:
* keyword "Revision" added to the properties of all Java files
* tests fixed to work with new version of boolean attributes
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -35,8 +35,6 @@
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
import static org.richfaces.tests.metamer.ftest.AbstractMetamerTest.pjq;
import static org.jboss.test.selenium.locator.reference.ReferencedLocator.referenceInferred;
-import static org.jboss.test.selenium.waiting.WaitFactory.waitGui;
-import static org.jboss.test.selenium.waiting.WaitFactory.elementPresent;
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
@@ -45,10 +43,9 @@
public class AbstractComponentAttributes {
protected AjaxSelenium selenium = AjaxSeleniumProxy.getInstance();
-
LocatorReference<ExtendedLocator<JQueryLocator>> root = new LocatorReference<ExtendedLocator<JQueryLocator>>(
- pjq(""));
- ReferencedLocator<JQueryLocator> propertyLocator = referenceInferred(root, "input[id$={0}Input]");
+ pjq(""));
+ ReferencedLocator<JQueryLocator> propertyLocator = referenceInferred(root, "input[id*={0}Input]{1}");
public AbstractComponentAttributes() {
}
@@ -63,10 +60,15 @@
}
protected void setProperty(String propertyName, Object value) {
- final ElementLocator<?> locator = propertyLocator.format(propertyName);
+ ElementLocator<?> locator = propertyLocator.format(propertyName);
final AttributeLocator<?> typeLocator = locator.getAttribute(Attribute.TYPE);
- String inputType = selenium.getAttribute(typeLocator);
+ String inputType = null;
+ if (selenium.getCount(propertyLocator.format(propertyName)) > 1) {
+ inputType = "radio";
+ } else {
+ inputType = selenium.getAttribute(typeLocator);
+ }
if (value == null) {
value = "";
@@ -77,8 +79,10 @@
applyText(locator, valueAsString);
} else if ("checkbox".equals(inputType)) {
boolean checked = Boolean.valueOf(valueAsString);
-
applyCheckbox(locator, checked);
+ } else if ("radio".equals(inputType)) {
+ locator = propertyLocator.format(propertyName, "[value=" + ("".equals(value) ? "null" : value) + "]");
+ guardHttp(selenium).click(locator);
}
}
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractComponentAttributes.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MatrixConfigurator.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerConsoleStatusTestListener.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerFailureLoggingTestListener.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerProperties.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerSeleniumLoggingTestListener.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/MetamerTestInfo.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jActionListener/TestA4JActionListener.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestCommand.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestCommand.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestCommand.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -57,7 +57,7 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=bypassUpdatesInput]"));
+ selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
selenium.waitForPageToLoad();
selenium.type(input, "RichFaces 4");
@@ -91,7 +91,7 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=immediateInput]"));
+ selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
selenium.type(input, "RichFaces 4");
@@ -107,9 +107,9 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=bypassUpdatesInput]"));
+ selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
selenium.waitForPageToLoad();
- selenium.click(pjq("input[type=checkbox][id$=immediateInput]"));
+ selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
selenium.type(input, "RichFaces 4");
@@ -121,7 +121,7 @@
}
public void testLimitRender(JQueryLocator command) {
- selenium.click(pjq("input[type=checkbox][id$=limitRenderInput]"));
+ selenium.click(pjq("input[type=radio][name$=limitRenderInput][value=true]"));
selenium.waitForPageToLoad();
JQueryLocator time = jq("span[id$=requestTime]");
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestSelectMany.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestSelectMany.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestSelectMany.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -57,7 +57,7 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=bypassUpdatesInput]"));
+ selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
selenium.waitForPageToLoad();
guardXhr(selenium).addSelection(input, optionValue("Audi"));
@@ -89,7 +89,7 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=immediateInput]"));
+ selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
guardXhr(selenium).addSelection(input, optionValue("Audi"));
@@ -104,9 +104,9 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=bypassUpdatesInput]"));
+ selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
selenium.waitForPageToLoad();
- selenium.click(pjq("input[type=checkbox][id$=immediateInput]"));
+ selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
guardXhr(selenium).addSelection(input, optionValue("Audi"));
@@ -117,7 +117,7 @@
}
public void testLimitRender(JQueryLocator input) {
- selenium.click(pjq("input[type=checkbox][id$=limitRenderInput]"));
+ selenium.click(pjq("input[type=radio][name$=limitRenderInput][value=true]"));
selenium.waitForPageToLoad();
JQueryLocator time = jq("span[id$=requestTime]");
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestSelectOne.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestSelectOne.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestSelectOne.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -57,7 +57,7 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=bypassUpdatesInput]"));
+ selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
selenium.waitForPageToLoad();
guardXhr(selenium).select(input, optionValue("Audi"));
@@ -89,7 +89,7 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=immediateInput]"));
+ selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
guardXhr(selenium).select(input, optionValue("Audi"));
@@ -104,9 +104,9 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=bypassUpdatesInput]"));
+ selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
selenium.waitForPageToLoad();
- selenium.click(pjq("input[type=checkbox][id$=immediateInput]"));
+ selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
guardXhr(selenium).select(input, optionValue("Audi"));
@@ -117,7 +117,7 @@
}
public void testLimitRender(JQueryLocator input) {
- selenium.click(pjq("input[type=checkbox][id$=limitRenderInput]"));
+ selenium.click(pjq("input[type=radio][name$=limitRenderInput][value=true]"));
selenium.waitForPageToLoad();
JQueryLocator time = jq("span[id$=requestTime]");
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestTextInput.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestTextInput.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/AbstractTestTextInput.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -63,7 +63,7 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=bypassUpdatesInput]"));
+ selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
selenium.waitForPageToLoad();
typeToInput(input, "RichFaces 4");
@@ -95,7 +95,7 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=immediateInput]"));
+ selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
typeToInput(input, "RichFaces 4");
@@ -110,9 +110,9 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=bypassUpdatesInput]"));
+ selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
selenium.waitForPageToLoad();
- selenium.click(pjq("input[type=checkbox][id$=immediateInput]"));
+ selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
typeToInput(input, "RichFaces 4");
@@ -123,7 +123,7 @@
}
public void testLimitRender(JQueryLocator input) {
- selenium.click(pjq("input[type=checkbox][id$=limitRenderInput]"));
+ selenium.click(pjq("input[type=radio][name$=limitRenderInput][value=true]"));
selenium.waitForPageToLoad();
JQueryLocator time = jq("span[id$=requestTime]");
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/TestHSelectBooleanCheckbox.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/TestHSelectBooleanCheckbox.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/TestHSelectBooleanCheckbox.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -68,7 +68,7 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=bypassUpdatesInput]"));
+ selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
selenium.waitForPageToLoad();
guardXhr(selenium).click(input);
@@ -102,7 +102,7 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=immediateInput]"));
+ selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
guardXhr(selenium).click(input);
@@ -118,9 +118,9 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=bypassUpdatesInput]"));
+ selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
selenium.waitForPageToLoad();
- selenium.click(pjq("input[type=checkbox][id$=immediateInput]"));
+ selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
guardXhr(selenium).click(input);
@@ -132,7 +132,7 @@
@Test
public void testLimitRender() {
- selenium.click(pjq("input[type=checkbox][id$=limitRenderInput]"));
+ selenium.click(pjq("input[type=radio][name$=limitRenderInput][value=true]"));
selenium.waitForPageToLoad();
JQueryLocator time = jq("span[id$=requestTime]");
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/TestHSelectManyCheckbox.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/TestHSelectManyCheckbox.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/TestHSelectManyCheckbox.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -68,7 +68,7 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=bypassUpdatesInput]"));
+ selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
selenium.waitForPageToLoad();
guardXhr(selenium).click(input);
@@ -102,7 +102,7 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=immediateInput]"));
+ selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
guardXhr(selenium).click(input);
@@ -118,9 +118,9 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=bypassUpdatesInput]"));
+ selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
selenium.waitForPageToLoad();
- selenium.click(pjq("input[type=checkbox][id$=immediateInput]"));
+ selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
guardXhr(selenium).click(input);
@@ -132,7 +132,7 @@
@Test
public void testLimitRender() {
- selenium.click(pjq("input[type=checkbox][id$=limitRenderInput]"));
+ selenium.click(pjq("input[type=radio][name$=limitRenderInput][value=true]"));
selenium.waitForPageToLoad();
JQueryLocator time = jq("span[id$=requestTime]");
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/TestHSelectOneRadio.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/TestHSelectOneRadio.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAjax/TestHSelectOneRadio.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -66,7 +66,7 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=bypassUpdatesInput]"));
+ selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
selenium.waitForPageToLoad();
guardXhr(selenium).click(input);
@@ -100,7 +100,7 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=immediateInput]"));
+ selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
guardXhr(selenium).click(input);
@@ -116,9 +116,9 @@
JQueryLocator time = jq("span[id$=requestTime]");
String timeValue = selenium.getText(time);
- selenium.click(pjq("input[type=checkbox][id$=bypassUpdatesInput]"));
+ selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
selenium.waitForPageToLoad();
- selenium.click(pjq("input[type=checkbox][id$=immediateInput]"));
+ selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
guardXhr(selenium).click(input);
@@ -130,7 +130,7 @@
@Test
public void testLimitRender() {
- selenium.click(pjq("input[type=checkbox][id$=limitRenderInput]"));
+ selenium.click(pjq("input[type=radio][name$=limitRenderInput][value=true]"));
selenium.waitForPageToLoad();
JQueryLocator time = jq("span[id$=requestTime]");
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAttachQueue/AttachQueueAttributes.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAttachQueue/TestNestedAttachQueue.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAttachQueue/TestNestedAttachQueue.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAttachQueue/TestNestedAttachQueue.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -21,24 +21,16 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.a4jAttachQueue;
-import static org.jboss.test.selenium.dom.Event.KEYPRESS;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
-import static org.jboss.test.selenium.utils.text.SimplifiedFormat.format;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
import java.net.URL;
import org.jboss.cheiron.halt.XHRHalter;
-import org.jboss.cheiron.halt.XHRState;
-import org.jboss.test.selenium.waiting.retrievers.Retriever;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.a4jQueue.QueueAttributes;
import org.richfaces.tests.metamer.ftest.a4jQueue.QueueModel;
import org.richfaces.tests.metamer.ftest.a4jQueue.QueueModel.Input;
-import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
-import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jAttachQueue/TestNestedAttachQueue.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jCommandButton/TestA4JCommandButton.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jCommandButton/TestA4JCommandButton.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jCommandButton/TestA4JCommandButton.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -157,10 +157,10 @@
@Test
public void testDisabled() {
- JQueryLocator disabledChecbox = pjq("input[id$=disabledInput]");
+ JQueryLocator disabledCheckbox = pjq("input[type=radio][name$=disabledInput][value=true]");
AttributeLocator<?> disabledAttribute = button.getAttribute(new Attribute("disabled"));
- selenium.click(disabledChecbox);
+ selenium.click(disabledCheckbox);
selenium.waitForPageToLoad(TIMEOUT);
String isDisabled = selenium.getAttribute(disabledAttribute);
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jCommandButton/TestA4JCommandButton.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jCommandLink/TestA4JCommandLink.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jCommandLink/TestA4JCommandLink.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jCommandLink/TestA4JCommandLink.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -157,10 +157,10 @@
@Test
public void testDisabled() {
- JQueryLocator disabledChecbox = pjq("input[id$=disabledInput]");
+ JQueryLocator disabledCheckbox = pjq("input[type=radio][name$=disabledInput][value=true]");
JQueryLocator newLink = pjq("span[id$=a4jCommandLink]");
- selenium.click(disabledChecbox);
+ selenium.click(disabledCheckbox);
selenium.waitForPageToLoad(TIMEOUT);
assertFalse(selenium.isElementPresent(link), link.getAsString()
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jCommandLink/TestA4JCommandLink.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jJSFunction/TestJSFunctionSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jJSFunction/TestJSFunctionSimple.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jJSFunction/TestJSFunctionSimple.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -127,7 +127,7 @@
public void testBypassUpdates() {
String time1Value = selenium.getText(time1);
- JQueryLocator input = pjq("input[type=checkbox][id$=bypassUpdatesInput]");
+ JQueryLocator input = pjq("input[type=radio][name$=bypassUpdatesInput][value=true]");
selenium.click(input);
selenium.waitForPageToLoad();
@@ -145,7 +145,7 @@
public void testImmediate() {
String time1Value = selenium.getText(time1);
- JQueryLocator input = pjq("input[type=checkbox][id$=immediateInput]");
+ JQueryLocator input = pjq("input[type=radio][name$=immediateInput][value=true]");
selenium.click(input);
selenium.waitForPageToLoad();
@@ -158,7 +158,7 @@
@Test
public void testLimitRender() {
// set limitRender=true
- JQueryLocator limitRenderInput = pjq("input[type=checkbox][id$=limitRenderInput]");
+ JQueryLocator limitRenderInput = pjq("input[type=radio][name$=limitRenderInput][value=true]");
selenium.click(limitRenderInput);
selenium.waitForPageToLoad();
@@ -233,7 +233,7 @@
@Test
public void testRendered() {
- selenium.click(pjq("input[type=checkbox][id$=renderedInput]"));
+ selenium.click(pjq("input[type=radio][name$=renderedInput][value=false]"));
selenium.waitForPageToLoad();
// get all values
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -104,7 +104,7 @@
@Test
public void testRendered() {
- JQueryLocator renderedInput = pjq("input[id$=renderedInput]");
+ JQueryLocator renderedInput = pjq("input[type=radio][name$=renderedInput][value=false]");
selenium.click(renderedInput);
selenium.waitForPageToLoad(TIMEOUT);
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jLog/TestA4JLog.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -109,10 +109,10 @@
@Test
public void testAjaxRendered() {
- JQueryLocator ajaxRenderedCheckbox = pjq("input[id$=ajaxRenderedInput]");
+ JQueryLocator ajaxRenderedInput = pjq("input[type=radio][name$=ajaxRenderedInput][value=false]");
JQueryLocator reRenderAllImage = jq("div.header img[id$=reRenderAllImage]");
- selenium.click(ajaxRenderedCheckbox);
+ selenium.click(ajaxRenderedInput);
selenium.waitForPageToLoad(TIMEOUT);
selenium.click(increaseCounterButton);
@@ -198,16 +198,17 @@
@Test
public void testRendered() {
- JQueryLocator renderedInput = pjq("input[id$=renderedInput]");
+ JQueryLocator renderedInputFalse = pjq("input[type=radio][name$=renderedInput][value=false]");
+ JQueryLocator renderedInputTrue = pjq("input[type=radio][name$=renderedInput][value=true]");
- selenium.click(renderedInput);
+ selenium.click(renderedInputFalse);
selenium.waitForPageToLoad(TIMEOUT);
assertFalse(selenium.isElementPresent(outputDiv), "Panel should not be rendered.");
selenium.click(increaseCounterButton);
selenium.click(increaseCounterButton);
- selenium.click(renderedInput);
+ selenium.click(renderedInputTrue);
selenium.waitForPageToLoad(TIMEOUT);
assertTrue(selenium.isElementPresent(outputDiv), "Panel should be rendered.");
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/IntervalAttributes.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -25,10 +25,8 @@
import java.net.URL;
import org.apache.commons.httpclient.HttpException;
-import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.locator.Attribute;
import org.jboss.test.selenium.locator.AttributeLocator;
-import org.jboss.test.selenium.locator.IdLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
@@ -38,11 +36,9 @@
import org.testng.annotations.Test;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
-import static org.jboss.test.selenium.locator.LocatorFactory.*;
import static org.testng.Assert.*;
import static org.jboss.test.selenium.utils.text.SimplifiedFormat.format;
import static org.jboss.test.selenium.utils.PrimitiveUtils.*;
-import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.*;
/**
* Tests the a4j:poll component.
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/AbstractPushTest.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/PushAttributes.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestCounter.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPush/TestInterval.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/QueueAttributes.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/QueueModel.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/TestFormQueue.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jQueue/TestGlobalQueue.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRegion/NestedRegionModel.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRegion/TestNestedRegion.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/RepeatAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/RepeatAttributes.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/RepeatAttributes.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -42,7 +42,7 @@
setProperty("first", first);
}
- public void setRendered(boolean rendered) {
+ public void setRendered(String rendered) {
setProperty("rendered", rendered);
}
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/RepeatAttributes.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/SimpleModel.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestMatrix.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -76,7 +76,7 @@
@Test
public void testRenderedAttribute() {
- attributes.setRendered(false);
+ attributes.setRendered("false");
assertEquals(model.isRendered(), false);
}
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jRepeat/TestSimple.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/AbstracStatusTest.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusAttributes.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/StatusFacets.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestFacets.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestInstantAttributes.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestReferencedUsage.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jStatus/TestSimple.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Inject.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/IssueTracking.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Templates.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Use.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/annotations/Uses.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/hCommandButton/TestHCommandButton.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/hCommandButton/TestHCommandButton.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/hCommandButton/TestHCommandButton.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -156,7 +156,7 @@
@Test
public void testDisabled() {
- JQueryLocator disabledChecbox = pjq("input[id$=disabledInput]");
+ JQueryLocator disabledChecbox = pjq("input[type=radio][name$=disabledInput][value=true]");
AttributeLocator<?> disabledAttribute = button.getAttribute(new Attribute("disabled"));
selenium.click(disabledChecbox);
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/hCommandButton/TestHCommandButton.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/AbstractModel.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/AssertingDataScroller.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataGrid.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataScroller.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/model/DataTable.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richAccordion/TestRichAccordion.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -130,7 +130,7 @@
@Test
public void testBypassUpdates() {
- JQueryLocator input = pjq("input[type=checkbox][id$=bypassUpdatesInput]");
+ JQueryLocator input = pjq("input[type=radio][name$=bypassUpdatesInput][value=true]");
selenium.click(input);
selenium.waitForPageToLoad();
@@ -153,7 +153,7 @@
result = selenium.getEval(new JavaScript("window.RichFaces.$('" + accordionId + "').prevItem('item1')"));
assertEquals(result, "null", "Result of function prevItem('item1')");
- JQueryLocator input = pjq("input[type=checkbox][id$=cycledSwitchingInput]");
+ JQueryLocator input = pjq("input[type=radio][name$=cycledSwitchingInput][value=true]");
selenium.click(input);
selenium.waitForPageToLoad();
@@ -209,7 +209,7 @@
@Test
public void testImmediate() {
- JQueryLocator input = pjq("input[type=checkbox][id$=immediateInput]");
+ JQueryLocator input = pjq("input[type=radio][name$=immediateInput][value=true]");
selenium.click(input);
selenium.waitForPageToLoad();
@@ -319,7 +319,7 @@
@Test
public void testRendered() {
- JQueryLocator input = pjq("input[type=checkbox][id$=renderedInput]");
+ JQueryLocator input = pjq("input[type=radio][name$=renderedInput][value=false]");
selenium.click(input);
selenium.waitForPageToLoad();
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richComponentControl/ComponentControlDataScroller.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richComponentControl/TestDataScroller.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractDataGridTest.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractScrollerTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractScrollerTest.java 2010-10-13 23:44:25 UTC (rev 19563)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractScrollerTest.java 2010-10-14 08:33:01 UTC (rev 19564)
@@ -29,11 +29,9 @@
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.Use;
-import org.richfaces.tests.metamer.ftest.annotations.Uses;
import org.richfaces.tests.metamer.ftest.model.DataScroller;
import org.richfaces.tests.metamer.ftest.richDataScroller.PaginationTester;
import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/AbstractScrollerTest.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestScrollerInTableFooter.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestScrollerOutsideTable.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataGrid/TestSimple.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/AbstractScrollerTest.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/PaginationTester.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestScrollerInTableFooter.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richDataScroller/TestScrollerOutsideTable.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richExtendedDataTable/TestScroller.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/RichJQueryAttributes.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richJQuery/TestSimple.java
___________________________________________________________________
Name: svn:keywords
+ Revision
13 years, 8 months
JBoss Rich Faces SVN: r19563 - in branches/RF-8742/ui/validator: ui/src/main/java/org/richfaces/component/behavior and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-10-13 19:44:25 -0400 (Wed, 13 Oct 2010)
New Revision: 19563
Added:
branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/ValidatorLookup.java
branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/AjaxBehaviorWrapper.java
branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetConverterTest.java
branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetValidatorTest.java
branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java
branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/GetScriptTest.java
Removed:
branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/ClientValidatorBehaviorTest.java
Modified:
branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorBehavior.java
branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorImpl.java
Log:
OPEN - issue RF-9506: ClientValidatorBehavior unit tests and implementation.
https://jira.jboss.org/browse/RF-9506
Added: branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/ValidatorLookup.java
===================================================================
--- branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/ValidatorLookup.java (rev 0)
+++ branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/ValidatorLookup.java 2010-10-13 23:44:25 UTC (rev 19563)
@@ -0,0 +1,25 @@
+package org.richfaces.validator;
+
+import java.util.Collection;
+
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+import javax.validation.metadata.ConstraintDescriptor;
+
+/**
+ * <p class="changed_added_4_0">This interface describes service that gets Bean Validator constrains for EL-expressions</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public interface ValidatorLookup {
+
+ /**
+ * <p class="changed_added_4_0">Get all constrains for given EL-expression</p>
+ * @param context
+ * @param expression
+ * @return
+ */
+ Iterable<ConstraintDescriptor<?>> getConstrains(FacesContext context, ValueExpression expression);
+
+ Collection<String> validateExpression(FacesContext context,ValueExpression expression, Object newValue);
+}
Property changes on: branches/RF-8742/ui/validator/api/src/main/java/org/richfaces/validator/ValidatorLookup.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/AjaxBehaviorWrapper.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/AjaxBehaviorWrapper.java (rev 0)
+++ branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/AjaxBehaviorWrapper.java 2010-10-13 23:44:25 UTC (rev 19563)
@@ -0,0 +1,17 @@
+package org.richfaces.component.behavior;
+
+import javax.faces.component.behavior.ClientBehaviorBase;
+import javax.faces.component.behavior.ClientBehaviorContext;
+
+public class AjaxBehaviorWrapper extends ClientBehaviorBase {
+
+ public AjaxBehaviorWrapper() {
+ super();
+ }
+
+ public String getAjaxScript(ClientBehaviorContext context) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
\ No newline at end of file
Property changes on: branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/AjaxBehaviorWrapper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorBehavior.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorBehavior.java 2010-10-13 22:25:05 UTC (rev 19562)
+++ branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorBehavior.java 2010-10-13 23:44:25 UTC (rev 19563)
@@ -2,32 +2,33 @@
import java.util.Collection;
-import javax.faces.component.UIMessage;
import javax.faces.component.behavior.ClientBehavior;
import javax.faces.component.behavior.ClientBehaviorContext;
import javax.faces.convert.Converter;
+/**
+ * <p class="changed_added_4_0">Interface for JSF Behavior that creates scripts for client-side validation</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
public interface ClientValidatorBehavior extends ClientBehavior {
+
+ public static final String BEHAVIOR_TYPE = "org.richfaces.behavior.ClientValidator";
+
/**
- * <p class="changed_added_4_0">
- * This method looks up all {@link UIMessage} components associated with input for which this behavior belongs to
- * </p>
- *
+ * <p class="changed_added_4_0">Get JavaScript code for AJAX request.</p>
* @param context
- * @return non-null collection of {@link UIMessage} components associated with target input.
- * @throws MessageNotFoundException
- * if no {@link UIMessage} component points to target UIInput and no UIMessages found on page.
+ * @return
*/
- Collection<UIMessage> findMessages(ClientBehaviorContext context) throws MessageNotFoundException;
-
+ String getAjaxScript(ClientBehaviorContext context);
/**
* <p class="changed_added_4_0">
* Look up for converter associated with target UIInput
* </p>
*
* @param context
- * @return
+ * @return {@link Converter} instance or null if conversion not required.
*/
Converter getConverter(ClientBehaviorContext context) throws ConverterNotFoundException;
Modified: branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorImpl.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorImpl.java 2010-10-13 22:25:05 UTC (rev 19562)
+++ branches/RF-8742/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorImpl.java 2010-10-13 23:44:25 UTC (rev 19563)
@@ -28,8 +28,7 @@
import javax.faces.FacesException;
import javax.faces.component.ActionSource;
import javax.faces.component.EditableValueHolder;
-import javax.faces.component.UIMessage;
-import javax.faces.component.behavior.ClientBehaviorBase;
+import javax.faces.component.behavior.AjaxBehavior;
import javax.faces.component.behavior.ClientBehaviorContext;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
@@ -48,11 +47,11 @@
* @author asmirnov(a)exadel.com
*
*/
-public class ClientValidatorImpl extends ClientBehaviorBase implements ClientValidatorBehavior {
+public class ClientValidatorImpl extends AjaxBehaviorWrapper implements ClientValidatorBehavior {
- public static final String BEHAVIOR_TYPE = "org.richfaces.behavior.ClientValidator";
-
private static final Logger LOG = RichfacesLogger.COMPONENTS.getLogger();
+
+ private AjaxBehavior ajaxBehavior;
@Override
public String getScript(ClientBehaviorContext behaviorContext) {
@@ -101,15 +100,6 @@
return renderer;
}
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.component.behavior.ClientValidatorBehavior#findMessages(javax.faces.component.behavior.
- * ClientBehaviorContext)
- */
- public Collection<UIMessage> findMessages(ClientBehaviorContext context) throws MessageNotFoundException {
- return Collections.emptySet();
- }
/*
* (non-Javadoc)
Copied: branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetConverterTest.java (from rev 19557, branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/ClientValidatorBehaviorTest.java)
===================================================================
--- branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetConverterTest.java (rev 0)
+++ branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetConverterTest.java 2010-10-13 23:44:25 UTC (rev 19563)
@@ -0,0 +1,82 @@
+package org.richfaces.component.behavior;
+import static org.easymock.EasyMock.*;
+import static org.junit.Assert.*;
+
+import javax.faces.convert.Converter;
+import javax.faces.convert.NumberConverter;
+
+import org.jboss.test.faces.mock.Mock;
+import org.jboss.test.faces.mock.MockTestRunner;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+/**
+ * <p class="changed_added_4_0">This class tests client validator behavior.
+ * as it described at https://community.jboss.org/wiki/ClientSideValidation # Server-side rendering algorithm</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+(a)RunWith(MockTestRunner.class)
+public class BehaviorGetConverterTest extends BehaviorTestBase {
+
+
+ @Mock
+ private Converter converter;
+
+ /**
+ * <p class="changed_added_4_0">Server-side rendering algorithm .3 - determine client-side converter</p>
+ * @throws Exception
+ */
+ @Test
+ public void testGetClientConverterFromComponent() throws Exception {
+ NumberConverter converter = new NumberConverter();
+ expect(input.getConverter()).andReturn(converter);
+ checkConverter(converter);
+ }
+
+ /**
+ * <p class="changed_added_4_0">Server-side rendering algorithm .3 - determine client-side converter</p>
+ * @throws Exception
+ */
+ @Test
+ public void testGetClientConverterByType() throws Exception {
+ setupConverterFromApplication(converter);
+ checkConverter(converter);
+ }
+
+ private void setupConverterFromApplication(Converter converter) {
+ expect(input.getConverter()).andReturn(null);
+ expect(input.getValueExpression("value")).andReturn(expression);
+ expect((Class)(expression.getType(environment.getElContext()))).andReturn(Number.class);
+ expect(environment.getApplication().createConverter(Number.class)).andReturn(converter);
+ }
+
+ @Test(expected=ConverterNotFoundException.class)
+ public void testGetConverterNotExists() throws Exception {
+ setupConverterFromApplication(null);
+ checkConverter(null);
+ }
+
+ @Test
+ public void testSetConverterForString() throws Exception {
+ expect(input.getConverter()).andReturn(null);
+ expect(input.getValueExpression("value")).andReturn(expression);
+ expect((Class)(expression.getType(environment.getElContext()))).andReturn(String.class);
+ checkConverter(null);
+ }
+
+ private void checkConverter(Converter converter) throws ConverterNotFoundException {
+ setupBehaviorContext(input);
+ controller.replay();
+ Converter converter2 = behavior.getConverter(behaviorContext);
+ controller.verify();
+ if(null == converter){
+ assertNull(converter2);
+ } else {
+ assertSame(converter,converter2);
+ }
+ }
+
+
+}
Added: branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetValidatorTest.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetValidatorTest.java (rev 0)
+++ branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetValidatorTest.java 2010-10-13 23:44:25 UTC (rev 19563)
@@ -0,0 +1,51 @@
+package org.richfaces.component.behavior;
+import javax.faces.validator.Validator;
+
+import org.jboss.test.faces.mock.Mock;
+import org.jboss.test.faces.mock.MockTestRunner;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+/**
+ * <p class="changed_added_4_0">This class tests client validator behavior.
+ * as it described at https://community.jboss.org/wiki/ClientSideValidation # Server-side rendering algorithm</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+(a)RunWith(MockTestRunner.class)
+public class BehaviorGetValidatorTest extends BehaviorTestBase {
+
+
+ @Mock
+ private Validator validator;
+ /**
+ * <p class="changed_added_4_0">Component does not define any validators.</p>
+ * @throws Exception
+ */
+ @Test
+ public void testEmptyValidators() throws Exception {
+ setupComponentValidator(null);
+ setupBeanValidator(null);
+ checkValidator();
+ }
+
+ private void setupComponentValidator(Validator validator) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * <p class="changed_added_4_0">Component defines JSF validator only.</p>
+ * @throws Exception
+ */
+ @Test
+ public void testComponentValidator() throws Exception {
+
+ }
+
+ @Test
+ public void testBeanValidators() throws Exception {
+
+ }
+}
Property changes on: branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorGetValidatorTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java (rev 0)
+++ branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java 2010-10-13 23:44:25 UTC (rev 19563)
@@ -0,0 +1,53 @@
+package org.richfaces.component.behavior;
+
+import static org.easymock.EasyMock.*;
+
+import javax.el.ValueExpression;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIInput;
+import javax.faces.component.behavior.ClientBehaviorContext;
+import javax.faces.render.ClientBehaviorRenderer;
+
+import org.jboss.test.faces.mock.Environment;
+import org.jboss.test.faces.mock.Environment.Feature;
+import org.jboss.test.faces.mock.Mock;
+import org.jboss.test.faces.mock.MockController;
+import org.jboss.test.faces.mock.MockFacesEnvironment;
+import org.junit.Before;
+
+public class BehaviorTestBase {
+
+ @Mock()
+ @Environment({ Feature.APPLICATION, Feature.RENDER_KIT })
+ protected MockFacesEnvironment environment;
+ @Mock
+ protected UIInput input;
+ @Mock
+ protected ClientBehaviorContext behaviorContext;
+ @Mock
+ protected ClientBehaviorRenderer behaviorRenderer;
+ protected MockController controller;
+ protected ClientValidatorImpl behavior;
+ @Mock
+ protected ValueExpression expression;
+
+ public BehaviorTestBase() {
+ super();
+ }
+
+ @Before
+ public void setUp() {
+ behavior = createBehavior();
+ }
+
+ protected ClientBehaviorContext setupBehaviorContext(UIComponent component) {
+ expect(behaviorContext.getComponent()).andStubReturn(component);
+ expect(behaviorContext.getFacesContext()).andStubReturn(environment.getFacesContext());
+ return behaviorContext;
+ }
+
+ private ClientValidatorImpl createBehavior() {
+ return new ClientValidatorImpl();
+ }
+
+}
\ No newline at end of file
Property changes on: branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/ClientValidatorBehaviorTest.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/ClientValidatorBehaviorTest.java 2010-10-13 22:25:05 UTC (rev 19562)
+++ branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/ClientValidatorBehaviorTest.java 2010-10-13 23:44:25 UTC (rev 19563)
@@ -1,178 +0,0 @@
-package org.richfaces.component.behavior;
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIInput;
-import javax.faces.component.UIOutput;
-import javax.faces.component.UIViewRoot;
-import javax.faces.component.behavior.ClientBehaviorContext;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-
-import org.jboss.test.faces.mock.Environment;
-import org.jboss.test.faces.mock.Environment.Feature;
-import org.jboss.test.faces.mock.Mock;
-import org.jboss.test.faces.mock.MockController;
-import org.jboss.test.faces.mock.MockFacesEnvironment;
-import org.jboss.test.faces.mock.MockTestRunner;
-import org.jboss.test.faces.mock.Stub;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.richfaces.component.mock.MockUIForm;
-import org.richfaces.component.mock.MockUIMessage;
-
-
-/**
- * <p class="changed_added_4_0">This class tests client validator behavior.
- * as it described at https://community.jboss.org/wiki/ClientSideValidation # Server-side rendering algorithm</p>
- * @author asmirnov(a)exadel.com
- *
- */
-(a)RunWith(MockTestRunner.class)
-public class ClientValidatorBehaviorTest {
-
- private final class DummyConverter implements Converter {
- public String getAsString(FacesContext context, UIComponent component, Object value) {
- return value.toString();
- }
-
- public Object getAsObject(FacesContext context, UIComponent component, String value) {
- return value;
- }
- }
-
- private static final String CLIENT_VALIDATION_FUNCTION = "rf.csv.v";
-
- private static final String FORM_ID = "formId";
-
- private static final String INPUT_ID = "inputId";
-
- private static final String MESSAGE_ID = "messageId";
-
- @Stub
- protected UIOutput output;
-
- @Mock()
- @Environment({Feature.APPLICATION})
- protected MockFacesEnvironment environment;
-
- @Mock
- protected UIInput input;
-
- @Mock
- protected UIViewRoot root;
-
- @Mock
- protected MockUIForm form;
-
- @Mock
- protected MockUIMessage message;
-
- @Mock
- protected ClientBehaviorContext behaviorContext;
-
- protected MockController controller;
-
- protected ClientValidatorImpl behavior;
-
- @Before
- public void setUp() {
- behavior = createBehavior();
- }
-
- /**
- * <p class="changed_added_4_0">Server-side rendering algorithm .1</p>
- */
- @Test(expected=FacesException.class)
- public void testGetScriptForIllegalComponent() {
- getScript(output);
- }
-
- /**
- * <p class="changed_added_4_0">Server-side rendering algorithm .2</p>
- * @throws Exception
- */
- @Test
- public void testGetScriptWithoutMessageComponent() throws Exception {
- buildForm(false);
- assertEquals(0, getScript(input).length());
- }
-
- /**
- * <p class="changed_added_4_0">Server-side rendering algorithm .3 - determine client-side converter</p>
- * @throws Exception
- */
- @Test
- public void testGetClientConverter() throws Exception {
-
- }
- /**
- * <p class="changed_added_4_0">Server-side rendering algorithm .3</p>
- * @throws Exception
- */
- @Test
- public void testGetScriptWithoutClientConverter() throws Exception {
- buildForm(true);
- expect(input.getConverter()).andStubReturn(new DummyConverter());
- String script = getScript(input);// ajax-only validator.
- assertFalse(script.contains(CLIENT_VALIDATION_FUNCTION));
- }
-
- /**
- * <p class="changed_added_4_0">Server-side rendering algorithm .3</p>
- * @throws Exception
- */
- @Test
- public void testGetScriptWithClientConverter() throws Exception {
-
- }
-
- private String getScript(UIComponent component) {
- ClientBehaviorContext clientBehaviorContext = setupBehaviorContext(component);
- controller.replay();
- String script = behavior.getScript(clientBehaviorContext);
- controller.verify();
- return script;
- }
-
- private ClientBehaviorContext setupBehaviorContext(UIComponent component) {
- expect(behaviorContext.getComponent()).andStubReturn(component);
- expect(behaviorContext.getFacesContext()).andStubReturn(environment.getFacesContext());
- return behaviorContext;
- }
-
- private void buildForm(boolean withMessage) {
- expect(environment.getFacesContext().getViewRoot()).andStubReturn(root);
- expect(form.getId()).andStubReturn(FORM_ID);
- List<UIComponent> formChildren = new ArrayList<UIComponent>();
- expect(form.getChildren()).andStubReturn(formChildren);
- expect(input.getId()).andStubReturn(INPUT_ID);
- expect(input.getParent()).andStubReturn(form);
- formChildren.add(input);
- expect(output.getParent()).andStubReturn(form);
- formChildren.add(output);
- if(withMessage){
- expect(message.getId()).andStubReturn(MESSAGE_ID);
- expect(message.getFor()).andStubReturn(INPUT_ID);
- expect(message.getParent()).andStubReturn(form);
- formChildren.add(message);
- }
-// root.getChildren().add(form);
- }
-
- private ClientValidatorImpl createBehavior() {
- return new ClientValidatorImpl();
- }
-
- @Test
- public void testDecode() {
- fail("Not yet implemented");
- }
-
-}
Added: branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/GetScriptTest.java
===================================================================
--- branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/GetScriptTest.java (rev 0)
+++ branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/GetScriptTest.java 2010-10-13 23:44:25 UTC (rev 19563)
@@ -0,0 +1,86 @@
+package org.richfaces.component.behavior;
+import static org.easymock.EasyMock.*;
+import static org.junit.Assert.*;
+
+import javax.faces.FacesException;
+import javax.faces.component.UICommand;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIOutput;
+import javax.faces.component.behavior.ClientBehaviorContext;
+import javax.faces.render.RenderKit;
+
+import org.jboss.test.faces.mock.Mock;
+import org.jboss.test.faces.mock.MockTestRunner;
+import org.jboss.test.faces.mock.Stub;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.richfaces.renderkit.html.ClientValidatorRenderer;
+import org.richfaces.renderkit.html.FormClientValidatorRenderer;
+
+
+/**
+ * <p class="changed_added_4_0">This class tests client validator behavior.
+ * as it described at https://community.jboss.org/wiki/ClientSideValidation # Server-side rendering algorithm</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+(a)RunWith(MockTestRunner.class)
+public class GetScriptTest extends BehaviorTestBase {
+
+
+ private static final String CLIENT_VALIDATION_FUNCTION = "rf.csv.v";
+
+
+
+ @Stub
+ protected UIOutput output;
+
+ @Mock
+ protected UICommand command;
+
+ /**
+ * <p class="changed_added_4_0">Server-side rendering algorithm .1</p>
+ */
+ @Test(expected=FacesException.class)
+ public void testGetScriptForIllegalComponent() {
+ getScript(output);
+ }
+
+
+ /**
+ * <p class="changed_added_4_0">Delegate getScript call to ClientValidatorRenderer</p>
+ * @throws Exception
+ */
+ @Test
+ public void testGetScriptForInput() throws Exception {
+ testGetScriptDelegate(ClientValidatorRenderer.RENDERER_TYPE, input);
+ }
+
+ /**
+ * <p class="changed_added_4_0">Server-side rendering algorithm .3</p>
+ * @throws Exception
+ */
+ @Test
+ public void testGetScriptForAction() throws Exception {
+ testGetScriptDelegate(FormClientValidatorRenderer.RENDERER_TYPE, command);
+ }
+
+ private void testGetScriptDelegate(String rendererType, UIComponent component) {
+ RenderKit renderKit = environment.getRenderKit();
+ expect(renderKit.getClientBehaviorRenderer(rendererType)).andReturn(behaviorRenderer);
+ expect(behaviorRenderer.getScript(behaviorContext, behavior)).andReturn(CLIENT_VALIDATION_FUNCTION);
+ String script = getScript(component);// ajax-only validator.
+ assertEquals(CLIENT_VALIDATION_FUNCTION,script);
+ }
+
+ private String getScript(UIComponent component) {
+ ClientBehaviorContext clientBehaviorContext = setupBehaviorContext(component);
+ controller.replay();
+ String script = behavior.getScript(clientBehaviorContext);
+ controller.verify();
+ return script;
+ }
+
+
+
+}
Property changes on: branches/RF-8742/ui/validator/ui/src/test/java/org/richfaces/component/behavior/GetScriptTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
13 years, 8 months
JBoss Rich Faces SVN: r19562 - in branches/RF-7817/push-redesign/src/main: resources/META-INF/resources/org.richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-10-13 18:25:05 -0400 (Wed, 13 Oct 2010)
New Revision: 19562
Added:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushRequestWorker.java
Removed:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushSessionsWorker.java
Modified:
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/AtmospherePushHandler.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushSessionImpl.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushSessionTrackerImpl.java
branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/RequestImpl.java
branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/push.js
Log:
https://jira.jboss.org/browse/RF-7817
Modified: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/AtmospherePushHandler.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/AtmospherePushHandler.java 2010-10-13 19:19:38 UTC (rev 19561)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/AtmospherePushHandler.java 2010-10-13 22:25:05 UTC (rev 19562)
@@ -44,10 +44,13 @@
private PushSessionTracker pushTracker;
+ private PushRequestWorker worker;
+
public AtmospherePushHandler(SubscriptionContext subscriptionContext) {
super();
pushTracker = new PushSessionTrackerImpl(subscriptionContext);
+ worker = new PushRequestWorker(8);
}
protected PushSessionTracker getPushTracker() {
@@ -79,7 +82,7 @@
resp.setContentType("text/plain");
- pushSession.connect(new RequestImpl(resource));
+ pushSession.connect(new RequestImpl(resource, pushSession, worker));
}
public void onStateChange(AtmosphereResourceEvent<HttpServletRequest, HttpServletResponse> event)
Copied: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushRequestWorker.java (from rev 19546, branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushSessionsWorker.java)
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushRequestWorker.java (rev 0)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushRequestWorker.java 2010-10-13 22:25:05 UTC (rev 19562)
@@ -0,0 +1,85 @@
+/*
+ * 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.
+ */
+package org.richfaces.application.push.impl;
+
+import java.io.IOException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+final class PushRequestWorker {
+
+ private static final ThreadFactory DAEMON_THREADS_FACTORY = new ThreadFactory() {
+
+ private final AtomicInteger threadsCounter = new AtomicInteger();
+
+ public Thread newThread(Runnable r) {
+ Thread t = new Thread(r, "rf-push-worker-thread-" + threadsCounter.getAndIncrement());
+ t.setDaemon(true);
+
+ return t;
+ }
+ };
+
+ private final class Task implements Runnable {
+
+ private RequestImpl request;
+
+ public Task(RequestImpl request) {
+ super();
+ this.request = request;
+ }
+
+ public void run() {
+ try {
+ // TODO Auto-generated method stub
+ try {
+ request.writeMessages();
+ request.resubmitToWorker();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ } catch (Throwable e) {
+ // TODO: handle exception
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private ExecutorService executorService;
+
+ public PushRequestWorker(int numThreads) {
+ super();
+
+ this.executorService = Executors.newFixedThreadPool(numThreads, DAEMON_THREADS_FACTORY);
+ }
+
+ public void submit(RequestImpl request) {
+ executorService.submit(new Task(request));
+ }
+}
Modified: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushSessionImpl.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushSessionImpl.java 2010-10-13 19:19:38 UTC (rev 19561)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushSessionImpl.java 2010-10-13 22:25:05 UTC (rev 19562)
@@ -23,8 +23,8 @@
import java.io.IOException;
import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Delayed;
-import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import org.richfaces.application.push.Message;
@@ -42,9 +42,9 @@
public class PushSessionImpl implements Delayed, PushSession, RequestLifecycleListener, MessageListener {
private static final long EXPIRATION_DELAY = 45 * 1000;
+
+ private final Queue<Message> messagesQueue = new ConcurrentLinkedQueue<Message>();
- private final Queue<Message> messagesQueue = new LinkedBlockingQueue<Message>();
-
private final PushSessionTrackerImpl pushTracker;
private final String id;
@@ -81,7 +81,9 @@
// ***** RequestLifecycleListener methods
public void onSuspend(Request request) {
- pushTracker.getPushSessionsWorker().submit(PushSessionImpl.this);
+ if (!messagesQueue.isEmpty()) {
+ request.submitMessages();
+ }
}
public void onResume(Request request) {
@@ -112,7 +114,7 @@
messagesQueue.add(message);
if (request != null) {
- pushTracker.getPushSessionsWorker().submit(PushSessionImpl.this);
+ request.submitMessages();
}
}
@@ -135,20 +137,10 @@
}
- private void disconnect(Request request) throws IOException {
+ public synchronized void connect(Request argRequest) throws IOException {
if (request != null) {
- if (request.isSuspended()) {
- request.resume();
- }
-
- //TODO - request.removeListener(this) ?
- resetExpirationTime();
- pushTracker.onRequestDisconnected(this);
+ throw new IllegalStateException("Already connected!");
}
- }
-
- public synchronized void connect(Request argRequest) throws IOException {
- disconnect(request);
request = argRequest;
@@ -158,8 +150,17 @@
}
public synchronized void disconnect() throws IOException {
- disconnect(request);
- request = null;
+ if (request != null) {
+ if (request.isSuspended()) {
+ request.resume();
+ }
+
+ //TODO - request.removeListener(this) ?
+ resetExpirationTime();
+ pushTracker.onRequestDisconnected(this);
+
+ request = null;
+ }
}
public synchronized void destroy() {
@@ -167,32 +168,9 @@
for (TopicKey topicKey : topics) {
subscriptionContext.removeMessageListener(topicKey, this);
}
- pushTracker.getPushSessionsWorker().removeAll(this);
}
- public void writeMessages() throws IOException {
- Request requestVar = request;
-
- if (requestVar == null) {
- return;
- }
-
- boolean shouldResume = false;
- Message message = null;
-
- while (true) {
- message = messagesQueue.poll();
-
- if (message == null) {
- break;
- }
-
- requestVar.write(message);
- shouldResume = true;
- }
-
- if (shouldResume) {
- requestVar.resume();
- }
+ public Iterable<Message> getMessages() {
+ return messagesQueue;
}
}
Modified: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushSessionTrackerImpl.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushSessionTrackerImpl.java 2010-10-13 19:19:38 UTC (rev 19561)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushSessionTrackerImpl.java 2010-10-13 22:25:05 UTC (rev 19562)
@@ -58,8 +58,6 @@
private SubscriptionContext subscriptionContext;
- private PushSessionsWorker pushSessionsWorker;
-
public PushSessionTrackerImpl(SubscriptionContext subscriptionContext) {
//TODO use configurable executor service
Thread t = new Thread(new SessionsExpirationRunnable(), "rf-push-session-tracker");
@@ -67,7 +65,6 @@
t.start();
this.subscriptionContext = subscriptionContext;
- this.pushSessionsWorker = new PushSessionsWorker(8);
}
public PushSessionImpl createPushSession() {
@@ -105,7 +102,4 @@
return subscriptionContext;
}
- protected PushSessionsWorker getPushSessionsWorker() {
- return pushSessionsWorker;
- }
}
Deleted: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushSessionsWorker.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushSessionsWorker.java 2010-10-13 19:19:38 UTC (rev 19561)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/PushSessionsWorker.java 2010-10-13 22:25:05 UTC (rev 19562)
@@ -1,116 +0,0 @@
-/*
- * 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.
- */
-package org.richfaces.application.push.impl;
-
-import java.io.IOException;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import org.richfaces.application.push.PushSession;
-
-/**
- * @author Nick Belaevski
- *
- */
-final class PushSessionsWorker {
-
- private static final class Pipeline implements Runnable {
-
- private BlockingQueue<PushSession> sessionsQueue = new LinkedBlockingQueue<PushSession>();
-
- //TODO - number of sessions posted to the queue should not exceed two items
- public void submit(PushSession session) {
- sessionsQueue.add(session);
- }
-
- public void removeAll(PushSession session) {
- boolean elementRemoved;
- do {
- elementRemoved = sessionsQueue.remove(session);
- } while (elementRemoved);
- }
-
- public void run() {
- while (true) {
- try {
- PushSession session = sessionsQueue.take();
- session.writeMessages();
- //do something
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
- }
-
- private final int numThreads;
-
- private Pipeline[] pipelines;
-
- public PushSessionsWorker(int numThreads) {
- super();
-
- //it's important for hash code algorithm that number of workers is a power of two
- this.numThreads = computeFloorPowerOfTwo(numThreads);
-
- createPipelines();
- }
-
- private int computeFloorPowerOfTwo(int num) {
- int result = 1;
- while (result < num) {
- result <<= 1;
- }
-
- return result;
- }
-
- private int hashIdx(Object o) {
- int hash = o.hashCode();
-
- return hash & (pipelines.length - 1);
- }
-
- private void createPipelines() {
- pipelines = new Pipeline[numThreads];
- for (int i = 0; i < pipelines.length; i++) {
- pipelines[i] = new Pipeline();
- Thread t = new Thread(pipelines[i], "rf-push-broadcater-" + i);
- t.setDaemon(true);
- t.start();
- }
- }
-
- public void submit(PushSession session) {
- int pipelineIdx = hashIdx(session.getId());
- pipelines[pipelineIdx].submit(session);
- }
-
- public void removeAll(PushSession session) {
- int pipelineIdx = hashIdx(session.getId());
- pipelines[pipelineIdx].removeAll(session);
- }
-}
Modified: branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/RequestImpl.java
===================================================================
--- branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/RequestImpl.java 2010-10-13 19:19:38 UTC (rev 19561)
+++ branches/RF-7817/push-redesign/src/main/java/org/richfaces/application/push/impl/RequestImpl.java 2010-10-13 22:25:05 UTC (rev 19562)
@@ -24,7 +24,10 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -33,11 +36,15 @@
import org.atmosphere.cpr.AtmosphereResource;
import org.atmosphere.cpr.AtmosphereResourceEvent;
import org.atmosphere.cpr.AtmosphereResourceEventListener;
+import org.atmosphere.websocket.WebSocketSupport;
import org.richfaces.application.push.Message;
import org.richfaces.application.push.MessageSerializer;
+import org.richfaces.application.push.PushSession;
import org.richfaces.application.push.Request;
import org.richfaces.application.push.RequestLifecycleListener;
+import com.google.common.collect.Iterables;
+
/**
* @author Nick Belaevski
*
@@ -48,12 +55,18 @@
private static final String DATA_WRAPPER_END = "]";
- private static final String DATA_BLANK = "";
-
private AtmosphereResource<HttpServletRequest, HttpServletResponse> atmosphereResource;
- private List<RequestLifecycleListener> listeners = new ArrayList<RequestLifecycleListener>();
+ private List<RequestLifecycleListener> listeners = new ArrayList<RequestLifecycleListener>(1);
+ private PushSession pushSession;
+
+ private PushRequestWorker worker;
+
+ private boolean submitted = false;
+
+ private Lock submittedLock = new ReentrantLock();
+
private AtmosphereResourceEventListener atmosphereListener = new AtmosphereResourceEventListener() {
public void onSuspend(AtmosphereResourceEvent<HttpServletRequest, HttpServletResponse> event) {
@@ -66,13 +79,6 @@
for (RequestLifecycleListener listener : listeners) {
listener.onResume(RequestImpl.this);
}
-
- try {
- encodeRequestEndElement();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
}
public void onDisconnect(AtmosphereResourceEvent<HttpServletRequest, HttpServletResponse> event) {
@@ -87,14 +93,15 @@
}
};
- private boolean hasWrittenMessages = false;
+ public RequestImpl(AtmosphereResource<HttpServletRequest, HttpServletResponse> resource, PushSession pushSession,
+ PushRequestWorker worker) {
-
- public RequestImpl(AtmosphereResource<HttpServletRequest, HttpServletResponse> resource) {
super();
this.atmosphereResource = resource;
((AtmosphereEventLifecycle) atmosphereResource).addEventListener(atmosphereListener);
+ this.pushSession = pushSession;
+ this.worker = worker;
}
public void addListener(RequestLifecycleListener listener) {
@@ -105,22 +112,71 @@
listeners.remove(listener);
}
- public void write(Message message) throws IOException {
+ public void submitMessages() {
+ try {
+ submittedLock.lock();
+
+ if (!submitted) {
+ submitted = true;
+ worker.submit(this);
+ }
+ } finally {
+ submittedLock.unlock();
+ }
+ }
+
+ void resubmitToWorker() {
+ if (isPolling()) {
+ return;
+ }
+
+ try {
+ submittedLock.lock();
+ if (!Iterables.isEmpty(pushSession.getMessages())) {
+ worker.submit(this);
+ } else {
+ submitted = false;
+ }
+ } finally {
+ submittedLock.unlock();
+ }
+ }
+
+ void writeMessages() throws IOException {
HttpServletResponse response = atmosphereResource.getResponse();
PrintWriter writer = response.getWriter();
- if (!hasWrittenMessages) {
- encodeRequestStartElement();
- }
+ StringBuilder sb = new StringBuilder();
- writer.write(getMessageSerializer(message).serialize(message));
+ boolean isFirstMessage = true;
- if (hasWrittenMessages) {
- writer.write(", ");
- } else {
- hasWrittenMessages = true;
+ Iterable<Message> messages = pushSession.getMessages();
+ for (Iterator<Message> itr = messages.iterator(); itr.hasNext(); ) {
+ if (isFirstMessage) {
+ sb.append(DATA_WRAPPER_START);
+ }
+
+ Message message = itr.next();
+ itr.remove();
+ sb.append(getMessageSerializer(message).serialize(message));
+
+ if (!isFirstMessage) {
+ sb.append(", ");
+ } else {
+ isFirstMessage = false;
+ }
}
+
+ if (sb.length() != 0) {
+ sb.append(DATA_WRAPPER_END);
+
+ writer.write(sb.toString());
+
+ if (isPolling()) {
+ resume();
+ }
+ }
}
public void suspend() throws IOException {
@@ -140,25 +196,6 @@
return atmosphereResource.getAtmosphereResourceEvent().isSuspended();
}
- public void encodeRequestStartElement() throws IOException {
- write(DATA_WRAPPER_START);
- }
-
- public void encodeRequestEndElement() throws IOException {
- if (hasWrittenMessages) {
- write(DATA_WRAPPER_END);
- } else {
- write(DATA_BLANK);
- }
- }
-
- private void write(String s) throws IOException {
- HttpServletResponse response = atmosphereResource.getResponse();
-
- PrintWriter writer = response.getWriter();
- writer.write(s);
- }
-
private MessageSerializer getMessageSerializer(Message message) {
MessageSerializer serializer = (MessageSerializer) message.getAttribute(MessageSerializer.MESSAGE_ATTRIBUTE_NAME);
@@ -168,4 +205,17 @@
return serializer;
}
+
+ public boolean isPolling() {
+ HttpServletRequest req = atmosphereResource.getRequest();
+ boolean isWebsocket = req.getAttribute(WebSocketSupport.WEBSOCKET_SUSPEND) != null ||
+ req.getAttribute(WebSocketSupport.WEBSOCKET_RESUME) != null;
+
+ //TODO how to detect non-polling transports?
+ return !isWebsocket;
+ }
+
+ public PushSession getPushSession() {
+ return pushSession;
+ }
}
Modified: branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/push.js
===================================================================
--- branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/push.js 2010-10-13 19:19:38 UTC (rev 19561)
+++ branches/RF-7817/push-redesign/src/main/resources/META-INF/resources/org.richfaces/push.js 2010-10-13 22:25:05 UTC (rev 19562)
@@ -56,7 +56,9 @@
var connect = function() {
var pushSessionIdRequestHandler = function(data) {
pushSessionId = data;
- _$.atmosphere.subscribe(pushUrl + "/hub?pushSessionId=" + pushSessionId, messageCallback);
+ _$.atmosphere.subscribe(pushUrl + "/hub?pushSessionId=" + pushSessionId, messageCallback, {
+ transport: 'websocket'
+ });
};
var topics = new Array();
13 years, 8 months
JBoss Rich Faces SVN: r19559 - in branches/RF-8742: core/impl/src/main/resources/META-INF/resources and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-10-13 14:56:29 -0400 (Wed, 13 Oct 2010)
New Revision: 19559
Modified:
branches/RF-8742/
branches/RF-8742/core/impl/src/main/resources/META-INF/resources/richfaces.js
branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java
branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js
branches/RF-8742/ui/input/ui/src/main/templates/inplaceSelect.template.xml
Log:
Merged revisions 19548,19550,19555,19557 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
.......
r19548 | abelevich | 2010-10-13 03:01:15 -0700 (Wed, 13 Oct 2010) | 1 line
.......
r19550 | pyaschenko | 2010-10-13 03:53:02 -0700 (Wed, 13 Oct 2010) | 3 lines
RF-9152, RF-9168
richfaces container fixes
RichFaces.$$ was added
.......
r19555 | abelevich | 2010-10-13 08:35:34 -0700 (Wed, 13 Oct 2010) | 1 line
remove odd css class, fix selection, fix inplace specific popup behavior
.......
r19557 | abelevich | 2010-10-13 10:50:11 -0700 (Wed, 13 Oct 2010) | 1 line
add openOnEdit attribute, fix keyboard navigation
.......
Property changes on: branches/RF-8742
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-19546
+ /trunk:1-19558
Modified: branches/RF-8742/core/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- branches/RF-8742/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-10-13 18:43:22 UTC (rev 19558)
+++ branches/RF-8742/core/impl/src/main/resources/META-INF/resources/richfaces.js 2010-10-13 18:56:29 UTC (rev 19559)
@@ -40,9 +40,20 @@
var element = richfaces.getDomElement(source);
if (element) {
- return (element["richfaces"] || {})["component"];
+ return (element[richfaces.RICH_CONTAINER] || {})["component"];
}
}
+
+ richfaces.$$ = function(componentName, element)
+ {
+ while (element.parentNode) {
+ var e = element[richfaces.RICH_CONTAINER];
+ if (e && e.component && e.component.name==componentName)
+ return e.component;
+ else
+ element = element.parentNode;
+ }
+ }
// find component and call his method
richfaces.invokeMethod = function(source, method) {
Modified: branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java 2010-10-13 18:43:22 UTC (rev 19558)
+++ branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java 2010-10-13 18:56:29 UTC (rev 19559)
@@ -60,7 +60,10 @@
@Attribute
public abstract String getDefaultLabel();
-
+
+ @Attribute(defaultValue="false")
+ public abstract boolean isOpenOnEdit();
+
@Attribute(defaultValue="true")
public abstract boolean isSaveOnBlur();
Modified: branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2010-10-13 18:43:22 UTC (rev 19558)
+++ branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2010-10-13 18:56:29 UTC (rev 19559)
@@ -55,7 +55,9 @@
@ResourceDependency(name = "richfaces-base-component.js"),
@ResourceDependency(name = "richfaces-selection.js"),
@ResourceDependency(library = "org.richfaces", name = "inplaceBase.js"),
- @ResourceDependency(library = "org.richfaces", name = "select.js"),
+ @ResourceDependency(library = "org.richfaces", name = "popup.js"),
+ @ResourceDependency(library = "org.richfaces", name = "popupList.js"),
+ @ResourceDependency(library = "org.richfaces", name = "selectList.js"),
@ResourceDependency(library = "org.richfaces", name = "inplaceInput.js"),
@ResourceDependency(library = "org.richfaces", name = "inplaceSelect.js"),
@ResourceDependency(library = "org.richfaces", name = "inplaceSelect.ecss") })
@@ -72,6 +74,8 @@
public static final String OPTIONS_SELECT_ITEMS = "selectItems";
public static final String OPTIONS_SELECT_ITEM_VALUE_INPUT = "selValueInput";
+
+ public static final String OPTIONS_VISIBLE = "visible";
protected static final class ClientSelectItem implements ScriptString {
@@ -164,6 +168,7 @@
options.put(OPTIONS_ITEMS_CORD, clientId + "Items");
options.put(OPTIONS_SELECT_ITEMS, additional);
options.put(OPTIONS_SELECT_ITEM_VALUE_INPUT, clientId + "selValue");
+ options.put(OPTIONS_VISIBLE, component.getAttributes().get("openOnEdit"));
}
public void encodeOptions(FacesContext facesContext, UIComponent component,
@@ -225,7 +230,8 @@
}
public String getListStyles(FacesContext facesContext, UIComponent component) {
- return "";
+ AbstractInplaceSelect inplaceSelect = (AbstractInplaceSelect) component;
+ return inplaceSelect.isOpenOnEdit() ? "" : "display: none";
}
public String getReadyStateCss() {
Modified: branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-10-13 18:43:22 UTC (rev 19558)
+++ branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-10-13 18:56:29 UTC (rev 19559)
@@ -57,11 +57,14 @@
switch(code) {
case 27:
+ e.preventDefault();
this.cancel();
break;
case 13:
+ e.preventDefault();
this.save();
return false;
+ break;
}
},
Modified: branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-10-13 18:43:22 UTC (rev 19558)
+++ branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-10-13 18:56:29 UTC (rev 19559)
@@ -4,7 +4,7 @@
rf.ui.InplaceSelect = function(id, options) {
$super.constructor.call(this, id, options)
- this.select = new rf.ui.Select(options.listCord, this, options);
+ this.select = new rf.ui.SelectList(options.listCord, this, options);
this.selectItems = options.selectItems;
this.selValueInput = $(document.getElementById(options.selValueInput));
this.openPopup = false;
@@ -46,15 +46,17 @@
},
processItem: function(event, element) {
- var key = element.attr("id");
- var value = this.getItemValue(key);
- this.saveItemValue(value);
+ if(element) {
+ var key = $(element).attr("id");
+ var value = this.getItemValue(key);
+ this.saveItemValue(value);
+ var label = this.getItemLabel(key);
+ //inplace label
+ this.setValue(label);
+ }
- var label = this.getItemLabel(key);
- //inplace label
- this.setValue(label);
this.select.hide();
-
+ this.openPopup = false;
this.__setInputFocus();
},
@@ -81,7 +83,6 @@
},
__keydownHandler: function(e) {
- $super.__keydownHandler(e);
var code;
@@ -91,17 +92,30 @@
code = e.which;
}
- switch(code) {
- case rf.KEYS.DOWN:
- e.preventDefault();
- this.select.__onKeyDown(e);
- break;
-
- case rf.KEYS.UP:
- e.preventDefault();
- this.select.__onKeyUp(e);
- break;
- }
+ if(this.select.isVisible()) {
+ switch(code) {
+ case rf.KEYS.DOWN:
+ e.preventDefault();
+ this.select.__onKeyDown(e);
+ this.__setInputFocus();
+ break;
+
+ case rf.KEYS.UP:
+ e.preventDefault();
+ this.select.__onKeyUp(e);
+ this.__setInputFocus();
+ break;
+
+ case rf.KEYS.RETURN:
+ e.preventDefault();
+ this.select.__onEnter(e);
+ return false;
+ break;
+ }
+ }
+
+ $super.__keydownHandler.call(this,e);
+
},
__blurHandler: function(e) {
@@ -114,7 +128,7 @@
__isPopupList: function(target) {
var parentId = target.parents(".rf-is-lst-cord").attr("id");
- return (parentId && (parentId == this.select.__getId()));
+ return (parentId && (parentId == this.select.getId()));
}
}
Modified: branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js 2010-10-13 18:43:22 UTC (rev 19558)
+++ branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js 2010-10-13 18:56:29 UTC (rev 19559)
@@ -4,19 +4,17 @@
rf.ui.Popup = function(id, options) {
this.id = id;
+ this.attachToDom(id);
this.popup = $(document.getElementById(id));
- this.visible = options.visible;
-
- //TODO: remove this?
- this.popup.bind("blur", $.proxy(this.__onBlur, this));
-
- this.popup.bind("mouseover", $.proxy(this.__onMouseOver, this));
- this.popup.bind("click", $.proxy(this.__onClick, this));
+
+ this.visible = options.visible;;
+ this.popup.bind("mouseover", $.proxy(this.__onMouseOver, this));
+ this.popup.bind("click", $.proxy(this.__onClick, this));
};
rf.BaseComponent.extend(rf.ui.Popup);
var $super = rf.ui.Popup.$super;
-
+
$.extend(rf.ui.Popup.prototype, (function () {
return{
@@ -24,12 +22,14 @@
name : "popup",
show: function() {
- this.select.css("display", "");
+ this.popup.css('display', '');
+ //add attachToBody logic
this.visible = true;
},
hide: function() {
- this.select.css("display", "none");
+ this.popup.css('display', 'none');
+ //add attachToBody logic
this.visible = false;
},
@@ -45,11 +45,9 @@
},
__onClick: function(e) {
- },
-
- __onBlurHandler: function(e) {
- }
+ }
+ }
- })());
+ })());
})(jQuery, window.RichFaces);
\ No newline at end of file
Modified: branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2010-10-13 18:43:22 UTC (rev 19558)
+++ branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2010-10-13 18:56:29 UTC (rev 19559)
@@ -16,7 +16,6 @@
//TODO: from option map?
this.index = -1;
- this.visible = false;
this.__updateItemsList();
};
@@ -48,21 +47,41 @@
this.items = this.popup.find("."+this.itemCss);
},
- __select: function(index) {
- var item;
+ __select: function(item) {
+ var index = this.items.index(item);
+ this.__selectByIndex(index);
+ },
+
+ __selectByIndex: function(index, isOffset) {
+ if (this.items.length==0 || (!isOffset && this.index == index)) return;
+ var item;
if (this.index != -1) {
item = this.items.eq(this.index);
this.__unSelectItem(item);
}
-
- this.index += index;
- if (this.index < 0 ) {
- this.index = this.items.length - 1;
- } else if (this.index >= this.items.length) {
- this.index = 0;
- }
+
+ if (index==undefined) {
+ this.index = -1;
+ return;
+ }
+ if (isOffset) {
+ this.index += index;
+ if ( this.index<0 ) {
+ this.index = this.items.length - 1;
+ } else if (this.index >= this.items.length) {
+ this.index = 0;
+ }
+ } else {
+ if (index<0) {
+ index = 0;
+ } else if (index>=this.items.length) {
+ index = this.items.length - 1;
+ }
+ this.index = index;
+ }
+
item = this.items.eq(this.index);
this.__selectItem(item);
},
@@ -75,34 +94,40 @@
item.removeClass(this.selectItemCss);
},
+ //remove event, rename ???
__onEnter: function(e) {
+ var item;
+ if(this.items) {
+ item = this.items.eq(this.index);
+ this.processItem(e, item);
+ }
},
//remove event, rename
__onKeyUp: function(e) {
- this.__select(-1);
+ this.__selectByIndex(-1, true);
},
//remove event, rename
__onKeyDown: function(e) {
- this.__select(1);
+ this.__selectByIndex(1, true);
},
__onMouseOver: function(e) {
var item = this.__getItem(e);
- var index = this.items.index(item);
- this.__select(index);
+ if(item) {
+ this.__select(item);
+ }
},
__onClick: function(e) {
var item = this.__getItem(e);
- var index = this.items.index(item);
- this.__select(index);
this.processItem(e, item);
+ this.__select(item);
},
__getItem: function(e) {
- return $(e.target).closest("."+this.itemCss, e.currentTarget);
+ return $(e.target).closest("."+this.itemCss, e.currentTarget).get(0);
},
__getItems: function () {
Modified: branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js 2010-10-13 18:43:22 UTC (rev 19558)
+++ branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js 2010-10-13 18:56:29 UTC (rev 19559)
@@ -3,7 +3,7 @@
rf.ui = rf.ui || {};
rf.ui.SelectList = function(id, listener, options) {
- $super.constructor.call(this, id, options);
+ $super.constructor.call(this, id, listener, options);
};
rf.ui.PopupList.extend(rf.ui.SelectList);
Modified: branches/RF-8742/ui/input/ui/src/main/templates/inplaceSelect.template.xml
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-10-13 18:43:22 UTC (rev 19558)
+++ branches/RF-8742/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-10-13 18:56:29 UTC (rev 19559)
@@ -79,7 +79,7 @@
</span>
</span>
</c:if>
- <span id="#{clientId}List" class="rf-is-none rf-is-lst-cord">
+ <span id="#{clientId}List" style="#{getListStyles(facesContext, component)}" class="rf-is-lst-cord">
<span class="rf-is-lst-pos" style="width: #{component.attributes['listWidth']}">
<span class="rf-is-shdw">
<span class="rf-is-shdw-t"></span>
13 years, 8 months
JBoss Rich Faces SVN: r19558 - in branches/RF-8742: ui/input/api/src/main/java/org/richfaces/component and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-10-13 14:43:22 -0400 (Wed, 13 Oct 2010)
New Revision: 19558
Added:
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js
Modified:
branches/RF-8742/
branches/RF-8742/ui/input/api/src/main/java/org/richfaces/component/InplaceState.java
branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
branches/RF-8742/ui/input/ui/src/main/templates/inplaceInput.template.xml
branches/RF-8742/ui/input/ui/src/main/templates/inplaceSelect.template.xml
branches/RF-8742/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
Log:
Merged revisions 19525,19542-19543 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
.......
r19525 | abelevich | 2010-10-11 11:04:10 -0700 (Mon, 11 Oct 2010) | 1 line
add disable state (RF-9348)
.......
r19542 | abelevich | 2010-10-12 08:37:45 -0700 (Tue, 12 Oct 2010) | 1 line
keyboard keys proccess
.......
r19543 | abelevich | 2010-10-12 08:40:14 -0700 (Tue, 12 Oct 2010) | 1 line
initial for the RF-9340
.......
Property changes on: branches/RF-8742
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-19522
+ /trunk:1-19546
Modified: branches/RF-8742/ui/input/api/src/main/java/org/richfaces/component/InplaceState.java
===================================================================
--- branches/RF-8742/ui/input/api/src/main/java/org/richfaces/component/InplaceState.java 2010-10-13 17:50:11 UTC (rev 19557)
+++ branches/RF-8742/ui/input/api/src/main/java/org/richfaces/component/InplaceState.java 2010-10-13 18:43:22 UTC (rev 19558)
@@ -31,5 +31,6 @@
public enum InplaceState {
ready,
edit,
- changed
+ changed,
+ disable
}
Modified: branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2010-10-13 17:50:11 UTC (rev 19557)
+++ branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputBaseRenderer.java 2010-10-13 18:43:22 UTC (rev 19558)
@@ -43,148 +43,202 @@
* @author Anton Belevich
*
*/
-@ResourceDependencies({ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
- @ResourceDependency(name = "jquery.js"), @ResourceDependency(name = "richfaces.js"),
- @ResourceDependency(name = "richfaces-event.js"),
- @ResourceDependency(name = "richfaces-base-component.js"),
- @ResourceDependency(library="org.richfaces", name = "inplaceBase.js"),
- @ResourceDependency(library="org.richfaces", name = "inplaceInput.js"),
- @ResourceDependency(library="org.richfaces", name = "inplaceInput.ecss") })
+@ResourceDependencies({
+ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name = "richfaces-event.js"),
+ @ResourceDependency(name = "richfaces-base-component.js"),
+ @ResourceDependency(library = "org.richfaces", name = "inplaceBase.js"),
+ @ResourceDependency(library = "org.richfaces", name = "inplaceInput.js"),
+ @ResourceDependency(library = "org.richfaces", name = "inplaceInput.ecss") })
public class InplaceInputBaseRenderer extends InputRendererBase {
-
+
public static final String OPTIONS_EDIT_EVENT = "editEvent";
+ public static final String OPTIONS_STATE = "state";
+
public static final String OPTIONS_EDIT_CONTAINER = "editContainer";
-
+
public static final String OPTIONS_INPUT = "input";
-
+
public static final String OPTIONS_FOCUS = "focusElement";
-
+
public static final String OPTIONS_BUTTON_OK = "okbtn";
-
+
public static final String OPTIONS_LABEL = "label";
-
+
public static final String OPTIONS_DEFAULT_LABEL = "defaultLabel";
-
+
public static final String OPTIONS_BUTTON_CANCEL = "cancelbtn";
-
+
public static final String OPTIONS_SHOWCONTROLS = "showControls";
-
+
public static final String OPTIONS_NONE_CSS = "noneCss";
-
+
public static final String OPTIONS_CHANGED_CSS = "changedCss";
+ public static final String OPTIONS_EDIT_CSS = "editCss";
+
public static final String OPTIONS_INITIAL_VALUE = "initialValue";
-
+
public static final String OPTIONS_SAVE_ON_BLUR = "saveOnBlur";
-
private static final Map<String, ComponentAttribute> INPLACEINPUT_HANDLER_ATTRIBUTES = Collections
- .unmodifiableMap(ComponentAttribute.createMap(
- new ComponentAttribute(HtmlConstants.ONCLICK_ATTRIBUTE).setEventNames("inputclick").
- setComponentAttributeName("oninputclick"),
- new ComponentAttribute(HtmlConstants.ONDBLCLICK_ATTRIBUTE).setEventNames("inputdblclick").
- setComponentAttributeName("oninputdblclick"),
- new ComponentAttribute(HtmlConstants.ONMOUSEDOWN_ATTRIBUTE).setEventNames("inputmousedown").
- setComponentAttributeName("oninputmousedown"),
- new ComponentAttribute(HtmlConstants.ONMOUSEUP_ATTRIBUTE).setEventNames("inputmouseup").
- setComponentAttributeName("oninputmouseup"),
- new ComponentAttribute(HtmlConstants.ONMOUSEOVER_ATTRIBUTE).setEventNames("inputmouseover").
- setComponentAttributeName("oninputmouseover"),
- new ComponentAttribute(HtmlConstants.ONMOUSEMOVE_ATTRIBUTE).setEventNames("inputmousemove").
- setComponentAttributeName("oninputmousemove"),
- new ComponentAttribute(HtmlConstants.ONMOUSEOUT_ATTRIBUTE).setEventNames("inputmouseout").
- setComponentAttributeName("oninputmouseout"),
- new ComponentAttribute(HtmlConstants.ONKEYPRESS_ATTRIBUTE).setEventNames("inputkeypress").
- setComponentAttributeName("oninputkeypress"),
- new ComponentAttribute(HtmlConstants.ONKEYDOWN_ATTRIBUTE).setEventNames("inputkeydown").
- setComponentAttributeName("oninputkeydown"),
- new ComponentAttribute(HtmlConstants.ONKEYUP_ATTRIBUTE).setEventNames("inputkeyup").
- setComponentAttributeName("oninputkeyup"),
- new ComponentAttribute(HtmlConstants.ONBLUR_ATTRIBUTE).setEventNames("inputblur").
- setComponentAttributeName("oninputblur"),
- new ComponentAttribute(HtmlConstants.ONFOCUS_ATTRIBUTE).setEventNames("inputfocus").
- setComponentAttributeName("oninputfocus"),
- new ComponentAttribute(HtmlConstants.ONCHANGE_ATTRIBUTE).setEventNames("change").
- setComponentAttributeName("onchange"),
- new ComponentAttribute(HtmlConstants.ONSELECT_ATTRIBUTE).setEventNames("select").
- setComponentAttributeName("onselect")
- ));
+ .unmodifiableMap(ComponentAttribute.createMap(
+ new ComponentAttribute(HtmlConstants.ONCLICK_ATTRIBUTE)
+ .setEventNames("inputclick")
+ .setComponentAttributeName("oninputclick"),
+ new ComponentAttribute(HtmlConstants.ONDBLCLICK_ATTRIBUTE)
+ .setEventNames("inputdblclick")
+ .setComponentAttributeName("oninputdblclick"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEDOWN_ATTRIBUTE)
+ .setEventNames("inputmousedown")
+ .setComponentAttributeName("oninputmousedown"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEUP_ATTRIBUTE)
+ .setEventNames("inputmouseup")
+ .setComponentAttributeName("oninputmouseup"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEOVER_ATTRIBUTE)
+ .setEventNames("inputmouseover")
+ .setComponentAttributeName("oninputmouseover"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEMOVE_ATTRIBUTE)
+ .setEventNames("inputmousemove")
+ .setComponentAttributeName("oninputmousemove"),
+ new ComponentAttribute(HtmlConstants.ONMOUSEOUT_ATTRIBUTE)
+ .setEventNames("inputmouseout")
+ .setComponentAttributeName("oninputmouseout"),
+ new ComponentAttribute(HtmlConstants.ONKEYPRESS_ATTRIBUTE)
+ .setEventNames("inputkeypress")
+ .setComponentAttributeName("oninputkeypress"),
+ new ComponentAttribute(HtmlConstants.ONKEYDOWN_ATTRIBUTE)
+ .setEventNames("inputkeydown")
+ .setComponentAttributeName("oninputkeydown"),
+ new ComponentAttribute(HtmlConstants.ONKEYUP_ATTRIBUTE)
+ .setEventNames("inputkeyup")
+ .setComponentAttributeName("oninputkeyup"),
+ new ComponentAttribute(HtmlConstants.ONBLUR_ATTRIBUTE)
+ .setEventNames("inputblur")
+ .setComponentAttributeName("oninputblur"),
+ new ComponentAttribute(HtmlConstants.ONFOCUS_ATTRIBUTE)
+ .setEventNames("inputfocus")
+ .setComponentAttributeName("oninputfocus"),
+ new ComponentAttribute(HtmlConstants.ONCHANGE_ATTRIBUTE)
+ .setEventNames("change").setComponentAttributeName(
+ "onchange"),
+ new ComponentAttribute(HtmlConstants.ONSELECT_ATTRIBUTE)
+ .setEventNames("select").setComponentAttributeName(
+ "onselect")));
- protected void renderInputHandlers(FacesContext facesContext, UIComponent component) throws IOException {
- RenderKitUtils.renderPassThroughAttributesOptimized(facesContext, component, INPLACEINPUT_HANDLER_ATTRIBUTES);
+ protected void renderInputHandlers(FacesContext facesContext,
+ UIComponent component) throws IOException {
+ RenderKitUtils.renderPassThroughAttributesOptimized(facesContext,
+ component, INPLACEINPUT_HANDLER_ATTRIBUTES);
}
-
+
public InplaceState getInplaceState(UIComponent component) {
return ((InplaceComponent) component).getState();
}
public String getValue(FacesContext facesContext, UIComponent component) throws IOException {
String value = getInputValue(facesContext, component);
- if(value == null || "".equals(value)) {
- value = ((InplaceComponent)component).getDefaultLabel();
+ if (!isDisable(getInplaceState(component)) && (value == null || "".equals(value)) ) {
+ value = ((InplaceComponent) component).getDefaultLabel();
}
return value;
}
-
+
public String getResourcePath(FacesContext context, String resourceName) {
if (resourceName != null) {
- ResourceHandler resourceHandler = context.getApplication().getResourceHandler();
+ ResourceHandler resourceHandler = context.getApplication()
+ .getResourceHandler();
Resource resource = resourceHandler.createResource(resourceName);
return resource.getRequestPath();
}
return null;
}
- public String getReadyStyleClass(UIComponent component, InplaceState inplaceState) {
- return (InplaceState.changed != inplaceState) ? getReadyStateCss() : HtmlUtil.concatClasses(getReadyStateCss(), getChangedStateCss());
+ public String getStateStyleClass(UIComponent component,
+ InplaceState inplaceState) {
+ String style = getReadyStateCss();
+ switch (inplaceState) {
+ case edit:
+ style = HtmlUtil.concatClasses(style, getEditStateCss());
+ break;
+
+ case changed:
+ style = HtmlUtil.concatClasses(style, getChangedStateCss());
+ break;
+
+ case disable:
+ style = getDisableStateCss();
+ break;
+
+ default:
+ break;
+ }
+
+ return style;
}
- public String getEditStyleClass(UIComponent component, InplaceState inplaceState) {
- return (InplaceState.edit != inplaceState)? HtmlUtil.concatClasses(getEditStateCss(), getNoneCss()) : getEditStateCss();
+ public boolean isDisable(InplaceState currentState) {
+ return (InplaceState.disable == currentState);
}
- public String getReadyClientId(FacesContext facesContext, UIComponent component, InplaceState inplaceState) {
+
+ public String getEditStyleClass(UIComponent component,
+ InplaceState inplaceState) {
+ return (InplaceState.edit != inplaceState) ? HtmlUtil.concatClasses(getEditCss(), getNoneCss()) : getEditCss();
+ }
+
+ public String getReadyClientId(FacesContext facesContext,
+ UIComponent component, InplaceState inplaceState) {
String clientId = component.getClientId(facesContext);
return getId(clientId, InplaceState.ready, inplaceState);
}
- public String getChangedClientId(FacesContext facesContext, UIComponent component, InplaceState inplaceState) {
+ public String getChangedClientId(FacesContext facesContext,
+ UIComponent component, InplaceState inplaceState) {
String clientId = component.getClientId(facesContext);
return getId(clientId, InplaceState.changed, inplaceState);
}
- private String getId(String clientId, InplaceState expect, InplaceState current) {
+ private String getId(String clientId, InplaceState expect,
+ InplaceState current) {
String result = clientId;
if (expect != current) {
result = clientId + ":" + expect;
}
return result;
}
-
- public void buildScript(ResponseWriter writer, FacesContext facesContext, UIComponent component, Object additional) throws IOException {
- if(!(component instanceof InplaceComponent)) {
+
+ public void buildScript(ResponseWriter writer, FacesContext facesContext,
+ UIComponent component, Object additional) throws IOException {
+ if (!(component instanceof InplaceComponent)) {
return;
}
String scriptName = getScriptName();
JSFunction function = new JSFunction(scriptName);
String clientId = component.getClientId(facesContext);
- Map<String, Object> options = createInplaceComponentOptions(clientId, (InplaceComponent)component);
+ Map<String, Object> options = createInplaceComponentOptions(clientId,
+ (InplaceComponent) component);
addToOptions(facesContext, component, options, additional);
function.addParameter(clientId);
function.addParameter(options);
writer.write(function.toString());
}
-
+
protected String getScriptName() {
return "new RichFaces.ui.InplaceInput";
}
-
- private Map<String, Object> createInplaceComponentOptions(String clientId, InplaceComponent inplaceComponent) {
+
+ private Map<String, Object> createInplaceComponentOptions(String clientId,
+ InplaceComponent inplaceComponent) {
Map<String, Object> options = new HashMap<String, Object>();
options.put(OPTIONS_EDIT_EVENT, inplaceComponent.getEditEvent());
+ options.put(OPTIONS_STATE, inplaceComponent.getState());
options.put(OPTIONS_NONE_CSS, getNoneCss());
options.put(OPTIONS_CHANGED_CSS, getChangedStateCss());
+ options.put(OPTIONS_EDIT_CSS, getEditStateCss());
options.put(OPTIONS_EDIT_CONTAINER, clientId + ":edit");
options.put(OPTIONS_INPUT, clientId + ":input");
options.put(OPTIONS_LABEL, clientId + ":label");
@@ -193,31 +247,40 @@
options.put(OPTIONS_SAVE_ON_BLUR, inplaceComponent.isSaveOnBlur());
boolean showControls = inplaceComponent.isShowControls();
-
+
options.put(OPTIONS_SHOWCONTROLS, showControls);
- if(showControls) {
+ if (showControls) {
options.put(OPTIONS_BUTTON_OK, clientId + ":okbtn");
options.put(OPTIONS_BUTTON_CANCEL, clientId + ":cancelbtn");
}
return options;
}
- public void addToOptions(FacesContext facesContext, UIComponent component, Map<String, Object> options, Object additional) {
- //override this method if you need additional options
+ public void addToOptions(FacesContext facesContext, UIComponent component,
+ Map<String, Object> options, Object additional) {
+ // override this method if you need additional options
}
-
+
public String getReadyStateCss() {
return "rf-ii-d-s";
}
-
+
public String getEditStateCss() {
return "rf-ii-e-s";
}
-
+
public String getChangedStateCss() {
return "rf-ii-c-s";
}
-
+
+ public String getDisableStateCss() {
+ return "rf-ii-dis-s";
+ }
+
+ public String getEditCss() {
+ return "rf-ii-edit";
+ }
+
public String getNoneCss() {
return "rf-ii-none";
}
Modified: branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2010-10-13 17:50:11 UTC (rev 19557)
+++ branches/RF-8742/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2010-10-13 18:43:22 UTC (rev 19558)
@@ -198,7 +198,7 @@
UIComponent component) {
AbstractInplaceSelect select = (AbstractInplaceSelect) component;
String label = getSelectInputLabel(facesContext, select);
- if (label == null) {
+ if (!isDisable(getInplaceState(component)) && (label == null)) {
label = select.getDefaultLabel();
}
return label;
@@ -240,6 +240,14 @@
return "rf-is-c-s";
}
+ public String getDisableStateCss() {
+ return "rf-is-dis-s";
+ }
+
+ public String getEditCss() {
+ return "rf-is-edit";
+ }
+
public String getNoneCss() {
return "rf-is-none";
}
Modified: branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js 2010-10-13 17:50:11 UTC (rev 19557)
+++ branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js 2010-10-13 18:43:22 UTC (rev 19558)
@@ -1,4 +1,22 @@
// TODO: remove when these functions will be moved to the RichFaces.Event <!--
+
+(function (rf) {
+ rf.KEYS = {
+ BACKSPACE: 8,
+ TAB: 9,
+ RETURN: 13,
+ ESC: 27,
+ PAGEUP: 33,
+ PAGEDOWN: 34,
+ LEFT: 37,
+ UP: 38,
+ RIGHT: 39,
+ DOWN: 40,
+ DEL: 46
+ };
+})(RichFaces);
+
+
$.extend(RichFaces.Event, {
bindScrollEventHandlers: function(element, handler, component) {
var elements = [];
@@ -33,13 +51,15 @@
this.noneCss = options.noneCss;
this.changedCss = options.changedCss;
this.defaultLabel = options.defaultLabel;
+ this.state = options.state;
this.element = $(document.getElementById(id));
this.editContainer = $(document.getElementById(options.editContainer));
+ this.state = options.state;
- this.element.bind(this.editEvent, $.proxy(this.__editHandler, this));
-
- this.isSaved = false;
+ this.element.bind(this.editEvent, $.proxy(this.__editHandler, this));
+
+ this.isSaved = false;
this.useDefaultLabel = false;
};
@@ -48,7 +68,14 @@
var $super = rf.ui.InplaceBase.$super;
$.extend(rf.ui.InplaceBase.prototype, ( function () {
-
+
+ var STATE = {
+ READY : 'ready',
+ CHANGED: 'changed',
+ DISABLE: 'disable',
+ EDIT: 'edit'
+ };
+
return {
getName: function() {
},
Modified: branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss 2010-10-13 17:50:11 UTC (rev 19557)
+++ branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.ecss 2010-10-13 18:43:22 UTC (rev 19558)
@@ -14,6 +14,17 @@
font-size : inherit;
}
+.rf-ii-edit {
+ position : absolute;
+ top : 0px;
+ left : 0px;
+ display : inline-block;
+ width: 100%;
+}
+
+.rf-ii-dis-s {
+}
+
.rf-ii-lbl {
white-space : nowrap;
}
@@ -39,11 +50,6 @@
}
.rf-ii-e-s {
- position : absolute;
- top : 0px;
- left : 0px;
- display : inline-block;
- width: 100%;
}
.rf-ii-fld {
Modified: branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-10-13 17:50:11 UTC (rev 19557)
+++ branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-10-13 18:43:22 UTC (rev 19558)
@@ -47,7 +47,15 @@
},
__keydownHandler: function(e) {
- switch(e.keyCode) {
+ var code;
+
+ if(e.keyCode) {
+ code = e.keyCode;
+ } else if(e.which) {
+ code = e.which;
+ }
+
+ switch(code) {
case 27:
this.cancel();
break;
Modified: branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss 2010-10-13 17:50:11 UTC (rev 19557)
+++ branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.ecss 2010-10-13 18:43:22 UTC (rev 19558)
@@ -19,6 +19,17 @@
clip: rect(0px, 0px, 1px, 1px);
}
+.rf-is-dis-s {
+}
+
+.rf-is-edit {
+ position : absolute;
+ top : 0px;
+ left : 0px;
+ width : 100px;
+ background-color : '#{richSkin.editBackgroundColor}';
+}
+
.rf-is-fnt {
}
@@ -42,11 +53,6 @@
}
.rf-is-e-s {
- position : absolute;
- top : 0px;
- left : 0px;
- width : 100px;
- background-color : '#{richSkin.editBackgroundColor}';
}
.rf-is-fld {
Modified: branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-10-13 17:50:11 UTC (rev 19557)
+++ branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-10-13 18:43:22 UTC (rev 19558)
@@ -79,6 +79,30 @@
}
}
},
+
+ __keydownHandler: function(e) {
+ $super.__keydownHandler(e);
+
+ var code;
+
+ if(e.keyCode) {
+ code = e.keyCode;
+ } else if(e.which) {
+ code = e.which;
+ }
+
+ switch(code) {
+ case rf.KEYS.DOWN:
+ e.preventDefault();
+ this.select.__onKeyDown(e);
+ break;
+
+ case rf.KEYS.UP:
+ e.preventDefault();
+ this.select.__onKeyUp(e);
+ break;
+ }
+ },
__blurHandler: function(e) {
var target = $(e.originalEvent.explicitOriginalTarget);
Copied: branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js (from rev 19543, trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js)
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js (rev 0)
+++ branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js 2010-10-13 18:43:22 UTC (rev 19558)
@@ -0,0 +1,55 @@
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.Popup = function(id, options) {
+ this.id = id;
+ this.popup = $(document.getElementById(id));
+ this.visible = options.visible;
+
+ //TODO: remove this?
+ this.popup.bind("blur", $.proxy(this.__onBlur, this));
+
+ this.popup.bind("mouseover", $.proxy(this.__onMouseOver, this));
+ this.popup.bind("click", $.proxy(this.__onClick, this));
+ };
+
+ rf.BaseComponent.extend(rf.ui.Popup);
+ var $super = rf.ui.Popup.$super;
+
+ $.extend(rf.ui.Popup.prototype, (function () {
+
+ return{
+
+ name : "popup",
+
+ show: function() {
+ this.select.css("display", "");
+ this.visible = true;
+ },
+
+ hide: function() {
+ this.select.css("display", "none");
+ this.visible = false;
+ },
+
+ isVisible: function() {
+ return this.visible;
+ },
+
+ getId: function() {
+ return this.id;
+ },
+
+ __onMouseOver: function(e) {
+ },
+
+ __onClick: function(e) {
+ },
+
+ __onBlurHandler: function(e) {
+ }
+
+ })());
+
+})(jQuery, window.RichFaces);
\ No newline at end of file
Copied: branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js (from rev 19543, trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js)
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js (rev 0)
+++ branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2010-10-13 18:43:22 UTC (rev 19558)
@@ -0,0 +1,114 @@
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ var INTERFACE = {
+ SelectListener : {
+ processItem: function(e, element){}
+ }
+ };
+
+ rf.ui.PopupList = function(id, listener, options) {
+ $super.constructor.call(this, id, options);
+ this.selectListener = listener;
+ this.selectItemCss = options.selectItemCss;
+ this.itemCss = options.itemCss;
+
+ //TODO: from option map?
+ this.index = -1;
+ this.visible = false;
+ this.__updateItemsList();
+ };
+
+ rf.ui.Popup.extend(rf.ui.PopupList);
+ var $super = rf.ui.PopupList.$super;
+
+ $.extend(rf.ui.PopupList.prototype, ( function () {
+
+ var isSelectListener = function(obj) {
+ for (var method in INTERFACE.SelectListener) {
+ if ( (typeof obj[method] != typeof INTERFACE.SelectListener[method]) ) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+ return{
+
+ name : "popupList",
+
+ processItem: function(e, element) {
+ if(isSelectListener(this.selectListener)) {
+ this.selectListener.processItem(e, element);
+ }
+ },
+
+ __updateItemsList: function () {
+ this.items = this.popup.find("."+this.itemCss);
+ },
+
+ __select: function(index) {
+ var item;
+
+ if (this.index != -1) {
+ item = this.items.eq(this.index);
+ this.__unSelectItem(item);
+ }
+
+ this.index += index;
+ if (this.index < 0 ) {
+ this.index = this.items.length - 1;
+ } else if (this.index >= this.items.length) {
+ this.index = 0;
+ }
+
+ item = this.items.eq(this.index);
+ this.__selectItem(item);
+ },
+
+ __selectItem: function(item) {
+ item.addClass(this.selectItemCss);
+ },
+
+ __unSelectItem: function(item) {
+ item.removeClass(this.selectItemCss);
+ },
+
+ __onEnter: function(e) {
+ },
+
+ //remove event, rename
+ __onKeyUp: function(e) {
+ this.__select(-1);
+ },
+
+ //remove event, rename
+ __onKeyDown: function(e) {
+ this.__select(1);
+ },
+
+ __onMouseOver: function(e) {
+ var item = this.__getItem(e);
+ var index = this.items.index(item);
+ this.__select(index);
+ },
+
+ __onClick: function(e) {
+ var item = this.__getItem(e);
+ var index = this.items.index(item);
+ this.__select(index);
+ this.processItem(e, item);
+ },
+
+ __getItem: function(e) {
+ return $(e.target).closest("."+this.itemCss, e.currentTarget);
+ },
+
+ __getItems: function () {
+ return this.items;
+ }
+ }
+ })());
+
+})(jQuery, window.RichFaces);
\ No newline at end of file
Modified: branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-10-13 17:50:11 UTC (rev 19557)
+++ branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-10-13 18:43:22 UTC (rev 19558)
@@ -1,3 +1,20 @@
+//TODO: utils?
+(function (rf) {
+ rf.KEYS = {
+ BACKSPACE: 8,
+ TAB: 9,
+ RETURN: 13,
+ ESC: 27,
+ PAGEUP: 33,
+ PAGEDOWN: 34,
+ LEFT: 37,
+ UP: 38,
+ RIGHT: 39,
+ DOWN: 40,
+ DEL: 46
+ };
+})(RichFaces);
+
(function ($, rf) {
rf.ui = rf.ui || {};
@@ -4,7 +21,7 @@
var INTERFACE = {
SelectListener : {
- processItem: function(event, element){}
+ processItem: function(e, element){}
}
};
@@ -19,6 +36,11 @@
this.select.bind("blur", $.proxy(this.__blurHandler, this));
this.itemsCord.bind("mouseover", $.proxy(this.__mouseHandler, this));
this.itemsCord.bind("click", $.proxy(this.__mouseHandler, this));
+
+ this.index = -1;
+ //TODO: from option map?
+ this.visible = false;
+ this.updateItemsList();
};
rf.BaseComponent.extend(rf.ui.Select);
@@ -42,18 +64,55 @@
show: function() {
this.select.css("display", "");
+ this.visible = true;
},
hide: function() {
this.select.css("display", "none");
+ this.visible = false;
},
- processItem: function(event, element) {
+ processItem: function(e, element) {
if(isSelectListener(this.selectListener)) {
- this.selectListener.processItem(event, element);
+ this.selectListener.processItem(e, element);
}
},
+ isVisible: function() {
+ return this.visible;
+ },
+
+ __selectItem: function(e, index) {
+ var item;
+
+ if (this.index != -1) {
+ item = this.items.eq(this.index);
+ item.removeClass(this.selectItemCss);
+ }
+
+ this.index += index;
+ if ( this.index < 0 ) {
+ this.index = this.items.length - 1;
+ } else if (this.index >= this.items.length) {
+ this.index = 0;
+ }
+
+ item = this.items.eq(this.index);
+ item.addClass(this.selectItemCss);
+ },
+
+ __onEnter: function(e) {
+
+ },
+
+ __onKeyUp: function(e) {
+ this.__selectItem(e, -1);
+ },
+
+ __onKeyDown: function(e) {
+ this.__selectItem(e, 1);
+ },
+
__getCurrentElement: function() {
return processed;
},
@@ -63,10 +122,10 @@
return false;
},
- __mouseHandler: function(event) {
- var element = $(event.target).closest("."+this.itemCss, event.currentTarget);
- if (event&& element) {
- if(event.type == 'mouseover') {
+ __mouseHandler: function(e) {
+ var element = $(e.target).closest("."+this.itemCss, e.currentTarget);
+ if (e && element) {
+ if(e.type == 'mouseover') {
if(processed) {
processed.removeClass(this.selectItemCss);
}
@@ -74,13 +133,21 @@
processed = element;
}
- if(event.type == 'click') {
- this.processItem(event, element);
+ if(e.type == 'click') {
+ this.processItem(e, element);
}
}
return false;
- },
+ },
+ updateItemsList: function () {
+ this.items = this.itemsCord.find("."+this.itemCss);
+ },
+
+ __getItems: function () {
+ return this.items;
+ },
+
__getId: function() {
return this.id;
}
Copied: branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js (from rev 19543, trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js)
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js (rev 0)
+++ branches/RF-8742/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js 2010-10-13 18:43:22 UTC (rev 19558)
@@ -0,0 +1,20 @@
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.SelectList = function(id, listener, options) {
+ $super.constructor.call(this, id, options);
+ };
+
+ rf.ui.PopupList.extend(rf.ui.SelectList);
+ var $super = rf.ui.SelectList.$super;
+
+ $.extend(rf.ui.SelectList.prototype,(function () {
+
+ return{
+ name : "selectList",
+ }
+
+ })());
+
+})(jQuery, window.RichFaces);
\ No newline at end of file
Modified: branches/RF-8742/ui/input/ui/src/main/templates/inplaceInput.template.xml
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/templates/inplaceInput.template.xml 2010-10-13 17:50:11 UTC (rev 19557)
+++ branches/RF-8742/ui/input/ui/src/main/templates/inplaceInput.template.xml 2010-10-13 18:43:22 UTC (rev 19558)
@@ -41,47 +41,50 @@
<cc:implementation>
<cdk:object type="org.richfaces.component.InplaceState" name="inplaceState" value="#{getInplaceState(component)}" />
<cdk:object type="java.lang.String" name="inplaceValue" value="#{getValue(facesContext, component)}" />
-
- <span id="#{clientId}" class="#{getReadyStyleClass(component, inplaceState)}" cdk:passThroughWithExclusions="id class">
+
+ <span id="#{clientId}" class="#{getStateStyleClass(component, inplaceState)}" cdk:passThroughWithExclusions="id class">
<span id="#{clientId}:label" class="rf-ii-lbl">
#{inplaceValue}
</span>
- <input id="#{clientId}:focus" type="image" style="position: absolute; top: 0px; left: 0px; outline-style: none;" class="rf-ii-none"/>
- <span id="#{clientId}:edit" class="#{getEditStyleClass(component, inplaceState)}">
- <input id="#{clientId}:input" autocomplete="off" name="#{clientId}"
- type="text" value="#{getInputValue(facesContext, component)}" class="rf-ii-fld" style="width: #{component.attributes['inputWidth']};" cdk:passThrough="tabIndex">
- <cdk:call expression="renderInputHandlers(facesContext, component);"/>
- </input>
- <c:if test="#{component.attributes['showControls']}">
- <span class="rf-ii-btn-prepos">
- <span class="rf-ii-btn-pos">
- <span id="#{clientId}:btnshadow" class="rf-ii-btn-shadow">
- <span class="rf-ii-btn-shdw-t"></span>
- <span class="rf-ii-btn-shdw-l"></span>
- <span class="rf-ii-btn-shdw-r"></span>
- <span class="rf-ii-btn-shdw-b"></span>
-
- <span id="#{clientId}:btn" style="position : relative">
- <input type="image"
- id="#{clientId}:okbtn"
- src="#{getResourcePath(facesContext, 'org.richfaces/ico_ok.gif')}"
- class="rf-ii-btn" onmousedown="this.className='rf-ii-btn-p'"
- onmouseout="this.className='rf-ii-btn'" onmouseup="this.className='rf-ii-btn'" />
- <input type="image"
- id="#{clientId}:cancelbtn"
- src="#{getResourcePath(facesContext,'org.richfaces/ico_cancel.gif')}"
- class="rf-ii-btn" onmousedown="this.className='rf-ii-btn-press'"
- onmouseout="this.className='rf-ii-btn'" onmouseup="this.className='rf-ii-btn'" />
- <br />
+
+ <c:if test="#{!isDisable(inplaceState)}">
+ <input id="#{clientId}:focus" type="image" style="position: absolute; top: 0px; left: 0px; outline-style: none;" class="rf-ii-none"/>
+ <span id="#{clientId}:edit" class="#{getEditStyleClass(component, inplaceState)}">
+ <input id="#{clientId}:input" autocomplete="off" name="#{clientId}"
+ type="text" value="#{getInputValue(facesContext, component)}" class="rf-ii-fld" style="width: #{component.attributes['inputWidth']};" cdk:passThrough="tabIndex">
+ <cdk:call expression="renderInputHandlers(facesContext, component);"/>
+ </input>
+ <c:if test="#{component.attributes['showControls']}">
+ <span class="rf-ii-btn-prepos">
+ <span class="rf-ii-btn-pos">
+ <span id="#{clientId}:btnshadow" class="rf-ii-btn-shadow">
+ <span class="rf-ii-btn-shdw-t"></span>
+ <span class="rf-ii-btn-shdw-l"></span>
+ <span class="rf-ii-btn-shdw-r"></span>
+ <span class="rf-ii-btn-shdw-b"></span>
+
+ <span id="#{clientId}:btn" style="position : relative">
+ <input type="image"
+ id="#{clientId}:okbtn"
+ src="#{getResourcePath(facesContext, 'org.richfaces/ico_ok.gif')}"
+ class="rf-ii-btn" onmousedown="this.className='rf-ii-btn-p'"
+ onmouseout="this.className='rf-ii-btn'" onmouseup="this.className='rf-ii-btn'" />
+ <input type="image"
+ id="#{clientId}:cancelbtn"
+ src="#{getResourcePath(facesContext,'org.richfaces/ico_cancel.gif')}"
+ class="rf-ii-btn" onmousedown="this.className='rf-ii-btn-press'"
+ onmouseout="this.className='rf-ii-btn'" onmouseup="this.className='rf-ii-btn'" />
+ <br />
+ </span>
</span>
</span>
</span>
- </span>
- </c:if>
- </span>
- <script type="text/javascript">
- <cdk:call expression="buildScript(responseWriter, facesContext, component, null);"/>
- </script>
+ </c:if>
+ </span>
+ <script type="text/javascript">
+ <cdk:call expression="buildScript(responseWriter, facesContext, component, null);"/>
+ </script>
+ </c:if>
</span>
</cc:implementation>
</cdk:root>
\ No newline at end of file
Modified: branches/RF-8742/ui/input/ui/src/main/templates/inplaceSelect.template.xml
===================================================================
--- branches/RF-8742/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-10-13 17:50:11 UTC (rev 19557)
+++ branches/RF-8742/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-10-13 18:43:22 UTC (rev 19558)
@@ -37,66 +37,68 @@
<cdk:object type="java.util.List" type-arguments="InplaceSelectBaseRenderer.ClientSelectItem" name="clientSelectItems"
value="#{getConvertedSelectItems(facesContext, component)}" />
- <span id="#{clientId}" class="#{getReadyStyleClass(component, inplaceState)}"
+ <span id="#{clientId}" class="#{getStateStyleClass(component, inplaceState)}"
cdk:passThroughWithExclusions="id class">
<span id="#{clientId}:label" class="rf-is-lbl">
#{inplaceValue}
</span>
- <input id="#{clientId}:focus" type="image" style="position: absolute; top: 0px; left: 0px; outline-style: none;" class="rf-is-none" />
-
- <span id="#{clientId}:edit" class="#{getEditStyleClass(component, inplaceState)}">
- <input id="#{clientId}selValue" name="#{clientId}" type="hidden" value="#{getValue(facesContext, component)}"/>
- <input id="#{clientId}:input" autocomplete="off"
- type="text" value="#{getSelectInputLabel(facesContext, component)}"
- class="rf-is-fld" style="width: #{component.attributes['inputWidth']};" readonly="readonly"
- cdk:passThrough="tabIndex">
- <cdk:call expression="renderInputHandlers(facesContext, component);" />
- </input>
- <c:if test="#{component.attributes['showControls']}">
- <span class="rf-is-btn-prepos">
- <span class="rf-is-btn-pos">
- <span id="#{clientId}:btnshadow" class="rf-is-shdw">
+ <c:if test="#{!isDisable(inplaceState)}">
+ <input id="#{clientId}:focus" type="image" style="position: absolute; top: 0px; left: 0px; outline-style: none;" class="rf-is-none" />
+
+ <span id="#{clientId}:edit" class="#{getEditStyleClass(component, inplaceState)}">
+ <input id="#{clientId}selValue" name="#{clientId}" type="hidden" value="#{getValue(facesContext, component)}"/>
+ <input id="#{clientId}:input" autocomplete="off"
+ type="text" value="#{getSelectInputLabel(facesContext, component)}"
+ class="rf-is-fld" style="width: #{component.attributes['inputWidth']};" readonly="readonly"
+ cdk:passThrough="tabIndex">
+ <cdk:call expression="renderInputHandlers(facesContext, component);" />
+ </input>
+ <c:if test="#{component.attributes['showControls']}">
+ <span class="rf-is-btn-prepos">
+ <span class="rf-is-btn-pos">
+ <span id="#{clientId}:btnshadow" class="rf-is-shdw">
+ <span class="rf-is-shdw-t"></span>
+ <span class="rf-is-shdw-l"></span>
+ <span class="rf-is-shdw-r"></span>
+ <span class="rf-is-shdw-b"></span>
+
+ <span id="#{clientId}:btn" style="position : relative;">
+ <input type="image" id="#{clientId}:okbtn"
+ src="#{getResourcePath(facesContext, 'org.richfaces/ico_ok.gif')}"
+ class="rf-is-btn" onmousedown="this.className='rf-is-btn-press'"
+ onmouseout="this.className='rf-is-btn'" onmouseup="this.className='rf-is-btn'" />
+ <input type="image" id="#{clientId}:cancelbtn"
+ src="#{getResourcePath(facesContext,'org.richfaces/ico_cancel.gif')}"
+ class="rf-is-btn" onmousedown="this.className='rf-is-btn-press'"
+ onmouseout="this.className='rf-is-btn'" onmouseup="this.className='rf-is-btn'" />
+ <br />
+ </span>
+ </span>
+ </span>
+ </span>
+ </c:if>
+ <span id="#{clientId}List" class="rf-is-none rf-is-lst-cord">
+ <span class="rf-is-lst-pos" style="width: #{component.attributes['listWidth']}">
+ <span class="rf-is-shdw">
<span class="rf-is-shdw-t"></span>
<span class="rf-is-shdw-l"></span>
<span class="rf-is-shdw-r"></span>
<span class="rf-is-shdw-b"></span>
-
- <span id="#{clientId}:btn" style="position : relative;">
- <input type="image" id="#{clientId}:okbtn"
- src="#{getResourcePath(facesContext, 'org.richfaces/ico_ok.gif')}"
- class="rf-is-btn" onmousedown="this.className='rf-is-btn-press'"
- onmouseout="this.className='rf-is-btn'" onmouseup="this.className='rf-is-btn'" />
- <input type="image" id="#{clientId}:cancelbtn"
- src="#{getResourcePath(facesContext,'org.richfaces/ico_cancel.gif')}"
- class="rf-is-btn" onmousedown="this.className='rf-is-btn-press'"
- onmouseout="this.className='rf-is-btn'" onmouseup="this.className='rf-is-btn'" />
- <br />
+ <span class="rf-is-lst-dec">
+ <span class="rf-is-lst-scrl" id="#{clientId}Items" style="height: #{component.attributes['listHeight']}">
+ <cdk:call expression="encodeOptions(facesContext, component, clientSelectItems);"/>
+ </span>
</span>
</span>
</span>
</span>
- </c:if>
- <span id="#{clientId}List" class="rf-is-none rf-is-lst-cord">
- <span class="rf-is-lst-pos" style="width: #{component.attributes['listWidth']}">
- <span class="rf-is-shdw">
- <span class="rf-is-shdw-t"></span>
- <span class="rf-is-shdw-l"></span>
- <span class="rf-is-shdw-r"></span>
- <span class="rf-is-shdw-b"></span>
- <span class="rf-is-lst-dec">
- <span class="rf-is-lst-scrl" id="#{clientId}Items" style="height: #{component.attributes['listHeight']}">
- <cdk:call expression="encodeOptions(facesContext, component, clientSelectItems);"/>
- </span>
- </span>
- </span>
- </span>
</span>
- </span>
- <script type="text/javascript">
- <cdk:call expression="buildScript(responseWriter, facesContext, component, clientSelectItems);" />
- </script>
+ <script type="text/javascript">
+ <cdk:call expression="buildScript(responseWriter, facesContext, component, clientSelectItems);" />
+ </script>
+ </c:if>
</span>
</cc:implementation>
</cdk:root>
\ No newline at end of file
Modified: branches/RF-8742/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java
===================================================================
--- branches/RF-8742/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java 2010-10-13 17:50:11 UTC (rev 19557)
+++ branches/RF-8742/ui/input/ui/src/test/java/org/richfaces/renderkit/InplaceInputRendererTest.java 2010-10-13 18:43:22 UTC (rev 19558)
@@ -69,7 +69,7 @@
HtmlElement edit = page.getFirstByXPath("//*[@id = 'form:input_default:edit']");
assertEquals("span", edit.getNodeName());
- assertEquals("rf-ii-e-s rf-ii-none", edit.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
+ assertEquals("rf-ii-edit rf-ii-none", edit.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
HtmlElement input = (HtmlElement)edit.getFirstChild();
assertEquals("input", input.getNodeName());
@@ -87,7 +87,7 @@
HtmlElement span = page.getFirstByXPath("//*[@id = 'form:input_edit']");
assertEquals("span", span.getNodeName());
- assertEquals("rf-ii-d-s", span.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
+ assertEquals("rf-ii-d-s rf-ii-e-s", span.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
HtmlElement label = (HtmlElement)span.getFirstChild();
assertEquals("span", label.getNodeName());
@@ -97,7 +97,7 @@
HtmlElement edit = page.getFirstByXPath("//*[@id = 'form:input_edit:edit']");
assertEquals("span", edit.getNodeName());
- assertEquals("rf-ii-e-s", edit.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
+ assertEquals("rf-ii-edit", edit.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
HtmlElement input = (HtmlElement)edit.getFirstChild();
assertEquals("input", input.getNodeName());
@@ -145,7 +145,7 @@
HtmlElement span = page.getFirstByXPath("//*[@id = 'form:" + inplaceInputId + "']");
span.click();
HtmlElement edit = page.getFirstByXPath("//*[@id = 'form:" + inplaceInputId + ":edit']");
- assertEquals("rf-ii-e-s", edit.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
+ assertEquals("rf-ii-edit", edit.getAttribute(HtmlConstants.CLASS_ATTRIBUTE));
typeNewValue(page, inplaceInputId, value);
}
13 years, 8 months
JBoss Rich Faces SVN: r19557 - in trunk/ui/input/ui/src/main: java/org/richfaces/renderkit and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-10-13 13:50:11 -0400 (Wed, 13 Oct 2010)
New Revision: 19557
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml
Log:
add openOnEdit attribute, fix keyboard navigation
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java 2010-10-13 16:09:22 UTC (rev 19556)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java 2010-10-13 17:50:11 UTC (rev 19557)
@@ -60,7 +60,10 @@
@Attribute
public abstract String getDefaultLabel();
-
+
+ @Attribute(defaultValue="false")
+ public abstract boolean isOpenOnEdit();
+
@Attribute(defaultValue="true")
public abstract boolean isSaveOnBlur();
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2010-10-13 16:09:22 UTC (rev 19556)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2010-10-13 17:50:11 UTC (rev 19557)
@@ -74,6 +74,8 @@
public static final String OPTIONS_SELECT_ITEMS = "selectItems";
public static final String OPTIONS_SELECT_ITEM_VALUE_INPUT = "selValueInput";
+
+ public static final String OPTIONS_VISIBLE = "visible";
protected static final class ClientSelectItem implements ScriptString {
@@ -166,6 +168,7 @@
options.put(OPTIONS_ITEMS_CORD, clientId + "Items");
options.put(OPTIONS_SELECT_ITEMS, additional);
options.put(OPTIONS_SELECT_ITEM_VALUE_INPUT, clientId + "selValue");
+ options.put(OPTIONS_VISIBLE, component.getAttributes().get("openOnEdit"));
}
public void encodeOptions(FacesContext facesContext, UIComponent component,
@@ -227,7 +230,8 @@
}
public String getListStyles(FacesContext facesContext, UIComponent component) {
- return "";
+ AbstractInplaceSelect inplaceSelect = (AbstractInplaceSelect) component;
+ return inplaceSelect.isOpenOnEdit() ? "" : "display: none";
}
public String getReadyStateCss() {
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-10-13 16:09:22 UTC (rev 19556)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-10-13 17:50:11 UTC (rev 19557)
@@ -57,11 +57,14 @@
switch(code) {
case 27:
+ e.preventDefault();
this.cancel();
break;
case 13:
+ e.preventDefault();
this.save();
return false;
+ break;
}
},
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-10-13 16:09:22 UTC (rev 19556)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-10-13 17:50:11 UTC (rev 19557)
@@ -46,13 +46,15 @@
},
processItem: function(event, element) {
- var key = $(element).attr("id");
- var value = this.getItemValue(key);
- this.saveItemValue(value);
+ if(element) {
+ var key = $(element).attr("id");
+ var value = this.getItemValue(key);
+ this.saveItemValue(value);
+ var label = this.getItemLabel(key);
+ //inplace label
+ this.setValue(label);
+ }
- var label = this.getItemLabel(key);
- //inplace label
- this.setValue(label);
this.select.hide();
this.openPopup = false;
this.__setInputFocus();
@@ -81,7 +83,6 @@
},
__keydownHandler: function(e) {
- $super.__keydownHandler(e);
var code;
@@ -91,17 +92,30 @@
code = e.which;
}
- switch(code) {
- case rf.KEYS.DOWN:
- e.preventDefault();
- this.select.__onKeyDown(e);
- break;
-
- case rf.KEYS.UP:
- e.preventDefault();
- this.select.__onKeyUp(e);
- break;
- }
+ if(this.select.isVisible()) {
+ switch(code) {
+ case rf.KEYS.DOWN:
+ e.preventDefault();
+ this.select.__onKeyDown(e);
+ this.__setInputFocus();
+ break;
+
+ case rf.KEYS.UP:
+ e.preventDefault();
+ this.select.__onKeyUp(e);
+ this.__setInputFocus();
+ break;
+
+ case rf.KEYS.RETURN:
+ e.preventDefault();
+ this.select.__onEnter(e);
+ return false;
+ break;
+ }
+ }
+
+ $super.__keydownHandler.call(this,e);
+
},
__blurHandler: function(e) {
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js 2010-10-13 16:09:22 UTC (rev 19556)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popup.js 2010-10-13 17:50:11 UTC (rev 19557)
@@ -6,8 +6,8 @@
this.id = id;
this.attachToDom(id);
this.popup = $(document.getElementById(id));
- this.visible = options.visible;
-
+
+ this.visible = options.visible;;
this.popup.bind("mouseover", $.proxy(this.__onMouseOver, this));
this.popup.bind("click", $.proxy(this.__onClick, this));
};
@@ -23,11 +23,13 @@
show: function() {
this.popup.css('display', '');
+ //add attachToBody logic
this.visible = true;
},
hide: function() {
this.popup.css('display', 'none');
+ //add attachToBody logic
this.visible = false;
},
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2010-10-13 16:09:22 UTC (rev 19556)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2010-10-13 17:50:11 UTC (rev 19557)
@@ -16,7 +16,6 @@
//TODO: from option map?
this.index = -1;
- this.visible = false;
this.__updateItemsList();
};
@@ -97,6 +96,11 @@
//remove event, rename ???
__onEnter: function(e) {
+ var item;
+ if(this.items) {
+ item = this.items.eq(this.index);
+ this.processItem(e, item);
+ }
},
//remove event, rename
Modified: trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-10-13 16:09:22 UTC (rev 19556)
+++ trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-10-13 17:50:11 UTC (rev 19557)
@@ -79,7 +79,7 @@
</span>
</span>
</c:if>
- <span id="#{clientId}List" class="rf-is-lst-cord">
+ <span id="#{clientId}List" style="#{getListStyles(facesContext, component)}" class="rf-is-lst-cord">
<span class="rf-is-lst-pos" style="width: #{component.attributes['listWidth']}">
<span class="rf-is-shdw">
<span class="rf-is-shdw-t"></span>
13 years, 8 months
JBoss Rich Faces SVN: r19556 - sandbox/trunk/ui/calendar/ui/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-10-13 12:09:22 -0400 (Wed, 13 Oct 2010)
New Revision: 19556
Modified:
sandbox/trunk/ui/calendar/ui/src/main/templates/calendar.template.xml
Log:
RF-9169
Modified: sandbox/trunk/ui/calendar/ui/src/main/templates/calendar.template.xml
===================================================================
--- sandbox/trunk/ui/calendar/ui/src/main/templates/calendar.template.xml 2010-10-13 15:35:34 UTC (rev 19555)
+++ sandbox/trunk/ui/calendar/ui/src/main/templates/calendar.template.xml 2010-10-13 16:09:22 UTC (rev 19556)
@@ -35,8 +35,137 @@
<cdk:resource-dependency name="jquery.position.js" />
</cc:interface>
<cc:implementation>
- <span id="#{clientId}" class="rf-" >
- <script type="text/javascript">console.log("calendar")</script>
+ <span id="#{clientId}" class="rf-ca #{component.attributes['styleClass']}" cdk:passThroughWithExclusions="id class">
+ <span id="#{clientId}Popup" style="#{component.attributes['popup'] ? '' : 'display: none'}">
+ <c:choose>
+ <c:when test="#{!component.attributes['popup']}" >
+ <input id="#{clientId}InputDate" autocomplete="off" style="display:none" name="#{clientId}InputDate"
+ value="#{this:getInputValue(facesContext,component)}" type="hidden" />
+ </c:when>
+ <c:otherwise>
+ <input id="#{clientId}InputDate"
+ name="#{clientId}InputDate"
+ value="#{this:getInputValue(facesContext,component)}" type="#{component.attributes['showInput'] ? 'text' : 'hidden'}"
+ disabled="#{component.attributes['disabled']}"
+ accesskey="#{component.attributes['accesskey']}"
+ maxlength="#{component.attributes['maxlength']}"
+ onchange="#{component.attributes['oninputchange']}"
+ onselect="#{component.attributes['oninputselect']}"
+ onfocus="#{component.attributes['oninputfocus']}"
+ onblur="#{component.attributes['oninputblur']}"
+ onclick="#{component.attributes['oninputclick']}"
+ onkeypress="#{component.attributes['oninputkeypress']}"
+ onkeydown="#{component.attributes['oninputkeydown']}"
+ onkeyup="#{component.attributes['oninputkeyup']}"
+ onmouseover="#{component.attributes['oninputmouseover']}"
+ onmouseout="#{component.attributes['oninputmouseout']}"
+ size="#{component.attributes['inputSize']}"
+ style="vertical-align: middle; #{component.attributes['inputStyle']}"
+ class="rich-calendar-input #{component.attributes['inputClass']}"
+ tabindex="#{component.attributes['tabindex']}"
+ readonly="#{!component.attributes['enableManualInput'] || component.attributes['readonly']}" />
+
+ <!--jsp:scriptlet>
+ <![CDATA[
+ String buttonIconAttr = (String) component.getAttributes().get("buttonIcon");
+ String buttonIcon = buttonIconAttr == null || buttonIconAttr.length() < 1 ? null :
+ org.richfaces.component.util.ViewUtil.getResourceURL(buttonIconAttr, facesContext);
+ String buttonIconDisabledAttr =(String) component.getAttributes().get("buttonIconDisabled");
+ String buttonIconDisabled = buttonIconDisabledAttr == null || buttonIconDisabledAttr.length() < 1 ? null :
+ org.richfaces.component.util.ViewUtil.getResourceURL(buttonIconDisabledAttr, facesContext);
+ String buttonLabel = (String) component.getAttributes().get("buttonLabel");
+ variables.setVariable("buttonLabel",buttonLabel);
+ variables.setVariable("buttonIconDisabled",buttonIconDisabled);
+ variables.setVariable("buttonIcon",buttonIcon);
+ if(buttonLabel==null || buttonLabel.length()==0){
+ ]]>
+ </jsp:scriptlet><img id="#{clientId}PopupButton" alt=""
+ class="rich-calendar-button #{component.attributes['buttonClass']}"
+ accesskey="#{component.attributes['accesskey']}"
+ style="vertical-align: middle"
+ tabindex="#{component.attributes['tabindex']}">
+ <jsp:scriptlet>
+ <![CDATA[
+ if(!disabled){
+ if(buttonIcon==null){
+ getUtils().writeAttribute(writer, "src", variables.getVariable("icon"));
+ }
+ else{
+ getUtils().writeAttribute(writer, "src", buttonIcon);
+ }
+ }
+ else{
+
+ //getUtils().writeAttribute(writer, "onclick", null);
+ if(buttonIconDisabled==null){
+ getUtils().writeAttribute(writer, "src", variables.getVariable("disabledIcon"));
+ }
+ else{
+ getUtils().writeAttribute(writer, "src", buttonIconDisabled);
+ }
+ }
+ ]]>
+ </jsp:scriptlet> </img> <jsp:scriptlet>
+ <![CDATA[
+ }
+ else{
+ ]]>
+ </jsp:scriptlet-->
+ <button type="button" id="#{clientId}PopupButton" name="#{clientId}PopupButton"
+ style="vertical-align: middle"
+ class="rich-calendar-button #{component.attributes['buttonClass']}"
+ tabindex="#{component.attributes['tabindex']}" disabled="#{component.attributes['disabled']}">
+ #{component.attributes['buttonLabel']}</button>
+ </c:otherwise>
+ </c:choose>
+ <input id="#{clientId}InputCurrentDate"
+ style="display:none"
+ autocomplete="off"
+ name="#{clientId}InputCurrentDate"
+ value="#{component.attributes['currentDate']}" type="hidden" />
+ </span>
+ <div style="display: none;" id="#{clientId}">
+ </div>
+ <!--cdk:scriptObject var="options" >
+ <cdk:scriptOption attributes="enableManualInput, disabled, readonly, resetTimeOnDateSelect, showApplyButton, styleClass, minDaysInFirstWeek" />
+ <cdk:scriptOption attributes="popup" defaultValue="true" />
+ <cdk:scriptOption attributes="showInput" defaultValue="true" />
+ <cdk:scriptOption attributes="ajaxSingle" defaultValue="true" />
+ <cdk:scriptOption attributes="showHeader" defaultValue="true" />
+ <cdk:scriptOption attributes="showFooter" defaultValue="true" />
+ <cdk:scriptOption attributes="showWeeksBar" defaultValue="true" />
+ <cdk:scriptOption attributes="showWeekDaysBar" defaultValue="true" />
+ <cdk:scriptOption attributes="todayControlMode" defaultValue="select" />
+ <cdk:scriptOption attributes="datePattern" defaultValue="MMM d, yyyy" />
+ <cdk:scriptOption attributes="jointPoint" defaultValue="bottom-left" />
+ <cdk:scriptOption attributes="direction" defaultValue="bottom-right" />
+ <cdk:scriptOption attributes="boundaryDatesMode" defaultValue="inactive" />
+ <cdk:scriptOption attributes="horizontalOffset" defaultValue="0" />
+ <cdk:scriptOption attributes="verticalOffset" defaultValue="0" />
+ <cdk:scriptOption attributes="hidePopupOnScroll" defaultValue="true" />
+
+ <cdk:scriptOption name="currentDate" value="#{this:getCurrentDate(facesContext, component, currentDate)}" />
+ <cdk:scriptOption name="selectedDate" value="#{this:getSelectedDate(facesContext, component)}" />
+ <cdk:scriptOption name="style" value="z-index: #{component.attributes['zindex']}; #{component.attributes['style']}" defaultValue="z-index: 3; "/>
+ <cdk:scriptOption name="submitFunction" value="#{this:getSubmitFunction(facesContext, component)}" />
+ <cdk:scriptOption name="dayCellClass" value="#{this:getDayCellClass(facesContext, component)}" />
+ <cdk:scriptOption name="dayStyleClass" value="#{this:getDayStyleClass(facesContext, component)}" />
+ <cdk:scriptOption name="isDayEnabled" value="#{this:getIsDayEnabled(facesContext, component)}" />
+
+ <cdk:scriptOption attributes="ondateselected, ondateselect, ontimeselect, ontimeselected, onchanged, ondatemouseover, ondatemouseout, onexpand, oncollapse, oncurrentdateselect, oncurrentdateselected" wrapper="eventHandler" />
+ <cdk:scriptOption name="labels" value="#{this:getLabels(facesContext, component)}" />
+ <cdk:scriptOption name="defaultTime" value="#{this:getPreparedDefaultTime(component)}" />
+ </cdk:scriptObject>
+ <script type="text/javascript">
+ new Calendar('#{clientId}',
+ <c:if test="#{not empty options}">
+ "#{options}"
+ </c:if>
+ <c:if test="#{empty options}">
+ {}
+ </c:if>
+ ).load();
+ </script-->
</span>
</cc:implementation>
</cdk:root>
13 years, 8 months