webuijsf
Tag body


Using Body Tags on Pages Without Frames

If you are not using frames on your page, use the webuijsf:body tag to contain the JSP tags for the body of the JSP page. page. The webuijsf:body tag must be placed after the webuijsf:html and webuijsf:head tags. Tags for page content must be nested inside the webuijsf:body tag to ensure that the HTML elements are rendered in the necessary order.

Using Body Tags on Pages With Frames

If you are using frames in your page, use the webuijsf:frameSet tag instead of the webuijsf:body tag.

The focus can be maintained with the body tag's focus and preserveFocus attributes. The preserveFocus attribute's default value is true. This means that after the first display, the focus, will be returned to the element that had the focus when the request was made. Setting preserveFocus to false inhibits that behavior.

The focus attribute allows the developer to specify the element that should receive the focus on first display. If preserveFocus is set to false the focus attribute can control which element receives the focus on every request/response cycle.

HTML Elements and Layout

The body component creates an HTML <body> element in the rendered HTML page. Attributes that you specify with the webuijsf:body tag are used to specify the corresponding attributes in the rendered <body> element.

Client-Side Javascript Functions

None.

Code Examples

Example 1: Create a Body Tag

This example shows a simple webuijsf:body tag.

<webuijsf:page>
    <webuijsf:head title="body test" >
         <webuijsf:meta httpHead="refresh" content="5" />
    </webuijsf:head> 
    <webuijsf:body id="bodytest">
        ....your body content ...
    </webuijsf:body id="bodytest">
</webuijsf:page>

Example 2: Create a Body Tag That Sets the Focus

This example demonstrates how to set the focus in the webuijsf:body tag for a particular component in the page. When the page is first loaded, the third text field has focus.

Since preserveFocus has not been specified, if the same page is redisplayed in the response, then the focus will be set in one of two ways.

  <webuijsf:page>
   <webuijsf:head title="Body tests" />
    <webuijsf:body focus="form1:textTest3">
     <webuijsf:form id="form1">
      <webuijsf:textField id="textTest" label="Text Field 1:" required="true"  text="#{FieldTest.test1}"/>
      <webuijsf:textField id="textTest2" label="Text Field 2:" required="true"  text="#{FieldTest.test2}"/>
      <webuijsf:textField id="textTest3" label="Text Field 3:" required="true"  text="#{FieldTest.test3}"/>
      <webuijsf:button primary="true" id="fieldButton2" text="Submit"/>
     </webuijsf:form>
    </webuijsf:body>
  </webuijsf:page>


Tag Information
Tag Classcom.sun.webui.jsf.component.BodyTag
TagExtraInfo ClassNone
Body ContentJSP
Display NameNone

Attributes
NameRequiredRequest-timeTypeDescription
bindingfalsefalsejava.lang.String A ValueExpression that resolves to the UIComponent that corresponds to this tag. This binding allows the Java bean that contains the UIComponent to manipulate the UIComponent, its properties, and its children.
onMouseDownfalsefalsejava.lang.String

Scripting code that executes when the user presses a mouse button while the mouse pointer is on the component.

imageURLfalsefalsejava.lang.String

The path to an image to be used as a background for the page.

onDblClickfalsefalsejava.lang.String

Scripting code that executes when a mouse double click occurs over this component.

onLoadfalsefalsejava.lang.String

Scripting code that executes when when this page is loaded in a browser.

onKeyPressfalsefalsejava.lang.String

Scripting code that executes when the user presses and releases a key while the component has focus.

onUnloadfalsefalsejava.lang.String

Scripting code that executes when this page is unloaded from a browser as a user exits the page.

onFocusfalsefalsejava.lang.String

Scripting code that executes when this component receives focus. An element receives focus when the user selects the element by pressing the tab key or clicking the mouse.

onMouseOutfalsefalsejava.lang.String

Scripting code that executes when a mouse out movement occurs over this component.

renderedfalsefalsejava.lang.String Use the rendered attribute to indicate whether the HTML code for the component should be included in the rendered HTML page. If set to false, the rendered HTML page does not include the HTML for the component. If the component is not rendered, it is also not processed on any subsequent form submission.
preserveFocusfalsefalsejava.lang.String

Indicates whether the last element to have the focus, receives the focus the next time the page is rendered. If this is set to true the focus is preserved; if set to false it is not. If set to false and the focus attribute is set then the element identified by that id receives the focus. The default value is true.

focusfalsefalsejava.lang.String

Specify the ID of the component that should receive focus when the page is loaded. If the focus attribute is not set, or if the value is null, no component has focus when the page is initially rendered. If the page is submitted and reloaded, the component that submitted the page receives focus. By setting the focus attribute, you can ensure that a particular component receives focus each time.

idfalsetruejava.lang.StringNo Description
onMouseOverfalsefalsejava.lang.String

Scripting code that executes when the user moves the mouse pointer into the boundary of this component.

onKeyUpfalsefalsejava.lang.String

Scripting code that executes when the user releases a key while the component has focus.

onMouseMovefalsefalsejava.lang.String

Scripting code that executes when the user moves the mouse pointer while over the component.

onMouseUpfalsefalsejava.lang.String

Scripting code that executes when the user releases a mouse button while the mouse pointer is on the component.

styleClassfalsefalsejava.lang.String

CSS style class or classes to be applied to the outermost HTML element when the body component is rendered.

preserveScrollfalsefalsejava.lang.String

Use the preserveScroll attribute to indicate whether the page should remember the scroll position when navigating to and from the page. The default value is true

visiblefalsefalsejava.lang.String

Indicates whether the component should be viewable by the user in the rendered HTML page. If this is set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.

stylefalsefalsejava.lang.String

CSS style or styles to be applied to the outermost HTML element when this component is rendered.

onKeyDownfalsefalsejava.lang.String

Scripting code that executes when the user presses down on a key while the component has focus.

onClickfalsefalsejava.lang.String

Scripting code executed when a mouse click occurs over this component.

onBlurfalsefalsejava.lang.String

Scripting code executed when this element loses focus.


Variables
No Variables Defined.


Output Generated by Tag Library Documentation Generator. Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-4 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.