3.121 SplitButton. PrimeFaces PrimeFaces
Διαφήμιση
Διαφήμιση
3.121 SplitButton
SplitButton displays a command by default and additional ones in an overlay.
PrimeFaces User Guide
Info
Tag
Component Class
Component Type
splitButton org.primefaces.component.splitbutton.SplitButton
org.primefaces.component.SplitButton
Component Family
org.primefaces.component
Renderer Type
org.primefaces.component.SplitButtonRenderer
Renderer Class
org.primefaces.component.splitbutton.SplitButtonRenderer
Attributes
Name
id rendered binding value action actionListener immediate type ajax
Default
null true null
Type
String
Boolean
Object
Description
Unique identifier of the component
Boolean value to specify the rendering of the component, when set to false component will not be rendered.
An el expression that maps to a server side UIComponent instance in a backing bean
Label for the button
A method expression or a String outcome that’d be processed when button is clicked.
null null
String
MethodExpr/
String null false
MethodExpr An actionlistener that’d be processed when button is clicked.
Boolean Boolean value that determines the phaseId, when true actions are processed at apply_request_values, when false at invoke_application phase.
submit String true Boolean
Sets the behavior of the button.
Specifies the submit mode, when set to true(default), submit would be made with Ajax.
449
async process update onstart
Name
oncomplete onsuccess onerror global delay partialSubmit false resetValues false ignoreAutoUpdate false timeout style styleClass onblur onchange onclick ondblclick onfocus onkeydown null true null
Default
false
Type
Boolean null null null
String
String
String null null
String
String
String
Boolean
String
0 null null null null null null null null
Boolean
Boolean
Boolean
Integer
String
String
String
String
String
String
String
String
PrimeFaces User Guide
Description
When set to true, ajax requests are not queued.
Component(s) to process partially instead of whole view.
Component(s) to be updated with ajax.
Client side callback to execute before ajax request is begins.
Client side callback to execute when ajax request is completed.
Client side callback to execute when ajax request succeeds.
Client side callback to execute when ajax request fails.
Defines whether to trigger ajaxStatus or not.
If less than delay milliseconds elapses between calls to
request() only the most recent one is sent and all other requests are discarded. If this option is not specified, or if the value of delay is the literal string 'none' without the quotes, no delay is used.
Enables serialization of values belonging to the partially processed components only.
If true, local values of input components to be updated within the ajax request would be reset.
If true, components which autoUpdate="true" will not be updated for this request. If not specified, or the value is false, no such indication is made.
Timeout for the ajax request in milliseconds.
Inline style of the button element.
StyleClass of the button element.
Client side callback to execute when button loses focus.
Client side callback to execute when button loses focus and its value has been modified since gaining focus.
Client side callback to execute when button is clicked.
Client side callback to execute when button is double clicked.
Client side callback to execute when button receives focus.
Client side callback to execute when a key is pressed down over button.
450
onmouseup onselect accesskey alt dir disabled image label lang tabindex title readonly icon iconPos widgetVar appendTo
Name
onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover false null null null null null false null left null null null null null null null null null null
Default
null
Type
String null null
String
String
String
String
String
Boolean
String
String
String
Integer
String
Boolean
String
String
String
String
String
String
String
String
String
PrimeFaces User Guide
Description
Client side callback to execute when a key is pressed and released over button.
Client side callback to execute when a key is released over button.
Client side callback to execute when a pointer button is pressed down over button.
Client side callback to execute when a pointer button is moved within button.
Client side callback to execute when a pointer button is moved away from button.
Client side callback to execute when a pointer button is moved onto button.
Client side callback to execute when a pointer button is released over button.
Client side callback to execute when text within button is selected by user.
Access key that when pressed transfers focus to the button.
Alternate textual description of the button.
Direction indication for text that does not inherit directionality. Valid values are LTR and RTL.
Disables the button.
Style class for the button icon. (deprecated: use icon)
A localized user presentable name.
Code describing the language used in the generated markup for this component.
Position of the button element in the tabbing order.
Advisory tooltip information.
Flag indicating that this component will prevent changes by the user.
Icon of the button as a css class.
Position of the icon.
Name of the client side widget.
Appends the overlay to the element defined by search expression. Defaults to document body.
451
PrimeFaces User Guide
Getting started with SplitButton
SplitButton usage is similar to a regular commandButton. Additional commands are placed inside the component and displayed in an overlay. In example below, clicking the save button invokes save method of the bean and updates messages. Nested options defined as menuitems do ajax, non-ajax requests as well as regular navigation to an external url.
<p:splitButton value="Save" actionListener="#{buttonBean.save}" update="messages" icon="ui-icon-disk">
<p:menuitem value="Update" actionListener="#{buttonBean.update}" update="messages" icon="ui-icon-arrowrefresh-1-w"/>
<p:menuitem value="Delete" actionListener="#{buttonBean.delete}" ajax="false" icon="ui-icon-close"/>
<p:separator />
<p:menuitem value="Homepage" url=" http://www.primefaces.org
" icon="ui-icon-extlink"/>
</p:splitButton>
Client Side API
Widget: PrimeFaces.widget.SplitButton show()
Method
hide()
Params
-
-
Return Type
void void
Description
Displays overlay.
Hides overlay.
Skinning
SplitButton renders a container element which style and styleClass applies. Following is the list of structural style classes;
Style Class
.ui-splitbutton
.ui-button
.ui-splitbutton-menubutton
.ui-button-text-only
.ui-button-text
.ui-menu
.ui-menu-list
.ui-menuitem
.ui-menuitem-link
.ui-menuitem-text
Applies
Container element.
Button element
Dropdown button
Button element when icon is not used
Label of button
Container element of menu
List container
Each menu item
Anchor element in a link item
Text element in an item
As skinning style classes are global, see the main theming section for more information.
452
Λήψη
Διαφήμιση