blob: 10ab832ff9cc399a3b98ff4e2355d1517de859ac [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<ui:composition template="/main.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:tc="http://myfaces.apache.org/tobago/component"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<tc:section label="Suggest Input - AJAX">
<p>The out component will show the selected value choosen from the suggest input field. Ajax case is covered and component is reloaded after valid selection.</p>
<tc:out id="outBasic" label="Selection" value="#{suggestController.selection1}"/>
<tc:in id="inBasic" value="#{suggestController.selection1}">
<tc:suggest totalCount="10" query="#{suggestController.query}">
<tc:selectItems value="#{suggestController.solarObjects}" var="name" itemValue="#{name}"/>
</tc:suggest>
<f:ajax render="outBasic"/>
</tc:in>
</tc:section>
<tc:section label="Suggest Input - No AJAX">
<p>The out component will show the selected value choosen from the suggest input field. Page is reloaded after selection.</p>
<tc:out id="outTwo" label="Selection" value="#{suggestController.selection2}"/>
<tc:in id="inTwo" value="#{suggestController.selection2}">
<tc:suggest totalCount="10" query="#{suggestController.query}">
<tc:selectItems value="#{suggestController.solarObjects}" var="name" itemValue="#{name}"/>
</tc:suggest>
<tc:event/>
</tc:in>
</tc:section>
<tc:section label="Suggest inside an Input Group">
<tc:in id="withFacets">
<f:facet name="before">Before</f:facet>
<tc:suggest totalCount="10" query="#{suggestController.query}">
<tc:selectItems value="#{suggestController.solarObjects}" var="name" itemValue="#{name}"/>
</tc:suggest>
<f:facet name="after">After</f:facet>
</tc:in>
</tc:section>
<tc:box label="Input Group Suggest Variants">
<tc:style customClass="badge-info"/>
<tc:in id="suggest21">
<tc:suggest totalCount="10" query="#{suggestController.query}">
<tc:selectItems value="#{suggestController.solarObjects}" var="name" itemValue="#{name}"/>
</tc:suggest>
<f:facet name="after">
<tc:button label="Submit" defaultCommand="true"/>
</f:facet>
</tc:in>
<tc:in id="suggest22">
<f:facet name="before">
<tc:button label="Submit" defaultCommand="true"/>
</f:facet>
<tc:suggest totalCount="10" query="#{suggestController.query}">
<tc:selectItems value="#{suggestController.solarObjects}" var="name" itemValue="#{name}"/>
</tc:suggest>
</tc:in>
<tc:in id="suggest23">
<f:facet name="before">
<tc:button label="Submit" defaultCommand="true"/>
</f:facet>
<tc:suggest totalCount="10" query="#{suggestController.query}">
<tc:selectItems value="#{suggestController.solarObjects}" var="name" itemValue="#{name}"/>
</tc:suggest>
<f:facet name="after">
<tc:button label="Submit" defaultCommand="true"/>
</f:facet>
</tc:in>
</tc:box>
</ui:composition>