Author: pyaschenko
Date: 2010-09-01 06:00:55 -0400 (Wed, 01 Sep 2010)
New Revision: 19061
Modified:
branches/autocomplete/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteRendererBase.java
branches/autocomplete/ui/input/ui/src/main/templates/autocomplete.template.xml
Log:
https://jira.jboss.org/browse/RF-9180
bug fixes
Modified:
branches/autocomplete/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteRendererBase.java
===================================================================
---
branches/autocomplete/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteRendererBase.java 2010-09-01
09:00:11 UTC (rev 19060)
+++
branches/autocomplete/ui/input/ui/src/main/java/org/richfaces/renderkit/AutocompleteRendererBase.java 2010-09-01
10:00:55 UTC (rev 19061)
@@ -79,7 +79,6 @@
utils.addToScriptHash(options, "buttonId", component.getClientId() +
"Button");
utils.addToScriptHash(options, "selectedItemClass",
attributes.get("selectedItemClass"));
utils.addToScriptHash(options, "minChars",
attributes.get("minChars"), "1");
- utils.addToScriptHash(options, "mode",
attributes.get("mode"), "ajax");
utils.addToScriptHash(options, "filterFunction",
attributes.get("filterFunction"));
utils.addToScriptHash(options, "autofill",
attributes.get("autofill"), "true");
utils.addToScriptHash(options, "disabled",
attributes.get("disabled"), "false");
@@ -90,12 +89,16 @@
utils.addToScriptHash(options, "onerror",
attributes.get("onerror"));
utils.addToScriptHash(options, "onbeforedomupdate",
attributes.get("onbeforedomupdate"));
utils.addToScriptHash(options, "onchange",
attributes.get("onchange"));
- if (attributes.get("mode") != null) {
- if (attributes.get("mode").equals("ajax")){
- utils.addToScriptHash(options, "isCachedAjax", false,
"true");
- } else if (attributes.get("mode").equals("client")) {
- utils.addToScriptHash(options, "ajaxMode", false,
"true");
- }
+ String mode = (String)attributes.get("mode");
+ if (mode != null) {
+ if (mode.equals("ajax")){
+ utils.addToScriptHash(options, "isCachedAjax", false,
"true");
+ } else if (mode.equals("client") ||
mode.equals("lazyClient")) {
+ utils.addToScriptHash(options, "ajaxMode", false,
"true");
+ if (mode.equals("lazyClient")) {
+ utils.addToScriptHash(options, "lazyClientMode", true,
"false");
+ }
+ }
}
StringBuilder builder = new StringBuilder();
builder.append(ScriptUtils.toScript(options));
@@ -218,13 +221,11 @@
if (mode!= null && mode.equals("client")) {
List<Object> fetchValues = new ArrayList<Object>();
this.encodeItems(facesContext, component, fetchValues);
- } else if (mode!= null && mode.equals("lazyClient")){
+ } else {
strategy.encodeItemsContainerBegin(facesContext, component);
+ // TODO: is it needed
+ //strategy.encodeFakeItem(facesContext, component);
strategy.encodeItemsContainerEnd(facesContext, component);
- } else{
- strategy.encodeItemsContainerBegin(facesContext, component);
- strategy.encodeFakeItem(facesContext, component);
- strategy.encodeItemsContainerEnd(facesContext, component);
}
}
@@ -251,7 +252,7 @@
writer.writeText(item, null);
}
}
-
+ strategy.encodeItemEnd(facesContext, comboBox);
}
private AutocompleteEncodeStrategy getStrategy(UIComponent component) {
Modified: branches/autocomplete/ui/input/ui/src/main/templates/autocomplete.template.xml
===================================================================
---
branches/autocomplete/ui/input/ui/src/main/templates/autocomplete.template.xml 2010-09-01
09:00:11 UTC (rev 19060)
+++
branches/autocomplete/ui/input/ui/src/main/templates/autocomplete.template.xml 2010-09-01
10:00:55 UTC (rev 19061)
@@ -29,7 +29,7 @@
onmouseout="#{component.attributes['onmouseout']}"
onkeyup="#{component.attributes['onkeyup']}"
onkeydown="#{component.attributes['onkeydown']}"
- onkeypress="#{component.attributes['onkeypress']}"
id="#{clientId}Input" value="#{component.attributes['value']}"
disabled="#{disabled}" name="#{clientId}" type="text"
class="rf-au-font rf-au-input" />
+ onkeypress="#{component.attributes['onkeypress']}"
id="#{clientId}Input" value="#{component.attributes['value']}"
disabled="#{disabled}" name="#{clientId}" type="text"
class="rf-au-font rf-au-input" autocomplete="off"/>
<c:if
test="#{component.attributes['showButton']}">
<c:if
test="#{component.attributes['disabled']}">
<div id="#{clientId}Button"
class="rf-au-button">