Book Image

Primefaces Cookbook Second Edition

Book Image

Primefaces Cookbook Second Edition

Overview of this book

Table of Contents (20 chapters)
PrimeFaces Cookbook Second Edition
Credits
Foreword
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Usable features of inputTextArea


The inputTextArea component is an extension to the HTML <textarea> component with special capabilities, such as auto-growing, auto-resizing, and remaining-character count.

How to do it…

A basic definition for the input text area would be as follows:

<p:inputTextarea value="#{inputTextAreaBean.value}" />

This will render an input text area with the default values rows='3' and cols='20' as shown in the following screenshot:

The component also provides auto-resizing with the autoResize attribute that allows us to expand the height automatically when the text input overflows. The default value is true. If you want to get the vertical scrollbar, you need to set the autoResize to false.

Like the HTML <textarea> component, we can also specify the rows and cols attributes to specify the size of the text area component in rows and columns.

How it works…

The JavaScript plugin for the inputTextArea component is solely implemented by PrimeFaces with jQuery...