View RSS Feed

My Java Tips

Sample JSF page

Rate this Entry
by , 11-02-2011 at 06:17 PM (1231 Views)
Creating JSF page is simple and easy. There are few things to remember which I will list down.


The page must include JSF tag library and HTML and core tags.

All the JSF tags must enclosed between a set of view tag.
Use JSF form and form component tags.
Use h:input_text and not input type=text
Use h:command_button and not input type=submit

A page may include validators and event listeners on any form components

For example:

<f:view>
<f:form formname="logonForm">
<h:panel_grid columns="2">
<h:output_text value="Username:/">
<h:input_text id="username" length="16" valueref="logonBean.username/">
<h:output_text value="Password:/">
<h:input_secret id="password" length="16" valueref="logonBean.password/">
<h:command_button type="submit" actionref="logonBean.logon/">
<h:command_button type="reset" label="Reset/">
</h:command_button></h:command_button></h:input_secret></h:output_text></h:input_text></h:output_text></h:panel_grid>
</f:form>
</f:view>

Submit "Sample JSF page" to Facebook Submit "Sample JSF page" to Digg Submit "Sample JSF page" to del.icio.us Submit "Sample JSF page" to StumbleUpon Submit "Sample JSF page" to Google

Updated 11-02-2011 at 06:19 PM by Java Tip

Tags: None Add / Edit Tags
Categories
Frameworks

Comments