<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html" version="2.0"
	xmlns:rich="http://richfaces.org/rich">
	<jsp:directive.page language="java"
		contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" />
	<jsp:text>
		<![CDATA[ <?xml version="1.0" encoding="UTF-8" ?> ]]>
	</jsp:text>
	<jsp:text>
		<![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ]]>
	</jsp:text>
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<script type="text/javascript">
	function printObjectsSelected(output, sgcomponent) {
		output.innerHTML = sgcomponent.getSelectedItems().pluck('country');
	}
</script>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Demonstracja podpowiadania</title>
	</head>
	<body>
	<f:view>
		<h:form id="form">
			<h:outputText value="Podaj stolicę:" />
			<h:inputText value="#{capitalsBB.capital}" id="inputId" />
			<h:outputText id="objects" style="font-weight:bold" />
			<rich:suggestionbox height="200" width="200" for="inputId"
				usingSuggestObjects="true"
				onobjectchange="printObjectsSelected(#{rich:element('objects')}, #{rich:component('suggestion')});"
				suggestionAction="#{capitalsBB.autocomplete}" var="result"
				id="suggestion">
				<h:column>
					<h:outputText value="#{result.name}" />
				</h:column>
			</rich:suggestionbox>
		</h:form>
	</f:view>
	</body>
	</html>
</jsp:root>