Author: amarkhel
Date: 2011-01-06 07:00:31 -0500 (Thu, 06 Jan 2011)
New Revision: 20904
Added:
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutoCompleteBean.java
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/CountriesBean.java
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/Country.java
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutClientMode.xmlunit.xml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutTest.xhtml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutClientMode.xmlunit.xml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutTest.xhtml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/countries.xml
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/countries.xsd
Modified:
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml
Log:
RF-9072 Unit tests development for autocomplete component
Added: trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutoCompleteBean.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutoCompleteBean.java
(rev 0)
+++
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutoCompleteBean.java 2011-01-06
12:00:31 UTC (rev 20904)
@@ -0,0 +1,105 @@
+/*
+ * 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.renderkit;
+
+import java.io.Serializable;
+import java.util.Locale;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Collections2;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class AutoCompleteBean implements Serializable {
+
+ private static final long serialVersionUID = 3072125097847582809L;
+
+ private class CountryNamePredicate implements Predicate<Country> {
+
+ private String countryNamePrefix;
+
+ public CountryNamePredicate(String countryNamePrefix) {
+ super();
+ this.countryNamePrefix = countryNamePrefix;
+ }
+
+ public boolean apply(Country input) {
+ if (countryNamePrefix == null || countryNamePrefix.length() == 0) {
+ return true;
+ }
+
+ return input.getName().toLowerCase(Locale.US).startsWith(countryNamePrefix);
+ }
+ }
+
+ private String value;
+
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ private String mode = "client";
+
+ public String getMode() {
+ return mode;
+ }
+
+ public void setMode(String mode) {
+ this.mode = mode;
+ }
+
+ private String layout = "list";
+ public String getLayout() {
+ return layout;
+ }
+
+ public void setLayout(String layout) {
+ this.layout = layout;
+ }
+
+ private CountriesBean countriesBean;
+
+ public void setCountriesBean(CountriesBean countriesBean) {
+ this.countriesBean = countriesBean;
+ }
+
+ public Object autocomplete(FacesContext facesContext, UIComponent component, String
value) {
+ // for tests when value does not starts with prefix
+ /*String str = value;
+ if (str.charAt(0)=='i') {
+ str = str.substring(1);
+ }*/
+ String v = mode.equals("lazyClient") || mode.equals("client")
? "" : value;
+ return Collections2.filter(countriesBean.getCountries(), new
CountryNamePredicate(v.toLowerCase()));
+ }
+
+}
Added:
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java
(rev 0)
+++
trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java 2011-01-06
12:00:31 UTC (rev 20904)
@@ -0,0 +1,131 @@
+package org.richfaces.renderkit;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.net.URISyntaxException;
+import java.util.List;
+
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.Difference;
+import org.custommonkey.xmlunit.DifferenceListener;
+import org.custommonkey.xmlunit.IgnoreTextAndAttributeValuesDifferenceListener;
+import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
+import org.junit.Assert;
+import org.junit.Test;
+import org.richfaces.renderkit.html.RendererTestBase;
+import org.xml.sax.SAXException;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlInput;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+public class AutocompleteRendererTest extends RendererTestBase {
+
+ @Override
+ public void setUp() throws URISyntaxException {
+ environment = new HtmlUnitEnvironment();
+ environment.withWebRoot(new
File(this.getClass().getResource(".").toURI()));
+ environment.withResource("/WEB-INF/faces-config.xml",
"org/richfaces/renderkit/faces-config.xml");
+ environment.start();
+ }
+
+ @Test
+ public void testListLayoutRender() throws Exception {
+ doTest("autocompleteListLayoutTest",
"autocompleteListLayoutClientMode", "form:myAutocomplete");
+ }
+
+ @Test
+ public void testDivLayoutRender() throws Exception {
+ doTest("autocompleteDivLayoutTest",
"autocompleteDivLayoutClientMode", "form:myAutocomplete");
+ }
+
+ @Test
+ public void testSetValueDivLayout() throws Exception {
+ HtmlPage page =
environment.getPage("/autocompleteDivLayoutTest.jsf");
+ HtmlElement autocompleteList =
page.getElementById("form:myAutocompleteList");
+ Assert.assertNotNull(autocompleteList);
+
+ List<?> coutnryList =
autocompleteList.getByXPath("div/div/div/div/div");
+ Assert.assertEquals(30, coutnryList.size());
+
+ HtmlInput input = (HtmlInput)
page.getElementById("form:myAutocompleteInput");
+ Assert.assertNotNull(input);
+ input.type("al");
+
+ //try 5 times to wait .5 second each for filling the page.
+ for (int i = 0; i < 5; i++) {
+ synchronized (page) {
+ page.wait(500);
+ }
+ }
+
+ autocompleteList = page.getElementById("form:myAutocompleteList");
+ Assert.assertNotNull(autocompleteList);
+
+ coutnryList = autocompleteList.getByXPath("div/div/div/div/div");
+ Assert.assertEquals(2, coutnryList.size());
+ }
+
+ @Test
+ public void testSetValueListLayout() throws Exception {
+ HtmlPage page =
environment.getPage("/autocompleteListLayoutTest.jsf");
+ HtmlElement autocompleteList =
page.getElementById("form:myAutocompleteList");
+ Assert.assertNotNull(autocompleteList);
+
+ List<?> coutnryList =
autocompleteList.getByXPath("div/div/div/ul/li");
+ Assert.assertEquals(30, coutnryList.size());
+
+ HtmlInput input = (HtmlInput)
page.getElementById("form:myAutocompleteInput");
+ Assert.assertNotNull(input);
+ input.type("be");
+
+ //try 5 times to wait .5 second each for filling the page.
+ for (int i = 0; i < 5; i++) {
+ synchronized (page) {
+ page.wait(500);
+ }
+ }
+
+ autocompleteList = page.getElementById("form:myAutocompleteList");
+ Assert.assertNotNull(autocompleteList);
+
+ coutnryList = autocompleteList.getByXPath("div/div/div/ul/li");
+ Assert.assertEquals(5, coutnryList.size());
+ }
+
+ @Override
+ protected void checkXmlStructure(String pageName, String xmlunitPageName, String
pageCode) throws SAXException,
+ IOException {
+ if(xmlunitPageName == null) {
+ xmlunitPageName = pageName + ".xmlunit.xml";
+ }
+ InputStream expectedPageCode =
this.getClass().getResourceAsStream(xmlunitPageName + ".xmlunit.xml");
+ if (expectedPageCode == null) {
+ return;
+ }
+
+ Diff xmlDiff = new Diff(new StringReader(pageCode), new
InputStreamReader(expectedPageCode));
+
xmlDiff.overrideDifferenceListener(getDifferenceListener("jquery\\d*"));
+ Assert.assertTrue("XML was not similar:" + xmlDiff.toString(),
xmlDiff.similar());
+ }
+
+ private DifferenceListener getDifferenceListener(final String skipAttribute) {
+ return new IgnoreTextAndAttributeValuesDifferenceListener() {
+ @Override
+ public int differenceFound(Difference difference) {
+ String controlNameAttribute =
difference.getControlNodeDetail().getValue();
+ String testNameAttribute = difference.getTestNodeDetail().getValue();
+ if (controlNameAttribute.matches(skipAttribute) ||
+ testNameAttribute.matches(skipAttribute)) {
+ return RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR;
+ }
+ else {
+ return super.differenceFound(difference);
+ }
+ }
+ };
+ }
+}
Added: trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/CountriesBean.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/CountriesBean.java
(rev 0)
+++ trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/CountriesBean.java 2011-01-06
12:00:31 UTC (rev 20904)
@@ -0,0 +1,76 @@
+/*
+ * 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.renderkit;
+
+import java.net.URL;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.FacesException;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author nick
+ *
+ */
+public class CountriesBean {
+
+ private List<Country> countries;
+
+ @XmlRootElement(name = "countries", namespace = Country.NAMESPACE)
+ private static class Countries {
+
+ @XmlElement(name = "country", namespace = Country.NAMESPACE)
+ private List<Country> countries;
+
+ public List<Country> getCountries() {
+ return countries;
+ }
+ }
+
+ public CountriesBean() {
+ }
+
+ @PostConstruct
+ public void initialize() {
+ try {
+ JAXBContext countryContext = JAXBContext.newInstance(Countries.class);
+ Unmarshaller unmarshaller = countryContext.createUnmarshaller();
+
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ URL dataUrl =
classLoader.getResource("org/richfaces/renderkit/countries.xml");
+ Countries cntr = (Countries) unmarshaller.unmarshal(dataUrl);
+ countries = cntr.getCountries();
+ } catch (JAXBException e) {
+ throw new FacesException(e.getMessage(), e);
+ }
+ }
+
+ public List<Country> getCountries() {
+ return countries;
+ }
+}
Added: trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/Country.java
===================================================================
--- trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/Country.java
(rev 0)
+++ trunk/ui/input/ui/src/test/java/org/richfaces/renderkit/Country.java 2011-01-06
12:00:31 UTC (rev 20904)
@@ -0,0 +1,79 @@
+/*
+ * 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.renderkit;
+
+import javax.xml.bind.annotation.XmlElement;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Objects.ToStringHelper;
+
+/**
+ * @author nick
+ *
+ */
+public class Country {
+
+ public static final String NAMESPACE =
"http://richfaces.org/test/countries";
+
+ private String name;
+
+ private String iso;
+
+ private String domain;
+
+ @XmlElement(namespace = Country.NAMESPACE)
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getIso() {
+ return iso;
+ }
+
+ @XmlElement(namespace = Country.NAMESPACE)
+ public void setIso(String iso) {
+ this.iso = iso;
+ }
+
+ public String getDomain() {
+ return domain;
+ }
+
+ @XmlElement(namespace = Country.NAMESPACE)
+ public void setDomain(String domain) {
+ this.domain = domain;
+ }
+
+ @Override
+ public String toString() {
+ ToStringHelper helper = Objects.toStringHelper(this);
+
+ helper.add("name", name).add("iso",
iso).add("domain", domain);
+
+ return helper.toString();
+ }
+}
Added:
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutClientMode.xmlunit.xml
===================================================================
---
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutClientMode.xmlunit.xml
(rev 0)
+++
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutClientMode.xmlunit.xml 2011-01-06
12:00:31 UTC (rev 20904)
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <div class="rf-au-fld" id="form:myAutocomplete">
+ <input class="rf-au-fnt rf-au-inp"
id="form:myAutocompleteValue" name="form:myAutocompleteValue"
type="hidden"/>
+ <div style="position : relative; overflow : hidden; text-align : left;
padding-right : 21px;">
+ <input autocomplete="off" class="rf-au-fnt rf-au-inp"
id="form:myAutocompleteInput" name="form:myAutocomplete"
type="text"/>
+ <div class="rf-au-btn"
id="form:myAutocompleteButton">
+ <div class="rf-au-btn-arrow">
+ </div>
+ </div>
+ </div>
+ <div class="rf-au-lst-cord"
id="form:myAutocompleteList">
+ <div class="rf-au-shdw">
+ <div class="rf-au-shdw-t">
+ </div>
+ <div class="rf-au-shdw-l">
+ </div>
+ <div class="rf-au-shdw-r">
+ </div>
+ <div class="rf-au-shdw-b">
+ </div>
+ <div class="rf-au-lst-dcrtn">
+ <div class="rf-au-lst-scrl">
+ <div id="" jquery1294309401675=""
align="" accesskey="" tabindex="" children=""
outerhtml="" lang="" scrollwidth="" scopename=""
title="" scrollheight="" document="" innerhtml=""
style="" clienttop="" dir="" scrolltop=""
classname="" offsettop="" clientwidth="" all=""
currentstyle="" runtimestyle="" uniqueid=""
innertext="" parentelement="" offsetheight=""
clientleft="" offsetparent="" tagname=""
scrollleft="" attributes="" language=""
offsetleft="" offsetwidth="" disabled="">
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Afghanistan AF/AFG/4 .af
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Albania AL/ALB/8 .al
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Algeria DZ/DZA/12 .dz
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ American Samoa AS/ASM/16 .as
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Andorra AD/AND/20 .ad
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Angola AO/AGO/24 .ao
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Anguilla AI/AIA/660 .ai
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Antarctica AQ/ATA/10 .aq
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Antigua and Barbuda AG/ATG/28 .ag
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Argentina AR/ARG/32 .ar
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Armenia AM/ARM/51 .am
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Aruba AW/ABW/533 .aw
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Ashmore and Cartier Islands -/-/- -
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Australia AU/AUS/36 .au
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Austria AT/AUT/40 .at
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Azerbaijan AZ/AZE/31 .az
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bahamas, The BS/BHS/44 .bs
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bahrain BH/BHR/48 .bh
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Baker Island -/-/- -
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bangladesh BD/BGD/50 .bd
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Barbados BB/BRB/52 .bb
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bassas da India -/-/- -
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Belarus BY/BLR/112 .by
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Belgium BE/BEL/56 .be
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Belize BZ/BLZ/84 .bz
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Benin BJ/BEN/204 .bj
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bermuda BM/BMU/60 .bm
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bhutan BT/BTN/64 .bt
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bolivia BO/BOL/68 .bo
+
+ </div>
+ <div class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bosnia and Herzegovina BA/BIH/70 .ba
+
+ </div>
+ </div>
+ <script type="text/javascript">
+//<![CDATA[
+new
RichFaces.ui.Autocomplete.setData("form:myAutocompleteItems",["Afghanistan","Albania","Algeria","American
Samoa","Andorra","Angola","Anguilla","Antarctica","Antigua
and
Barbuda","Argentina","Armenia","Aruba","Ashmore
and Cartier
Islands","Australia","Austria","Azerbaijan","Bahamas,
The","Bahrain","Baker
Island","Bangladesh","Barbados","Bassas da
India","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia
and Herzegovina"] )
+//]]>
+ </script>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script type="text/javascript">
+//<![CDATA[
+new RichFaces.ui.Autocomplete("form:myAutocomplete",
+ "form:myAutocompleteInput",
{"buttonId":"form:myAutocompleteButton","autofill":false,"minChars":2,"onchange":function(event){RichFaces.ajax(this,event,{"parameters":{"javax.faces.behavior.event":"change"}
,"sourceId":"form:myAutocomplete"} )},"ajaxMode":false}
+ );
+//]]>
+ </script>
+ </div>
Added:
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutTest.xhtml
===================================================================
---
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutTest.xhtml
(rev 0)
+++
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteDivLayoutTest.xhtml 2011-01-06
12:00:31 UTC (rev 20904)
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:input="http://richfaces.org/input"
+
xmlns:rich="http://richfaces.org/iteration"
+
xmlns:a4j="http://richfaces.org/a4j">
+<f:view contentType="text/html" />
+<h:head>
+ <title>Richfaces Autocomplete</title>
+</h:head>
+<h:body>
+ <h:form id="form">
+ <input:autocomplete autofill="false" id="myAutocomplete"
+ mode="#{autoCompleteBean.mode}"
+ minChars="2"
+ autocompleteMethod="#{autoCompleteBean.autocomplete}"
+ var="country" fetchValue="#{country.name}"
+ showButton="true"
+ value = "#{autoCompleteBean.value}"
+ layout="div">
+ #{country.name} #{country.iso} #{country.domain}
+ <a4j:ajax event="change" render="output"/>
+ </input:autocomplete>
+ <br/><br/>
+ Your selection: <h:outputText id="output"
value="#{autoCompleteBean.value}"/>
+ </h:form>
+</h:body>
+</html>
Added:
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutClientMode.xmlunit.xml
===================================================================
---
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutClientMode.xmlunit.xml
(rev 0)
+++
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutClientMode.xmlunit.xml 2011-01-06
12:00:31 UTC (rev 20904)
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<div class="rf-au-fld" id="form:myAutocomplete">
+ <input class="rf-au-fnt rf-au-inp"
id="form:myAutocompleteValue" name="form:myAutocompleteValue"
type="hidden"/>
+ <div style="position : relative; overflow : hidden; text-align : left;
padding-right : 21px;">
+ <input autocomplete="off" class="rf-au-fnt rf-au-inp"
id="form:myAutocompleteInput" name="form:myAutocomplete"
type="text"/>
+ <div class="rf-au-btn"
id="form:myAutocompleteButton">
+ <div class="rf-au-btn-arrow">
+ </div>
+ </div>
+ </div>
+ <div class="rf-au-lst-cord"
id="form:myAutocompleteList">
+ <div class="rf-au-shdw">
+ <div class="rf-au-shdw-t">
+ </div>
+ <div class="rf-au-shdw-l">
+ </div>
+ <div class="rf-au-shdw-r">
+ </div>
+ <div class="rf-au-shdw-b">
+ </div>
+ <div class="rf-au-lst-dcrtn">
+ <div class="rf-au-lst-scrl">
+ <ul id="" class="rf-au-lst-ul"
jquery1294233558255="" compact="" accesskey=""
tabindex="" children="" outerhtml="" lang=""
scrollwidth="" scopename="" title=""
scrollheight="" document="" innerhtml="" style=""
clienttop="" dir="" scrolltop="" classname=""
offsettop="" clientwidth="" all="" currentstyle=""
runtimestyle="" uniqueid="" innertext=""
parentelement="" offsetheight="" clientleft=""
offsetparent="" tagname="" scrollleft=""
attributes="" language="" offsetleft=""
offsetwidth="" disabled="">
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Afghanistan AF/AFG/4 .af
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Albania AL/ALB/8 .al
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Algeria DZ/DZA/12 .dz
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ American Samoa AS/ASM/16 .as
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Andorra AD/AND/20 .ad
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Angola AO/AGO/24 .ao
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Anguilla AI/AIA/660 .ai
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Antarctica AQ/ATA/10 .aq
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Antigua and Barbuda AG/ATG/28 .ag
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Argentina AR/ARG/32 .ar
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Armenia AM/ARM/51 .am
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Aruba AW/ABW/533 .aw
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Ashmore and Cartier Islands -/-/- -
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Australia AU/AUS/36 .au
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Austria AT/AUT/40 .at
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Azerbaijan AZ/AZE/31 .az
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bahamas, The BS/BHS/44 .bs
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bahrain BH/BHR/48 .bh
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Baker Island -/-/- -
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bangladesh BD/BGD/50 .bd
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Barbados BB/BRB/52 .bb
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bassas da India -/-/- -
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Belarus BY/BLR/112 .by
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Belgium BE/BEL/56 .be
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Belize BZ/BLZ/84 .bz
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Benin BJ/BEN/204 .bj
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bermuda BM/BMU/60 .bm
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bhutan BT/BTN/64 .bt
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bolivia BO/BOL/68 .bo
+
+ </li>
+ <li class="rf-au-itm rf-au-opt rf-au-fnt rf-au-inp">
+
+ Bosnia and Herzegovina BA/BIH/70 .ba
+
+ </li>
+ </ul>
+ <script type="text/javascript">
+//<![CDATA[
+new
RichFaces.ui.Autocomplete.setData("form:myAutocompleteItems",["Afghanistan","Albania","Algeria","American
Samoa","Andorra","Angola","Anguilla","Antarctica","Antigua
and
Barbuda","Argentina","Armenia","Aruba","Ashmore
and Cartier
Islands","Australia","Austria","Azerbaijan","Bahamas,
The","Bahrain","Baker
Island","Bangladesh","Barbados","Bassas da
India","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia
and Herzegovina","Botswana","Bouvet
Island","Brazil","British Indian Ocean Territory","British
Virgin Islands","Brunei","Bulgaria","Burkina
Faso","Burma","Burundi","Cambodia","Cameroon","Canada","Cape
Verde","Cayman Islands","Central African
Republic","Chad","Chile","China","Christmas
Island","Clipperton Island","Cocos (Keeling)
Islands","Colombia","Comoros","Congo, Democratic Republic of
the","Congo, Republic of the","Cook Islands","Coral Sea
Islands","Costa Rica","Cote
d'Ivoire","Croatia","Cuba","Cyprus","Czech
Republic","Denmark","Djibouti","Domi!
nica","Dominican Republic","Ecuador","Egypt","El
Salvador","Equatorial
Guinea","Eritrea","Estonia","Ethiopia","Europa
Island","Falkland Islands (Islas Malvinas)","Faroe
Islands","Fiji","Finland","France","France,
Metropolitan","French Guiana","French Polynesia","French
Southern and Antarctic Lands","Gabon","Gambia, The","Gaza
Strip","Georgia","Germany","Ghana","Gibraltar","Glorioso
Islands","Greece","Greenland","Grenada","Guadeloupe","Guam","Guatemala","Guernsey","Guinea","Guinea\u002DBissau","Guyana","Haiti","Heard
Island and McDonald Islands","Holy See (Vatican
City)","Honduras","Hong Kong","Howland
Island","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Isle
of Man","Israel","Italy","Jamaica","Jan
Mayen","Japan","Jarvis Island","Jersey","Johnston
Atoll","Jordan","Juan de Nova
Island","Kazakhstan","Kenya","Kingman
Reef","Kiribati","Korea, North","Korea,
South","Kosovo","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenst!
ein","Lithuania","Luxembourg","Macau","Macedonia","Madagascar"!
,"Malawi
","Malaysia","Maldives","Mali","Malta","Marshall
Islands","Martinique","Mauritania","Mauritius","Mayotte","Mexico","Micronesia,
Federated States of","Midway
Islands","Moldova","Monaco","Mongolia","Montenegro","Montserrat","Morocco","Mozambique","Myanmar","Namibia","Nauru","Navassa
Island","Nepal","Netherlands","Netherlands
Antilles","New Caledonia","New
Zealand","Nicaragua","Niger","Nigeria","Niue","Norfolk
Island","Northern Mariana
Islands","Norway","Oman","Pakistan","Palau","Palmyra
Atoll","Panama","Papua New Guinea","Paracel
Islands","Paraguay","Peru","Philippines","Pitcairn
Islands","Poland","Portugal","Puerto
Rico","Qatar","Reunion","Romania","Russia","Rwanda","Saint
Barthelemy","Saint Helena","Saint Kitts and Nevis","Saint
Lucia","Saint Martin","Saint Pierre and Miquelon","Saint
Vincent and the Grenadines","Samoa","San Marino","Sao Tome
and Principe","Saudi
Arabia","Senegal","Serbia","Seychelles","Sierra
Leone","Singapore","Slovakia","Slovenia","Solomon
Islands","Somal!
ia","South Africa","South Georgia and the
Islands","Spain","Spratly Islands","Sri
Lanka","Sudan","Suriname","Svalbard","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Timor\u002DLeste","Togo","Tokelau","Tonga","Trinidad
and Tobago","Tromelin
Island","Tunisia","Turkey","Turkmenistan","Turks
and Caicos
Islands","Tuvalu","Uganda","Ukraine","United Arab
Emirates","United Kingdom","United States","United States
Minor Outlying
Islands","Uruguay","Uzbekistan","Vanuatu","Venezuela","Vietnam","Virgin
Islands","Virgin Islands (UK)","Virgin Islands (US)","Wake
Island","Wallis and Futuna","West Bank","Western
Sahara","Western
Samoa","Yemen","Zaire","Zambia","Zimbabwe"]
)
+//]]>
+ </script>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script type="text/javascript">
+//<![CDATA[
+new RichFaces.ui.Autocomplete("form:myAutocomplete",
+ "form:myAutocompleteInput",
{"buttonId":"form:myAutocompleteButton","autofill":false,"minChars":2,"onblur":function(event){return
onEvent.call(this, event);},"onchange":function(event){return
jsf.util.chain(this, event, 'return onEvent.call(this,
event);','RichFaces.ajax(this,event,{"parameters":{"javax.faces.behavior.event":"change"}
,"sourceId":"form:myAutocomplete"}
)')},"onfocus":function(event){return onEvent.call(this,
event);},"onselectitem":function(event){return onEvent.call(this,
event);},"ajaxMode":false}
+ );
+//]]>
+ </script>
+</div>
\ No newline at end of file
Added:
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutTest.xhtml
===================================================================
---
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutTest.xhtml
(rev 0)
+++
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/autocompleteListLayoutTest.xhtml 2011-01-06
12:00:31 UTC (rev 20904)
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:input="http://richfaces.org/input"
+
xmlns:rich="http://richfaces.org/iteration"
+
xmlns:a4j="http://richfaces.org/a4j">
+<f:view contentType="text/html" />
+<h:head>
+ <title>Richfaces Autocomplete</title>
+</h:head>
+<h:body>
+ <h:form id="form">
+ <input:autocomplete autofill="false" id="myAutocomplete"
+ mode="#{autoCompleteBean.mode}"
+ minChars="2"
+ autocompleteMethod="#{autoCompleteBean.autocomplete}"
+ var="country" fetchValue="#{country.name}"
+ showButton="true"
+ value = "#{autoCompleteBean.value}"
+ layout="list">
+ #{country.name} #{country.iso} #{country.domain}
+ <a4j:ajax event="change" render="output"/>
+ </input:autocomplete>
+ <br/><br/>
+ Your selection: <h:outputText id="output"
value="#{autoCompleteBean.value}"/>
+ </h:form>
+</h:body>
+</html>
Added: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/countries.xml
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/countries.xml
(rev 0)
+++ trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/countries.xml 2011-01-06
12:00:31 UTC (rev 20904)
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<countries
xmlns="http://richfaces.org/test/countries">
+ <country>
+ <name>Afghanistan</name>
+ <iso>AF/AFG/4</iso>
+ <domain>.af</domain>
+ </country>
+ <country>
+ <name>Albania</name>
+ <iso>AL/ALB/8</iso>
+ <domain>.al</domain>
+ </country>
+ <country>
+ <name>Algeria</name>
+ <iso>DZ/DZA/12</iso>
+ <domain>.dz</domain>
+ </country>
+ <country>
+ <name>American Samoa</name>
+ <iso>AS/ASM/16</iso>
+ <domain>.as</domain>
+ </country>
+ <country>
+ <name>Andorra</name>
+ <iso>AD/AND/20</iso>
+ <domain>.ad</domain>
+ </country>
+ <country>
+ <name>Angola</name>
+ <iso>AO/AGO/24</iso>
+ <domain>.ao</domain>
+ </country>
+ <country>
+ <name>Anguilla</name>
+ <iso>AI/AIA/660</iso>
+ <domain>.ai</domain>
+ </country>
+ <country>
+ <name>Antarctica</name>
+ <iso>AQ/ATA/10</iso>
+ <domain>.aq</domain>
+ </country>
+ <country>
+ <name>Antigua and Barbuda</name>
+ <iso>AG/ATG/28</iso>
+ <domain>.ag</domain>
+ </country>
+ <country>
+ <name>Argentina</name>
+ <iso>AR/ARG/32</iso>
+ <domain>.ar</domain>
+ </country>
+ <country>
+ <name>Armenia</name>
+ <iso>AM/ARM/51</iso>
+ <domain>.am</domain>
+ </country>
+ <country>
+ <name>Aruba</name>
+ <iso>AW/ABW/533</iso>
+ <domain>.aw</domain>
+ </country>
+ <country>
+ <name>Ashmore and Cartier Islands</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Australia</name>
+ <iso>AU/AUS/36</iso>
+ <domain>.au</domain>
+ </country>
+ <country>
+ <name>Austria</name>
+ <iso>AT/AUT/40</iso>
+ <domain>.at</domain>
+ </country>
+ <country>
+ <name>Azerbaijan</name>
+ <iso>AZ/AZE/31</iso>
+ <domain>.az</domain>
+ </country>
+ <country>
+ <name>Bahamas, The</name>
+ <iso>BS/BHS/44</iso>
+ <domain>.bs</domain>
+ </country>
+ <country>
+ <name>Bahrain</name>
+ <iso>BH/BHR/48</iso>
+ <domain>.bh</domain>
+ </country>
+ <country>
+ <name>Baker Island</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Bangladesh</name>
+ <iso>BD/BGD/50</iso>
+ <domain>.bd</domain>
+ </country>
+ <country>
+ <name>Barbados</name>
+ <iso>BB/BRB/52</iso>
+ <domain>.bb</domain>
+ </country>
+ <country>
+ <name>Bassas da India</name>
+ <iso>-/-/-</iso>
+ <domain>-</domain>
+ </country>
+ <country>
+ <name>Belarus</name>
+ <iso>BY/BLR/112</iso>
+ <domain>.by</domain>
+ </country>
+ <country>
+ <name>Belgium</name>
+ <iso>BE/BEL/56</iso>
+ <domain>.be</domain>
+ </country>
+ <country>
+ <name>Belize</name>
+ <iso>BZ/BLZ/84</iso>
+ <domain>.bz</domain>
+ </country>
+ <country>
+ <name>Benin</name>
+ <iso>BJ/BEN/204</iso>
+ <domain>.bj</domain>
+ </country>
+ <country>
+ <name>Bermuda</name>
+ <iso>BM/BMU/60</iso>
+ <domain>.bm</domain>
+ </country>
+ <country>
+ <name>Bhutan</name>
+ <iso>BT/BTN/64</iso>
+ <domain>.bt</domain>
+ </country>
+ <country>
+ <name>Bolivia</name>
+ <iso>BO/BOL/68</iso>
+ <domain>.bo</domain>
+ </country>
+ <country>
+ <name>Bosnia and Herzegovina</name>
+ <iso>BA/BIH/70</iso>
+ <domain>.ba</domain>
+ </country>
+</countries>
\ No newline at end of file
Added: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/countries.xsd
===================================================================
--- trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/countries.xsd
(rev 0)
+++ trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/countries.xsd 2011-01-06
12:00:31 UTC (rev 20904)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema
xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://richfaces.org/demos/countries"
+
xmlns:tns="http://richfaces.org/demos/countries"
elementFormDefault="unqualified">
+
+ <element name="countries">
+ <complexType>
+ <sequence maxOccurs="unbounded">
+ <element name="country">
+ <complexType>
+ <sequence>
+ <element name="name" />
+ <element name="iso" />
+ <element name="domain" />
+ </sequence>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+
+</schema>
\ No newline at end of file
Modified: trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml
===================================================================
---
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml 2011-01-06
11:50:02 UTC (rev 20903)
+++
trunk/ui/input/ui/src/test/resources/org/richfaces/renderkit/faces-config.xml 2011-01-06
12:00:31 UTC (rev 20904)
@@ -1,20 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
- version="2.0">
-
- <managed-bean>
- <managed-bean-name>inputBean</managed-bean-name>
- <managed-bean-class>org.richfaces.renderkit.InputBean</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- </managed-bean>
-
- <managed-bean>
- <managed-bean-name>selectBean</managed-bean-name>
- <managed-bean-class>org.richfaces.renderkit.SelectBean</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- </managed-bean>
-
-</faces-config>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="2.0"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xi="http://www.w3.org/2001/XInclude"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
+ <managed-bean>
+ <managed-bean-name>inputBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.renderkit.InputBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>selectBean</managed-bean-name>
+
<managed-bean-class>org.richfaces.renderkit.SelectBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>countriesBean</managed-bean-name>
+
<managed-bean-class>org.richfaces.renderkit.CountriesBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>autoCompleteBean</managed-bean-name>
+
<managed-bean-class>org.richfaces.renderkit.AutoCompleteBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>countriesBean</property-name>
+ <value>#{countriesBean}</value>
+ </managed-property>
+ </managed-bean>
+</faces-config>