From this link we know about function "setValue" of rich:autocomplete component.
But this method not working in Safari and Chromium browsers and works fine in Firefox.
Example:
{code}
#{rich:component('id_component')}.setValue(null)
{code}
After this call in Firefox input value is erased, but in Chromium(maybe in Chrome too) and Safari nothing happens(value not erasing).
To fix this, we must modify AutocompleteBase.js file:
Find "updateInputValue" function:
{code}
var updateInputValue = function (value) {
if (this.fieldId) {
rf.getDomElement(this.fieldId).value = value;
return value;
} else {
return "";
}
};
{code}
and replace as below:
{code}
var updateInputValue = function (value) {
if (this.fieldId) {
$(rf.getDomElement(this.fieldId)).val(value);
return value;
} else {
return "";
}
};
{code}
Main idea is to use .val() function of jQuery insted ".value=" .
P.S. I use Richfaces 4.3.1
Comments