Class UIButton
- java.lang.Object
-
- jakarta.faces.component.UIComponent
-
- jakarta.faces.component.UIComponentBase
-
- jakarta.faces.component.UICommand
-
- All Implemented Interfaces:
jakarta.faces.component.ActionSource,jakarta.faces.component.ActionSource2,jakarta.faces.component.behavior.ClientBehaviorHolder,jakarta.faces.component.PartialStateHolder,jakarta.faces.component.StateHolder,jakarta.faces.component.TransientStateHolder,jakarta.faces.event.ComponentSystemEventListener,jakarta.faces.event.FacesListener,jakarta.faces.event.SystemEventListenerHolder,EventListener,SupportFieldId,SupportsAccessKey,SupportsAutoSpacing,Visual
@Generated("component.stg") public class UIButton extends AbstractUIButton implements SupportsAccessKeyRenders a button element. UIComponent class, generated from templatecomponent.stgwith classButtonTagDeclaration.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOMPONENT_FAMILYstatic StringCOMPONENT_TYPE
-
Constructor Summary
Constructors Constructor Description UIButton()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CharactergetAccessKey()The access key of this control.BooleangetAutoSpacing()Automatically add spacing (margins/paddings) to the component for better positioning.StringgetConfirmation()Text to use as confirmation message.CustomClassgetCustomClass()Sets a CSS class in its parent, if the parent supports it.StringgetDefaultEventName()Collection<String>getEventNames()StringgetFamily()StringgetFragment()The identifier of the page fragment which should be brought into focus when the target page is rendered.StringgetImage()Url to an image to display.StringgetLabel()A localized user presentable label for this component.StringgetLink()Link to an arbitrary URL, either an internal link or an external link.MarkupgetMarkup()StringgetOutcome()Link to an internal facelet page, like the outcome of an action.IntegergetTabIndex()Controls the navigation of the focus through the input controls on a page with the Tab-Key.StringgetTarget()Name of a frame where the resource retrieved via this hyperlink is to be displayed.StringgetTip()Text value to display as tooltip.booleanisDefaultCommand()If true the command is executed as default -- for example if the user presses the enter key inside a related input field.booleanisOmit()Flag indicating that the action of this element, will not be executed from client side (e. g. when the user clicks a button.booleanisTransition()Specify, if the command calls an JSF-Action.voidrestoreState(jakarta.faces.context.FacesContext context, Object state)voidsetAccessKey(Character accessKey)voidsetAutoSpacing(Boolean autoSpacing)voidsetConfirmation(String confirmation)voidsetCustomClass(CustomClass customClass)voidsetDefaultCommand(boolean defaultCommand)voidsetFragment(String fragment)voidsetImage(String image)voidsetLabel(String label)voidsetLink(String link)voidsetMarkup(Markup markup)voidsetOmit(boolean omit)voidsetOutcome(String outcome)voidsetTabIndex(Integer tabIndex)voidsetTarget(String target)voidsetTip(String tip)voidsetTransition(boolean transition)-
Methods inherited from class org.apache.myfaces.tobago.internal.component.AbstractUICommand
getFieldId, isParentOfCommands
-
Methods inherited from class org.apache.myfaces.tobago.internal.component.AbstractUICommandBase
isDisabled, isRendered, processDecodes, processEvent, queueEvent, setDisabled
-
Methods inherited from class jakarta.faces.component.UICommand
addActionListener, broadcast, getActionExpression, getActionListeners, getValue, isImmediate, removeActionListener, setActionExpression, setImmediate, setValue
-
Methods inherited from class jakarta.faces.component.UIComponentBase
addClientBehavior, addFacesListener, clearInitialState, decode, encodeAll, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isTransient, markInitialState, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, visitTree
-
Methods inherited from class jakarta.faces.component.UIComponent
getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, subscribeToEvent, unsubscribeFromEvent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jakarta.faces.component.behavior.ClientBehaviorHolder
addClientBehavior, getClientBehaviors
-
Methods inherited from interface org.apache.myfaces.tobago.component.SupportsAutoSpacing
getAutoSpacing
-
Methods inherited from interface org.apache.myfaces.tobago.component.Visual
getRendererType, isPlain
-
-
-
-
Field Detail
-
COMPONENT_TYPE
public static final String COMPONENT_TYPE
-
COMPONENT_FAMILY
public static final String COMPONENT_FAMILY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getEventNames
public Collection<String> getEventNames()
- Specified by:
getEventNamesin interfacejakarta.faces.component.behavior.ClientBehaviorHolder- Overrides:
getEventNamesin classjakarta.faces.component.UIComponentBase
-
getDefaultEventName
public String getDefaultEventName()
- Specified by:
getDefaultEventNamein interfacejakarta.faces.component.behavior.ClientBehaviorHolder- Overrides:
getDefaultEventNamein classjakarta.faces.component.UIComponentBase
-
getFamily
public String getFamily()
- Overrides:
getFamilyin classjakarta.faces.component.UICommand
-
getImage
public String getImage()
Url to an image to display.- Specified by:
getImagein classAbstractUICommand
-
setImage
public void setImage(String image)
-
getLink
public String getLink()
Link to an arbitrary URL, either an internal link or an external link. For internal URLs, a session id will be added, if needed (when cookies disabled). The context path needs to be added manually e.g. #{request.contextPath}. For JSF navigation to a viewId use the outcome attribute!
The semantic of this attributes has been changed from Tobago 3 to 4!
- Specified by:
getLinkin classAbstractUICommandBase
-
setLink
public void setLink(String link)
-
getTabIndex
public Integer getTabIndex()
Controls the navigation of the focus through the input controls on a page with the Tab-Key. The navigation starts from the element with the lowest tabIndex value to the element with the highest value. Elements that have identical tabIndex values should be navigated in the order they appear in the character stream Elements that are disabled or with a negative tabIndex do not participate in the tabbing order.
-
setTabIndex
public void setTabIndex(Integer tabIndex)
-
getConfirmation
public String getConfirmation()
Text to use as confirmation message.- Specified by:
getConfirmationin classAbstractUICommandBase
-
setConfirmation
public void setConfirmation(String confirmation)
-
getLabel
public String getLabel()
A localized user presentable label for this component.- Specified by:
getLabelin interfaceSupportsAccessKey- Specified by:
getLabelin classAbstractUICommand
-
setLabel
public void setLabel(String label)
-
isTransition
public boolean isTransition()
Specify, if the command calls an JSF-Action. Useful to switch off the Double-Submit-Check and Waiting-Behavior.
Default:true- Specified by:
isTransitionin classAbstractUICommandBase
-
setTransition
public void setTransition(boolean transition)
-
getTarget
public String getTarget()
Name of a frame where the resource retrieved via this hyperlink is to be displayed.- Specified by:
getTargetin classAbstractUICommandBase
-
setTarget
public void setTarget(String target)
-
isDefaultCommand
public boolean isDefaultCommand()
If true the command is executed as default -- for example if the user presses the enter key inside a related input field.
Default:false
-
setDefaultCommand
public void setDefaultCommand(boolean defaultCommand)
-
getFragment
public String getFragment()
The identifier of the page fragment which should be brought into focus when the target page is rendered. The value of this attribute is appended to the end of target URL following a hash (#) mark. This notation is part of the standard URL syntax.- Specified by:
getFragmentin classAbstractUICommandBase
-
setFragment
public void setFragment(String fragment)
-
getAutoSpacing
public Boolean getAutoSpacing()
Automatically add spacing (margins/paddings) to the component for better positioning. Default is 'true' except the component is inside a: - header - footer - bar - sheet - tree - link group - button group - before facet - after facet - label facet - bar facet- Specified by:
getAutoSpacingin interfaceSupportsAutoSpacing
-
setAutoSpacing
public void setAutoSpacing(Boolean autoSpacing)
-
getAccessKey
public Character getAccessKey()
The access key of this control.- Specified by:
getAccessKeyin interfaceSupportsAccessKey
-
setAccessKey
public void setAccessKey(Character accessKey)
-
getCustomClass
public CustomClass getCustomClass()
Sets a CSS class in its parent, if the parent supports it. Which this feature it is possible to put a CSS class name into a component with the <tc:style> tag. Example:<tc:in> <tc:style customClass="my-emphasized"/> </tc:in>One capability is, to used external CSS libs.
This feature should not be used imprudent. Because it might be unstable against changes in the renderered HTML code.- Specified by:
getCustomClassin interfaceVisual
-
setCustomClass
public void setCustomClass(CustomClass customClass)
- Specified by:
setCustomClassin interfaceVisual
-
getTip
public String getTip()
Text value to display as tooltip.
-
setTip
public void setTip(String tip)
-
isOmit
public boolean isOmit()
Flag indicating that the action of this element, will not be executed from client side (e. g. when the user clicks a button. When setting this value to true, the action will not be executed by the Tobago, but it can executed by JavaScript. This attribute is useful, when you want to add JavaScript event handlers to commands manually. In this case you usually don't want a submit with a full reload of the page.
Default:false- Specified by:
isOmitin classAbstractUICommandBase
-
setOmit
public void setOmit(boolean omit)
- Specified by:
setOmitin classAbstractUICommandBase
-
getOutcome
public String getOutcome()
Link to an internal facelet page, like the outcome of an action. The context path will be added. A session id will be added, if needed.- Specified by:
getOutcomein classAbstractUICommandBase
-
setOutcome
public void setOutcome(String outcome)
-
restoreState
public void restoreState(jakarta.faces.context.FacesContext context, Object state)- Specified by:
restoreStatein interfacejakarta.faces.component.StateHolder- Overrides:
restoreStatein classjakarta.faces.component.UIComponentBase
-
-