anusha(salesforce developer)

Friday 29 July 2016

How to use <apex:tab>  in Visualforce Page?

<apex:tab> :
A single tab in an < apex:tabPanel>. The <apex:tab> component must be a child of a 
< apex:tabPanel >. 


This tag supports following attributes: 
Attribute
Description
disabled
A Boolean value that specifies whether the tab can be selected and viewed. If set to true, the tab cannot be selected. If not specified, this value defaults to false.
focus
The ID of the child component in focus when the tab content is displayed.
id
An identifier that allows the tab component to be referenced by other components in the page.
immediate
A Boolean value that specifies whether the action associated with this component happens immediately, without processing any validation rules associated with the fields on the page. If set to true, the action happens immediately and validation rules are skipped. If not specified, this value defaults to false.
label
The text to display in the tab header.
labelWidth
The length of the tab header, in pixels. If not specified, this value defaults to the width of label text.
name
The name of the tab. Use the value of this attribute to specify the default selected tab for the tabPanel.
onclick
The JavaScript invoked if the onclick event occurs that is, if the user clicks the tab.
oncomplete
The JavaScript invoked if the oncomplete event occurs that is, when the tab has been selected and its content rendered on the page.
ondblclick
The JavaScript invoked if the onclick event occurs that is, if the user clicks the tab twice.
onkeydown
The JavaScript invoked if the onkeydown event occurs that is, if the user presses a keyboard key.
onkeypress
The JavaScript invoked if the onkeypress event occurs that is, if the user presses or holds down a keyboard key.
onkeyup
The JavaScript invoked if the onkeyup event occurs that is, if the user releases a keyboard key.
onmousedown
The JavaScript invoked if the onmousedown event occurs that is, if the user clicks a mouse button.
onmousemove
The JavaScript invoked if the onmousemove event occurs that is, if the user moves the mouse pointer.
onmouseout
The JavaScript invoked if the onmouseout event occurs that is, if the user moves the mouse pointer away from the tab.
onmouseover
The JavaScript invoked if the onmouseover event occurs that is, if the user moves the mouse pointer over the tab.
onmouseup
The JavaScript invoked if the onmouseup event occurs that is, if the user releases the mouse button.
ontabenter
The JavaScript invoked if the ontabenter event occurs that is, if a tab component becomes in focus.
ontableave
The JavaScript invoked if the ontableave event occurs that is, if a component outside the tab becomes in focus.
rendered
A Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true.
reRender
The ID of one or more components to redraw when the result of an AJAX update request returns to the client. This value can be a single id, a comma-separated list of ids, or a merge field expression for a list or collection of ids. This value is also only applicable when the value of the switchType attribute is "ajax".
status
The ID of an associated component that displays the status of an AJAX update request. See the actionStatus component. Note that this value is only applicable when the value of the switchType attribute is set to "ajax".
style
The style used to display all portions of the tab component, used primarily for adding inline CSS styles.
styleClass
The CSS style class used to display all portions of the tab component, used primarily to designate which CSS styles are applied when using an external CSS stylesheet.
switchType
The implementation method for switching to this tab. Possible values include "client", "server", and "ajax". If not specified, this value defaults to "server". If specified, this value overrides the switchTab attribute on the tabPanel component.
timeout
The amount of time (in milliseconds) before an AJAX update request should time out. Note that this value is only applicable when the value of the switchType attribute is set to "ajax".
title
The text to display as a tooltip when the user's mouse pointer hovers over this component.


Visualforce Example:

<apex:page id="thePage">
    <apex:tabPanel switchType="client" selectedTab="name1" id="theTabPanel">
    <apex:tab label="One" name="name1" id="tabOne">content for tab one</apex:tab>
    <apex:tab label="Two" name="name2" id="tabTwo">content for tab two</apex:tab>
    </apex:tabPanel>
</apex:page>


save image

No comments:

Post a Comment