值自动完成

时间:2019-02-18 16:34:30

标签: jsf primefaces

我想知道如何使用在Controller的autocomplete字段中键入的值,即使该值为null且不是BD中的注册车辆。

<p:outputLabel value="Veículo: " style="padding-right: 30px"/>
                    <p:autoComplete id="veiculo" dropdown="true" 
                        label="Veículo" required="false" placeholder="Todos" 
                        readonly="#{portariaController.tipoVeiculo == 'SEM_PLACA' || portariaController.tipoVeiculo == 'SEM_VEICULO'}"
                        value="#{portariaController.veiculo}" 
                        completeMethod="#{veiculoController.completeVeiculos}" 
                        maxResults="10" var="v" itemLabel="#{v.placa}" 
                        converter="#{entityConverter}" itemValue="#{v}" forceSelection="false" >
                        <p:ajax event="itemSelect" update=":formPrincipal:pnlVeiculo" />
                        <p:ajax event="change" update=":formPrincipal:edit"/>
                    </p:autoComplete>

0 个答案:

没有答案