Author: pyaschenko
Date: 2010-07-19 11:16:14 -0400 (Mon, 19 Jul 2010)
New Revision: 18152
Modified:
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.js
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoCompleteBase.js
root/ui-sandbox/inputs/trunk/combobox/src/main/templates/comboBox.template.xml
Log:
https://jira.jboss.org/browse/RF-8875
Modified:
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.js
===================================================================
---
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.js 2010-07-19
14:53:22 UTC (rev 18151)
+++
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.js 2010-07-19
15:16:14 UTC (rev 18152)
@@ -56,12 +56,12 @@
rf.ui = rf.ui || {};
// Constructor definition
- rf.ui.ComboBox = function(componentId, fieldId, options) {
+ rf.ui.AutoComplete = function(componentId, fieldId, options) {
this.namespace = "."+rf.Event.createNamespace(this.name, this.componentId);
this.options = {};
// call constructor of parent class
$super.constructor.call(this, componentId+ID.SELECT, fieldId, options);
- this.attachToDom.call(this, componentId);
+ this.attachToDom(componentId);
this.componentId = componentId;
this.options = $.extend(this.options, defaultOptions, options);
this.inputValue = this.getInputValue();
@@ -71,20 +71,19 @@
updateItemsList.call(this, "");
};
- var $p ={};
-
// Extend component class and add protected methods from parent class to our container
- $p = rf.ui.SelectBase.extend(rf.ui.SelectBase, rf.ui.ComboBox, $p);
+ rf.ui.AutoCompleteBase.extend(rf.ui.AutoComplete);
// define super class link
- var $super = rf.ui.ComboBox.$super;
+ var $super = rf.ui.AutoComplete.$super;
var defaultOptions = {
selectedItemClass:'cb_select',
autoFill:true,
minChars:1,
selectFirst:true,
- ajaxMode:true
+ ajaxMode:true,
+ attachToBody:true
};
var ID = {
@@ -179,9 +178,9 @@
rf.ajax(this.componentId, event, {parameters: params, error: ajaxError,
complete:ajaxSuccess});
};
- $.extend(rf.ui.ComboBox.prototype, (function () {
+ $.extend(rf.ui.AutoComplete.prototype, (function () {
return {
- name:"CompoBox",
+ name:"AutoComplete",
destroy: function () {
//TODO: add all unbind
rf.Event.unbind(rf.getDomElement(this.componentId+ID.ITEMS).parentNode,
this.namespace);
Modified:
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoCompleteBase.js
===================================================================
---
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoCompleteBase.js 2010-07-19
14:53:22 UTC (rev 18151)
+++
root/ui-sandbox/inputs/trunk/combobox/src/main/resources/META-INF/resources/org.richfaces/AutoCompleteBase.js 2010-07-19
15:16:14 UTC (rev 18152)
@@ -41,7 +41,7 @@
rf.ui = rf.ui || {};
// Constructor definition
- rf.ui.SelectBase = function(selectId, fieldId, options) {
+ rf.ui.AutoCompleteBase = function(selectId, fieldId, options) {
// call constructor of parent class
$super.constructor.call(this, selectId);
this.selectId = selectId;
@@ -52,13 +52,11 @@
bindEventHandlers.call(this);
};
- var $p ={};
-
// Extend component class and add protected methods from parent class to our container
- $p = rf.BaseComponent.extend(rf.BaseComponent, rf.ui.SelectBase, $p);
+ rf.BaseComponent.extend(rf.ui.AutoCompleteBase);
// define super class link
- var $super = rf.ui.SelectBase.$super;
+ var $super = rf.ui.AutoCompleteBase.$super;
var defaultOptions = {
changeDelay:8
@@ -202,9 +200,9 @@
}
}
- $.extend(rf.ui.SelectBase.prototype, (function () {
+ $.extend(rf.ui.AutoCompleteBase.prototype, (function () {
return {
- name:"SelectBase",
+ name:"AutoCompleteBase",
show: function (event) {
if (!this.isVisible) {
if (this.onBeforeShow(event)!=false) {
Modified: root/ui-sandbox/inputs/trunk/combobox/src/main/templates/comboBox.template.xml
===================================================================
---
root/ui-sandbox/inputs/trunk/combobox/src/main/templates/comboBox.template.xml 2010-07-19
14:53:22 UTC (rev 18151)
+++
root/ui-sandbox/inputs/trunk/combobox/src/main/templates/comboBox.template.xml 2010-07-19
15:16:14 UTC (rev 18152)
@@ -40,7 +40,7 @@
</div>
</div>
<script type="text/javascript">
- new RichFaces.ui.ComboBox("#{clientId}",
+ new RichFaces.ui.AutoComplete("#{clientId}",
"#{clientId}Input", {buttonId:"#{clientId}Button",
selectedItemClass:'cb_select'});
</script>