Tobago Demo

Menu

Root Dummy Intro Search Getting Started Docker What's New Migration Compatibility FAQ API Download Server Info Logging Info In Suggest Textarea Date Range Group 5 Star Rating File Upload Out Label Badge Image Figure Progress Object Checkbox Toggle Dropdown Radio Listbox SelectOneList Multi Checkbox Multi Listbox Shuttle SelectManyList Button and Link Default Command Button Group Customizer Link Group Box Panel Separator Section Header and Footer Bar Popup Popover Toast Basic example Tab Client Tab Ajax Tab Server Basic example Sheet Sorting Paginator Sheet Column Selector Sheet Selectionchange Sheet Event Sheet Action Sheet Markup Sheet Style Empty Sheet Column Bar Sheet Filter Sheet Static Header Sheet Multi Header Sheet Tree Column Panel Sheet Editable Sheet Lazy Sheet Nested Basic example Tree Command Types Tree Select Tree Editor Tree Menu Tree Listbox Intro TinyMCE CKEditor Flow Layout Flex Layout Segment Layout Label Layout Grid Layout Split Layout Message-layout Overview Collapsible Box Collapsible Popup Collapsible Panel Collapsible Section Content Validation JSR 303 Severity Messages Content Security Policy Sanitize Roles Form AccessKey Focus Exception Handler Style Tag Bootstrap Theme Icons Partial Ajax Behavior WebSocket Transition Non Faces Request Conversion Error Handling For Each ConversationScoped Download Configuration Format Locale DataAttribute Meta
Root Dummy Intro Search Getting Started Docker What's New Migration Compatibility FAQ API Download Server Info Logging Info In Suggest Textarea Date Range Group 5 Star Rating File Upload Out Label Badge Image Figure Progress Object Checkbox Toggle Dropdown Radio Listbox SelectOneList Multi Checkbox Multi Listbox Shuttle SelectManyList Button and Link Default Command Button Group Customizer Link Group Box Panel Separator Section Header and Footer Bar Popup Popover Toast Basic example Tab Client Tab Ajax Tab Server Basic example Sheet Sorting Paginator Sheet Column Selector Sheet Selectionchange Sheet Event Sheet Action Sheet Markup Sheet Style Empty Sheet Column Bar Sheet Filter Sheet Static Header Sheet Multi Header Sheet Tree Column Panel Sheet Editable Sheet Lazy Sheet Nested Basic example Tree Command Types Tree Select Tree Editor Tree Menu Tree Listbox Intro TinyMCE CKEditor Flow Layout Flex Layout Segment Layout Label Layout Grid Layout Split Layout Message-layout Overview Collapsible Box Collapsible Popup Collapsible Panel Collapsible Section Content Validation JSR 303 Severity Messages Content Security Policy Sanitize Roles Form AccessKey Focus Exception Handler Style Tag Bootstrap Theme Icons Partial Ajax Behavior WebSocket Transition Non Faces Request Conversion Error Handling For Each ConversationScoped Download Configuration Format Locale DataAttribute Meta

In

The <tc:in/> tag create a classic input field.

Tag Library Documentation

Basics

In most cases, a label should be placed in front of every input field. Use the attribute label.

<tc:in label="Input" value="Some Text"/>

Focus

The following input field should be selected after reloading the page. Use the focus attribute.

<tc:in label="Input (focus)" focus="true" value="Some Text"/>

Required

An input field can be set as required with the required attribute. Such an input field must contain a value, otherwise a submit is not possible. Leave the field blank and press 'submit' to see the error message.

<tc:in label="Input (required)" required="true"/>

Help

A help text can be added with the help attribute.

<tc:in help="#{inController.helpText}"/>

Password

To create an input field for passwords, set the password attribute to 'true'. It will hide the text as shown in the following example.

<tc:in label="Password" password="true" value="password"/>

Placeholder

A placeholder attribute can be used for explaining a user the meaning of a field.

The text of the placeholder is only shown if the value is an empty string.

<tc:in label="Placeholder" placeholder="Grey Text"/>

Markups

There are some markups available for input fields.

<tc:in value="large input field" markup="large"/> <tc:in value="small input field" markup="small"/> <tc:in value="number markup" markup="number"/>

Autocomplete

The autocomplete attribute can be used for explaining a user the meaning of a field.

The values are documented in MDN.

Ajax

The output field in this example, displays the given value on the server. With <f:ajax event="input" render="outputAjax" listener="#{inController.update}"/>, the output field will be rerendered, after the value has been changed. Additional, the listener attribute is set. The given method is called after the input field loose focus.

AJAX on change
© 2005-2025 Apache Software Foundation, Licensed under the Apache License, Version 2.0.