Class UIButton

  • All Implemented Interfaces:
    EventListener, javax.faces.component.ActionSource, javax.faces.component.ActionSource2, javax.faces.component.behavior.ClientBehaviorHolder, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder, SupportFieldId, SupportsAccessKey, Visual

    @Generated("component.stg")
    public class UIButton
    extends AbstractUIButton
    implements SupportsAccessKey
    Renders a button element. UIComponent class, generated from template component.stg with class ButtonTagDeclaration.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String COMPONENT_FAMILY  
      static String COMPONENT_TYPE  
      • Fields inherited from class javax.faces.component.UIComponent

        BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, VIEW_LOCATION_KEY
    • Constructor Summary

      Constructors 
      Constructor Description
      UIButton()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Character getAccessKey()
      The access key of this control.
      String getConfirmation()
      Text to use as confirmation message.
      CustomClass getCustomClass()
      Sets a CSS class in its parent, if the parent supports it.
      String getDefaultEventName()  
      Collection<String> getEventNames()  
      String getFamily()  
      String getFragment()
      The identifier of the page fragment which should be brought into focus when the target page is rendered.
      String getImage()
      Url to an image to display.
      String getLabel()
      A localized user presentable label for this component.
      String getLink()
      Link to an arbitrary URL, either an internal link or an external link.
      Markup getMarkup()  
      String getOutcome()
      Link to an internal facelet page, like the outcome of an action.
      Integer getTabIndex()
      Controls the navigation of the focus through the input controls on a page with the Tab-Key.
      String getTarget()
      Name of a frame where the resource retrieved via this hyperlink is to be displayed.
      String getTip()
      Text value to display as tooltip.
      boolean isDefaultCommand()
      If true the command is executed as default -- for example if the user presses the enter key inside a related input field.
      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.
      boolean isTransition()
      Specify, if the command calls an JSF-Action.
      void restoreState​(javax.faces.context.FacesContext context, Object state)  
      void setAccessKey​(Character accessKey)  
      void setConfirmation​(String confirmation)  
      void setCustomClass​(CustomClass customClass)  
      void setDefaultCommand​(boolean defaultCommand)  
      void setFragment​(String fragment)  
      void setImage​(String image)  
      void setLabel​(String label)  
      void setLink​(String link)  
      void setMarkup​(Markup markup)  
      void setOmit​(boolean omit)  
      void setOutcome​(String outcome)  
      void setTabIndex​(Integer tabIndex)  
      void setTarget​(String target)  
      void setTip​(String tip)  
      void setTransition​(boolean transition)  
      • Methods inherited from class javax.faces.component.UICommand

        addActionListener, broadcast, getAction, getActionExpression, getActionListener, getActionListeners, getValue, isImmediate, removeActionListener, setAction, setActionExpression, setActionListener, setImmediate, setValue
      • Methods inherited from class javax.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, getRenderer, getRendererType, getRendersChildren, getValueBinding, initialStateMarked, invokeOnComponent, isTransient, markInitialState, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, visitTree
      • Methods inherited from class javax.faces.component.UIComponent

        getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getResourceBundleMap, getStateHelper, getStateHelper, getValueExpression, isCompositeComponent, isInView, isVisitable, popComponentFromEL, pushComponentToEL, setInView, setValueExpression, subscribeToEvent, unsubscribeFromEvent
      • Methods inherited from interface javax.faces.component.behavior.ClientBehaviorHolder

        addClientBehavior, getClientBehaviors
    • Constructor Detail

      • UIButton

        public UIButton()
    • Method Detail

      • getEventNames

        public Collection<String> getEventNames()
        Specified by:
        getEventNames in interface javax.faces.component.behavior.ClientBehaviorHolder
        Overrides:
        getEventNames in class javax.faces.component.UIComponentBase
      • getDefaultEventName

        public String getDefaultEventName()
        Specified by:
        getDefaultEventName in interface javax.faces.component.behavior.ClientBehaviorHolder
        Overrides:
        getDefaultEventName in class javax.faces.component.UIComponentBase
      • getFamily

        public String getFamily()
        Overrides:
        getFamily in class javax.faces.component.UICommand
      • getImage

        public String getImage()
        Url to an image to display.
      • 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:
        getLink in class AbstractUICommandBase
      • 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)
      • setConfirmation

        public void setConfirmation​(String confirmation)
      • 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:
        isTransition in class AbstractUICommandBase
      • 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. The target attribute is not reliable in combination with DeltaSpike and its
        Specified by:
        getTarget in class AbstractUICommandBase
      • 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:
        getFragment in class AbstractUICommandBase
      • setFragment

        public void setFragment​(String fragment)
      • 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:
        getCustomClass in interface Visual
      • 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:
        isOmit in class AbstractUICommandBase
      • 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:
        getOutcome in class AbstractUICommandBase
      • setOutcome

        public void setOutcome​(String outcome)
      • restoreState

        public void restoreState​(javax.faces.context.FacesContext context,
                                 Object state)
        Specified by:
        restoreState in interface javax.faces.component.StateHolder
        Overrides:
        restoreState in class javax.faces.component.UIComponentBase