org.richfaces.ui.toggle.toggleControl

## Class ToggleControl

- java.lang.Object
- - javax.faces.component.behavior.BehaviorBase
  - - javax.faces.component.behavior.ClientBehaviorBase
    - - org.richfaces.ui.behavior.ClientBehavior
      - - org.richfaces.ui.toggle.toggleControl.ToggleControl

- All Implemented Interfaces:
    javax.faces.component.behavior.Behavior, javax.faces.component.behavior.ClientBehavior, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder

      public class ToggleControl
      extends ClientBehavior

  The <r:toggleControl> behavior can be attached to any interface component, whether inside or outside the controlled panel itself. It works with a <r:togglePanel> component to switch between different <r:togglePanelItem> components.

  Author:
    akolonitsky

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `BEHAVIOR_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ToggleControl()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Boolean` | `getDisableDefault()`
    `static AbstractTogglePanel` | `getEnclosedPanel(javax.faces.component.UIComponent comp)`
    `String` | `getEvent()` The event on which to toggle the target panel
    `AbstractTogglePanel` | `getPanel(javax.faces.component.UIComponent comp)`
    `String` | `getPanelId(javax.faces.component.behavior.ClientBehaviorContext behaviorContext)`
    `String` | `getRendererType()`
    `String` | `getTargetItem()` The next <r:togglePanelItem> to switch to
    `String` | `getTargetPanel()` The <r:togglePanel> to switch when this <r:toggleControl> is not a child of a <r:togglePanel>
    `void` | `setDisableDefault(Boolean disableDefault)` If "true", disable the default action of the parent component
    `void` | `setEvent(String eventName)`
    `void` | `setLiteralAttribute(String name, Object value)`
    `void` | `setTargetItem(String target)`
    `void` | `setTargetPanel(String selector)`

    - ### Methods inherited from class org.richfaces.ui.behavior.ClientBehavior

      `compare, getFacesContext, getStateHelper, getValueExpression, restoreState, saveState, setLiteralValue, setValueExpression`

    - ### Methods inherited from class javax.faces.component.behavior.ClientBehaviorBase

      `decode, getHints, getRenderer, getScript`

    - ### Methods inherited from class javax.faces.component.behavior.BehaviorBase

      `addBehaviorListener, broadcast, clearInitialState, initialStateMarked, isTransient, markInitialState, removeBehaviorListener, setTransient`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface javax.faces.component.behavior.Behavior

      `broadcast`

- - ### Field Detail

    - #### BEHAVIOR_ID

          public static final String BEHAVIOR_ID

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ToggleControl

          public ToggleControl()

  - ### Method Detail

    - #### getEvent

          public String getEvent()

      The event on which to toggle the target panel

    - #### setEvent

          public void setEvent(String eventName)

    - #### getTargetItem

          public String getTargetItem()

      The next <r:togglePanelItem> to switch to

    - #### setTargetItem

          public void setTargetItem(String target)

    - #### getTargetPanel

          public String getTargetPanel()

      The <r:togglePanel> to switch when this <r:toggleControl> is not a child of a <r:togglePanel>

    - #### setTargetPanel

          public void setTargetPanel(String selector)

    - #### setDisableDefault

          public void setDisableDefault(Boolean disableDefault)

      If "true", disable the default action of the parent component

    - #### getDisableDefault

          public Boolean getDisableDefault()

    - #### getPanelId

          public String getPanelId(javax.faces.component.behavior.ClientBehaviorContext behaviorContext)
                            throws javax.faces.FacesException

      Throws:
        `javax.faces.FacesException`

    - #### getPanel

          public AbstractTogglePanel getPanel(javax.faces.component.UIComponent comp)
                                       throws javax.faces.FacesException

      Throws:
        `javax.faces.FacesException`

    - #### getEnclosedPanel

          public static AbstractTogglePanel getEnclosedPanel(javax.faces.component.UIComponent comp)

    - #### getRendererType

          public String getRendererType()

      Overrides:
        `getRendererType` in class `javax.faces.component.behavior.ClientBehaviorBase`

    - #### setLiteralAttribute

          public void setLiteralAttribute(String name,
                                 Object value)

      Specified by:
        `setLiteralAttribute` in class `ClientBehavior`

Copyright © 2014 JBoss by Red Hat. All rights reserved.