Jsf html Tag

Source: Internet
Author: User

Jsf html Tag

JSF provides a set of standard HTML tags. You can use the JSF component to output HTML files. The standard HTML Renderer Kit consists of the following types:

  • Output (outputs) starts with output and serves as the output specified information or bound value.
  • The name of an input (inputs) starts with input and serves as a user input field.
  • The name of a command (commands) starts with "command" and serves as a command or a link button.
  • Selections: its name starts with select, and its function is to provide the selection of user options.
  • A table is associated with a able. It is used to generate a table.
  • Other unclassified tags include form, message, messages, graphicimage, and so on.

 

Attribute name

Applicable

Description

ID

All components

You can specify an ID for reference by other labels or components.

Binding

All components

Bind to uicomponent

Rendered

All components

Show Components

Styleclass

All components

Set cascading stylesheet (CSS)

Value

Input, output, and command Components

Set or bind to a specified value

Valuechangelistener

Input component

Set Value to change event handler

Converter

Input and Output Components

Set Converter

Validator

Input component

Set validators

Required

Input component

Verify required fields

Immediate

Input and command Components

Is it an immediate event?

 

 

The labels of the output class includeOutputlabel,Outputlink,OutputformatAndOutputtexT

Examples are as follows:

  • Outputlabel

Generate the <label> HTML Tag and use the for attribute to specify the Client ID of the component. For example:

<H: inputtext id = "user" value = "# {user. name}"/>
<H: outputlabel for = "user" value = "# {user. name}"/>

 
This produces HTML like the following:
<Input id = "user" type = "text" name = "user" value = "guest"/>
<Label for = "user">

 

  • Outputlink

Generate <A> HTML tags, for example:
<H: outputlink value = "../index. jsp"/>
 

The content specified by value can also be JSF El binding.

 

  • Outputformat

Generate specified text information. You can use <F: param> to set information parameters to format text information. For example:
<F: loadbundle basename = "messages" Var = "msgs"/>
<H: outputformat value = "# {msgs. welcometext}">
<F: Param value = "hello"/>
<F: Param value = "guest"/>
</H: outputformat>

 
If your messages. properties includes the following content:
Welcometext = {0}, your name is {1 }.
 
Then {0} and {1} are replaced with the text set by <F: param>. The last text displayed is:
Hello, your name is guest.
 
Another method is:
<H: outputformat value = "{0}, your name is {1}.">
<F: Param value = "hello"/>
<F: Param value = "guest"/>
</H: outputformat>

 

  • Outputtext

Simple display of the specified value or bound information, for example:
<H: outputtext value = "# {user. name}"/>

 

 

 

The input class label includesInputtext,Inputtextarea,Inputsecret,Inputhidden

Examples are as follows:

  • Inputtext

Display the single-line input field, that is, the output <input> HTML Tag, whose type attribute is set to text, for example:

<H: inputtext value = "# {user. name}"/>

 

  • Inputtextarea

Display the text area of multiple lines, that is, the output <textarea> HTML Tag, for example:

<H: inputtextarea value = "# {user. Command}"/>

 

  • Inputsecret

Display the password input field, that is, the output <input> HTML Tag, whose type attribute is set to password, for example:
<H: inputsecret value = "# {user. Password}"/>
 
You can set the redisplay attribute to determine whether to display the password field value. The default value is false.

 

  • Inputhidden

The hidden field, that is, the output <input> HTML Tag. Its Type attribute is set to Den den. The value of the hidden field is used to retain some information on the client and send it along with the next form. For example:
<H: inputhidden value = "# {user. hiddeninfo}"/>


Tag Description
View Create a top-level view
Subview Create a subview of a view
Facet Add facet to component
Param Add parameters to a component
Attribute Add attributes to a component
Actionlistener Register the operation listener on the parent component
Valuechangelistener Register a value change listener with the parent component
Converter Register any Converter
Convertdatetime Register a date-time Converter
Convertnumber Register a quantity Converter
Validatelength Verify the length of the component Value
Validatedoublerange Verify the dual-precision range of component values
Validatelongrange Verify the Long Integer Range of the component Value
Validator Add validators to components
Loadbundle Load Resource Package
Verbatim Add tags to the page
Selectitem Specifies a project of the uiselectone or uiselectworkflow component.
Selectitems Multiple projects of the uiselectone or uiselectworkflow component
   
   
Components Tag Description
Uiform Form HTML form Element
Uiinput Inputtext Single-line text input control
  Inputtextarea Multi-line text input control
  Inputsecret Password Input Control
  Inputhidden Hide Fields
Uioutput Outputlabel Show text
  Outputlink Link to another page or a specific location on a page
  Outputformat Display formatted Information
  Outputtext When line text is entered
Uicommand Commandbutton Indicates a button.
  Commandlink Indicates a link.
Uiselectone Selectonelistbox Radio list
  Selectonemenu Radio menu
  Selectoneradio Radio button set
Uiselectboolean Selectbooleancheckbox Single check box
Uiselectworkflow Selectmanylistbox Check box set
  Selectmanycheckbox Multi-row selection list box
  Selectmanymenu Multiple menu options
Uipanel Panelgrid Indicates an HTML table.
  Panelgroup Combine a series of components
Uimessage Message Displays recently used messages of a component.
  Messages Show all messages
Uigraphic Graphicimage Show an image
Uidata Datatable Table Control with rich functions
Uicolumn Column Column in table
Form H: Form Generate HTML form elements
     
     
     

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.