com.sapportals.htmlb

Class RadioButtonGroup

java.lang.Object
  extended bycom.sapportals.htmlb.Component
      extended bycom.sapportals.htmlb.Container
          extended bycom.sapportals.htmlb.StatefulButtonGroupBase
              extended bycom.sapportals.htmlb.RadioButtonGroup
All Implemented Interfaces:
IUserDataComponent

public class RadioButtonGroup
extends com.sapportals.htmlb.StatefulButtonGroupBase
implements IUserDataComponent

Checkboxes grouped together.


Field Summary
static String UI_ID
           
static int VAR_BEGIN
           
static int VAR_BEGIN_ITEM
           
static int VAR_END
           
static int VAR_END_ITEM
           
 
Fields inherited from class com.sapportals.htmlb.Container
elements
 
Constructor Summary
RadioButtonGroup(String name)
          create new group wih name
 
Method Summary
 Component addComponent(Component component)
          Add a component to this container.
 Component addComponent(Component component, String key)
          Add component to this container.
 RadioButton addItem(String key)
          Add Item without text
 RadioButton addItem(String key, String text)
          Add Item with text to be displayed and according access key.
 String getAccessibilityDescription()
          get the semantical description of the component in it's applicationcontext used by screenreaders
 int getColumnCount()
          Get number of columns.
 StatefulButtonBase getComponentForKey(String key)
          Get inner component with given key.
 int getCurrentItem()
          Get current item.
 String getOnClick()
          get the event name
 RadioButton getRadioButtonForKey(String key)
          Get RadioButton in this group with specified key
 String getSelection()
          Get the selected Items key
 String getTextForKey(String key)
          Get Text of inner component with given key.
 String getUI()
          Get String specifier for this component.
 AbstractDataType getValueAsDataType()
           
 CellVAlign getVerticalAlignRbColumn()
          Deprecated. get the vertical alignment of radiobutton column column of the radio button group.
 CellVAlign getVerticalAlignTextColumn()
          Deprecated. get the vertical alignment of text/component column of the radio button group.
protected  void initFromPageContext(IPageContext pc, String baseId)
          Init from page context.
 void remove(String key)
          Remove component by key.
 void setAccessibilityDescription(String accessibilityDescription)
          sets the sematical description for the component in it's applicationcontext used by screenreaders
 void setColumnCount(int columnCount)
          Set number of columns for rendering.
 void setCurrentItem(int currentItem)
          Set current item.
 void setOnClick(String onClick)
          set the event name that is fired when the user clicks on this button
 void setSelection(String key)
          Set key of RadioButton that should be rendered as selected.
 void setVerticalAlign(CellVAlign radioButtonColumn, CellVAlign textColumn)
          Deprecated. set the vertical alignment of the radiobutton column and the text/component column of the radio button group.
 
Methods inherited from class com.sapportals.htmlb.Container
addRawText, addText, getChildCount, iterator, preRender, removeComponent, render
 
Methods inherited from class com.sapportals.htmlb.Component
getEncodedIdForForm, getId, getParent, initFromShortId, initializeFromId, isJsObjectNeeded, render, renderAsString, requiresForm, setId, setJsObjectNeeded, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UI_ID

public static final String UI_ID
See Also:
Constant Field Values

VAR_BEGIN

public static final int VAR_BEGIN
See Also:
Constant Field Values

VAR_END

public static final int VAR_END
See Also:
Constant Field Values

VAR_BEGIN_ITEM

public static final int VAR_BEGIN_ITEM
See Also:
Constant Field Values

VAR_END_ITEM

public static final int VAR_END_ITEM
See Also:
Constant Field Values
Constructor Detail

RadioButtonGroup

public RadioButtonGroup(String name)
create new group wih name

Method Detail

addItem

public RadioButton addItem(String key)
Add Item without text


getRadioButtonForKey

public RadioButton getRadioButtonForKey(String key)
Get RadioButton in this group with specified key


setSelection

public void setSelection(String key)
Set key of RadioButton that should be rendered as selected.

Parameters:
key - of RadioButton which should be selected

getSelection

public String getSelection()
Get the selected Items key

Returns:
key if an item is selected otherwise null

addItem

public RadioButton addItem(String key,
                           String text)
Add Item with text to be displayed and according access key.


addComponent

public Component addComponent(Component component,
                              String key)
Add component to this container. If component is a RadioButton it will be added unmodified. If it is another Component a new Checkbox will be generated and the given component will be set as element type.

Parameters:
component - the component to add
key - component key

addComponent

public Component addComponent(Component component)
Add a component to this container. It is better use addComponent(Component component, String key). If component is a RadioButton it will be added unmodified. If it is another Component a new RadioButton will be generated and the given component will be set as element type. DONT FORGET TO SET KEY OF RadioButton BEFORE RENDERING!

Overrides:
addComponent in class Container
Parameters:
component - the component to add
Returns:
the added RadioButton (WARNING: no key set)
See Also:
addComponent(Component, String)

getOnClick

public String getOnClick()
get the event name

Returns:
the event name

setOnClick

public void setOnClick(String onClick)
set the event name that is fired when the user clicks on this button

Parameters:
onClick - the name of the event

getUI

public String getUI()
Get String specifier for this component.

Specified by:
getUI in class Component
Returns:
a unique identification string for this Component

initFromPageContext

protected void initFromPageContext(IPageContext pc,
                                   String baseId)
Init from page context.

Overrides:
initFromPageContext in class Component
Parameters:
pc - IPageContext
baseId - the prefix used for the component. (The result of a former RenderUtil.getIdForForm(rc, c);)
See Also:
addComponent(Component, String)

getValueAsDataType

public AbstractDataType getValueAsDataType()
Specified by:
getValueAsDataType in interface IUserDataComponent

setVerticalAlign

public void setVerticalAlign(CellVAlign radioButtonColumn,
                             CellVAlign textColumn)
Deprecated. set the vertical alignment of the radiobutton column and the text/component column of the radio button group.

Parameters:
radioButtonColumn - CellVAlign vertical align of the radio button column
textColumn - CellVAlign vertical align of the text/component column

getVerticalAlignTextColumn

public CellVAlign getVerticalAlignTextColumn()
Deprecated. get the vertical alignment of text/component column of the radio button group.

Returns:
the alignment of the text/component column as CellVAlign

getVerticalAlignRbColumn

public CellVAlign getVerticalAlignRbColumn()
Deprecated. get the vertical alignment of radiobutton column column of the radio button group.

Returns:
the alignment of the text/component column as CellVAlign

getAccessibilityDescription

public String getAccessibilityDescription()
get the semantical description of the component in it's applicationcontext used by screenreaders

Returns:
description text

setAccessibilityDescription

public void setAccessibilityDescription(String accessibilityDescription)
sets the sematical description for the component in it's applicationcontext used by screenreaders

Parameters:
accessibilityDescription - description text
Returns:

getTextForKey

public String getTextForKey(String key)
Get Text of inner component with given key.

Parameters:
key - String specifying the inner component key

getComponentForKey

public StatefulButtonBase getComponentForKey(String key)
Get inner component with given key.

Parameters:
key - String specifying the inner component key

getColumnCount

public int getColumnCount()
Get number of columns.

Returns:
int specifying number of columns (defaults to 1)

setColumnCount

public void setColumnCount(int columnCount)
Set number of columns for rendering.

Parameters:
columnCount - specify number of columns

remove

public void remove(String key)
Remove component by key.

Parameters:
key - Key of component to remove

getCurrentItem

public int getCurrentItem()
Get current item. ONLY FOR INTERNAL USE IN RENDER CLASSES!

Returns:
current item.

setCurrentItem

public void setCurrentItem(int currentItem)
Set current item. ONLY FOR INTERNAL USE IN RENDER CLASSES!

Parameters:
currentItem - int


Copyright 2006 SAP AG Complete Copyright Notice