<e:autocompletepais/>
Last updated
Was this helpful?
Last updated
Was this helpful?
Crear el componente dentro de resources/extensions
<?xml version='1.0' encoding='UTF-8' ?>
<!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:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<composite:interface >
<composite:attribute name="value" />
<composite:attribute name="disabled" default="false" />
<composite:attribute name="multiple" default="false" />
<composite:attribute name="dropdown" default="false"/>
<composite:attribute name="minQueryLength" default="1"/>
<composite:attribute name="itemLabel" />
<composite:attribute name="update" />
<composite:attribute name="rendered"/>
<composite:attribute name="required" default="false" />
<composite:attribute name="field"/>
<composite:attribute name="fromstart" default="true"/>
<composite:attribute name="size" default="25"/>
<composite:attribute name="listener"
method-signature="void handleSelect(org.primefaces.event.SelectEvent)" />
</composite:interface>
<composite:implementation>
<p:autoComplete dropdown="#{cc.attrs.dropdown}"
disabled="#{cc.attrs.disabled}"
scrollHeight="250"
size="#{cc.attrs.size}"
multiple="#{cc.attrs.multiple}"
emptyMessage="#{app['info.nohayregistros']}"
value="#{cc.attrs.value}"
completeMethod="#{personaController.personaServices.complete}"
var="p"
required="#{cc.attrs.required}"
itemLabel="#{cc.attrs.itemLabel}"
itemValue="#{p}"
forceSelection="true">
<f:converter binding="#{personaConverter}"/>
<f:attribute name="field" value="#{cc.attrs.field}"/>
<f:attribute name="fromstart" value="#{cc.attrs.fromstart}"/>
<f:attribute name="fielddropdown" value="#{cc.attrs.dropdown}"/>
<f:attribute name="fieldminquerylength" value="#{cc.attrs.minQueryLength}"/>
<p:ajax event="itemSelect" listener="#{cc.attrs.listener}"
update="#{cc.attrs.update}" />
<f:facet name="itemtip">
<h:panelGrid columns="1" cellpadding="5">
<h:outputText value="Cedula #{p.cedula}" />
<h:outputText value="Nombre #{p.nombre}" />
</h:panelGrid>
</f:facet>
</p:autoComplete>
</composite:implementation>
</html>