Java Doc for RadioButton.java in  » IDE-Netbeans » visualweb.api.designer » com » sun » rave » web » ui » component » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » visualweb.api.designer » com.sun.rave.web.ui.component 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.sun.rave.web.ui.component.SelectorBase
   com.sun.rave.web.ui.component.Selector
      com.sun.rave.web.ui.component.RbCbSelectorBase
         com.sun.rave.web.ui.component.RbCbSelector
            com.sun.rave.web.ui.component.RadioButtonBase
               com.sun.rave.web.ui.component.RadioButton

RadioButton
public class RadioButton extends RadioButtonBase (Code)

A component that represents a radio button.

The RadioButton can be used as a single radio button or one radio button among a group of radio button. A group of radio button represents a multiple selection list which can have any number of radio button selected, or none selected. A radio button can represent a Boolean value, a String value, or a developer defined Object value.

Detecting a selected radio button

The RadioButton uses both the selected and selectedValue properties to pass information about the radio button's selection status. The selected property is used to indicate that the radio button is selected. The selectedValue property is used to pass a data value, a string by default, for the radio button. A radio button is considered to be selected when the value of the selected property is equal to the value of the selectedValue property. A radio button can be initally selected by assigning the same value to the selectedValue and the selected properties. isChecked is called to determine if this RadioButton is selected.

If the selectedValue property is not specified or its value is null then the radio button behaves like a boolean control. If the radio button is selected, the value of the selected property is a true Boolean instance. If the radio button is not selected, the value of the selected property will be a false Boolean instance.

Note that a value binding expression that evaluates to a primitive boolean value can be assigned to the selected property. Proper type coercion from Boolean to boolean occurs.

When a radio button is part of a group, the selected radio button is maintained as a request attribute in the RequestMap. The name of the attribute is the value of the radio button's name property. The request attribute value is the value of the selectedValue property of the selected radio button. The selected property of the selected radio button within the group, will also contain the value of the selectedValue property of the respective selected radio button. If no radio buttons are selected, no request attribute is created, however at least one radio button must be selected.

Note that the RadioButton does not enforce the requirement that at least one radio button must be selected. The application should ensure that this requirement is met.

Using a radio button tag as a boolean control

If the selectedValue property is not specified or its value is null then the radio button behaves like a boolean control.

To use the RadioButton as a boolean control, do not specify a value for the selectedValue property. The radio button is selected if the selected property is not null and has the value of a Boolean instance with a true value. If the radio button is not selected, then the value of the selected property is a false Boolean instance.

Note that using a boolean radio button in a group and referencing the request property for the selected radio button is not useful, since the value of the request property will be an indistinguishable true value.

Using a RadioButton to represent a developer defined value

The selectedValue property can be assigned a developer defined object value to represent the value of a selected radio button. If the radio button is selected, the value of the selected property is assigned the value of the selectedValue property.

If the value of the selectedValue property is a developer defined object, a Converter must be registered to convert to and from a String value.
In addition the object must support an equals method that returns true when the value of the selectedValue property is compared to the selected property value in order to detect a selected radio button.

Using a RadioButton as one control in a group

The name property determines whether a radio button is part of a group. A radio button is treated as part of a group of radio buttons if the name property of the radio button is assigned a value equal to the name property of the other radio buttons in the group. In other words, all radio button of a group have the same name property value. The group behaves like a single selection list, where only one radio button can be selected. The value of the name property must be unique within the scope of the Form parent containing the radio buttons.

Facets

The following facets are supported:

  • image If the image facet exists, it replaces the com.sun.rave.web.ui.component.ImageComponent subcompoent normally created for the image associated with the radio button, if the imageURL property is not null.
  • label If the label facet exists, it replaces the com.sun.rave.web.ui.component.Label subcomponent normally created for the label associated with the radio button, if the label property is not null.

Add an image or label facet to the RadioButton if more control over the properties of the subcomponents is needed.

Note that if a facet is exists, RadioButton properties that would normally be assigned to the created subcomponent, will not be assigned to the facet

Note that unexpected layout of the RadioButton may occur if the component specified by the facet is not a com.sun.rave.web.ui.component.ImageComponent for the image facet or com.sun.rave.web.ui.component.Label for the label facet.

ImageComponent and Label subcomponents

An image and a label may be associated with the RadioButton.
If the imageURL property is not null and an image facet does not exist then a com.sun.rave.web.ui.component.ImageComponent component is created.
If the label property is not null and a label facet does not exist then a com.sun.rave.web.ui.component.Label component is created.

The following RadioButton properties are assigned to the subcomponents only if a facet does not exist.
For the com.sun.rave.web.ui.component.ImageComponent subcomponent

    this.getId() + "_image" is assigned to the id property.
  • this.getImageURL() is assigned to the url property.
  • this.getToolTip() is assigned to the toolTip property.
  • this.getToolTip() is assigned to the alt property.
  • this.isVisible() is assigned to the visible property.
  • this.isRendered() is assigned to the renderer property.

For the com.sun.rave.web.ui.component.Label subcomponent

  • this.getId() + "_label" is assigned to the id property.
  • this.getClientId() is assigned to the for property.
  • this.getLabel() is assigned to the text property.
  • this.getLabelLevel is assigned to the labelLevel property.
  • this.getToolTip is assigned to the toolTip property.
  • this.isVisible is assigned to the visible property.
  • this.isRendered is assigned to the renderer property.

Note that if a value binding exists for one of the RadioButton properties mentioned above, the value binding is set on the subcomponent for that property.




Constructor Summary
public  RadioButton()
     Construct a RadioButton instance.

Method Summary
protected  voidaddToRequestMap(FacesContext context, String groupName)
    
public static  ObjectgetSelected(String name)
     Return the value of the selectedValue property of the selected radio button in the group of radio buttons identified by the name parameter.
public  voidvalidate(FacesContext context)
    

Update the request parameter that holds the value of the selectedValue property of the selected radio button.



Constructor Detail
RadioButton
public RadioButton()(Code)
Construct a RadioButton instance.




Method Detail
addToRequestMap
protected void addToRequestMap(FacesContext context, String groupName)(Code)



getSelected
public static Object getSelected(String name)(Code)
Return the value of the selectedValue property of the selected radio button in the group of radio buttons identified by the name parameter. A RadioButton is one of a group of radio buttons if more than on radio button has the same value for the name property.
When one of the radio buttons among that group is selected, the value of its selectedValue property is maintained in a request attribute identified by the value of its name property.
Parameters:
  name - the value a RadioButton name property.



validate
public void validate(FacesContext context)(Code)

Update the request parameter that holds the value of the selectedValue property of the selected radio button.

If the name property has been set a request attribute is created. The value of the name property will be used for the request attribute name and the value of the request attribute will be the value of the selectedValue property.

The request attribute described above is available during a ValueChangeEvent.


Parameters:
  context - The context of this request.



Methods inherited from com.sun.rave.web.ui.component.RadioButtonBase
public String getFamily()(Code)(Java Doc)
public int getLabelLevel()(Code)(Java Doc)
public void restoreState(FacesContext _context, Object _state)(Code)(Java Doc)
public Object saveState(FacesContext _context)(Code)(Java Doc)
public void setLabelLevel(int labelLevel)(Code)(Java Doc)

Fields inherited from com.sun.rave.web.ui.component.RbCbSelector
final public static String IMAGE_FACET(Code)(Java Doc)
final public static String LABEL_FACET(Code)(Java Doc)

Methods inherited from com.sun.rave.web.ui.component.RbCbSelector
protected void addToRequestMap(FacesContext context, String groupName)(Code)(Java Doc)
protected UIComponent createImageComponent()(Code)(Java Doc)
protected UIComponent createLabelComponent()(Code)(Java Doc)
public void encodeBegin(FacesContext context) throws IOException(Code)(Java Doc)
public Object getConvertedValue(FacesContext context, Object submittedValue) throws ConverterException(Code)(Java Doc)
public Object getConvertedValue(FacesContext context, RbCbSelector component, Object submittedValue) throws ConverterException(Code)(Java Doc)
public UIComponent getImageComponent()(Code)(Java Doc)
public UIComponent getLabelComponent()(Code)(Java Doc)
public Object getSelectedValue()(Code)(Java Doc)
public boolean isChecked()(Code)(Java Doc)

Methods inherited from com.sun.rave.web.ui.component.RbCbSelectorBase
public String getFamily()(Code)(Java Doc)
public String getImageURL()(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public Object getSelected()(Code)(Java Doc)
public Object getSelectedValue()(Code)(Java Doc)
public ValueBinding getValueBinding(String name)(Code)(Java Doc)
public void restoreState(FacesContext _context, Object _state)(Code)(Java Doc)
public Object saveState(FacesContext _context)(Code)(Java Doc)
public void setImageURL(String imageURL)(Code)(Java Doc)
public void setName(String name)(Code)(Java Doc)
public void setSelected(Object selected)(Code)(Java Doc)
public void setSelectedValue(Object selectedValue)(Code)(Java Doc)
public void setValueBinding(String name, ValueBinding binding)(Code)(Java Doc)

Fields inherited from com.sun.rave.web.ui.component.Selector
protected ValueTypeEvaluator valueTypeEvaluator(Code)(Java Doc)

Methods inherited from com.sun.rave.web.ui.component.Selector
protected boolean compareValues(Object previous, Object value)(Code)(Java Doc)
public Object getConvertedValue(FacesContext context, Object submittedValue) throws ConverterException(Code)(Java Doc)
public int getLabelLevel()(Code)(Java Doc)
public boolean getRendersChildren()(Code)(Java Doc)
protected String getValueAsReadOnly(FacesContext context)(Code)(Java Doc)
public boolean isMultiple()(Code)(Java Doc)
static void log(String s, Object o)(Code)(Java Doc)
void log(String s)(Code)(Java Doc)
public void setMultiple(boolean multiple)(Code)(Java Doc)
public void setSelected(Object selected)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from com.sun.rave.web.ui.component.SelectorBase
public String getFamily()(Code)(Java Doc)
public Object getItems()(Code)(Java Doc)
public String getLabel()(Code)(Java Doc)
public int getLabelLevel()(Code)(Java Doc)
public String getOnBlur()(Code)(Java Doc)
public String getOnChange()(Code)(Java Doc)
public String getOnClick()(Code)(Java Doc)
public String getOnDblClick()(Code)(Java Doc)
public String getOnFocus()(Code)(Java Doc)
public String getOnKeyDown()(Code)(Java Doc)
public String getOnKeyPress()(Code)(Java Doc)
public String getOnKeyUp()(Code)(Java Doc)
public String getOnMouseDown()(Code)(Java Doc)
public String getOnMouseMove()(Code)(Java Doc)
public String getOnMouseOut()(Code)(Java Doc)
public String getOnMouseOver()(Code)(Java Doc)
public String getOnMouseUp()(Code)(Java Doc)
public String getOnSelect()(Code)(Java Doc)
public Object getSelected()(Code)(Java Doc)
public String getStyle()(Code)(Java Doc)
public String getStyleClass()(Code)(Java Doc)
public int getTabIndex()(Code)(Java Doc)
public String getToolTip()(Code)(Java Doc)
public ValueBinding getValueBinding(String name)(Code)(Java Doc)
public boolean isDisabled()(Code)(Java Doc)
public boolean isReadOnly()(Code)(Java Doc)
public boolean isVisible()(Code)(Java Doc)
public void restoreState(FacesContext _context, Object _state)(Code)(Java Doc)
public Object saveState(FacesContext _context)(Code)(Java Doc)
public void setDisabled(boolean disabled)(Code)(Java Doc)
public void setItems(Object items)(Code)(Java Doc)
public void setLabel(String label)(Code)(Java Doc)
public void setLabelLevel(int labelLevel)(Code)(Java Doc)
public void setOnBlur(String onBlur)(Code)(Java Doc)
public void setOnChange(String onChange)(Code)(Java Doc)
public void setOnClick(String onClick)(Code)(Java Doc)
public void setOnDblClick(String onDblClick)(Code)(Java Doc)
public void setOnFocus(String onFocus)(Code)(Java Doc)
public void setOnKeyDown(String onKeyDown)(Code)(Java Doc)
public void setOnKeyPress(String onKeyPress)(Code)(Java Doc)
public void setOnKeyUp(String onKeyUp)(Code)(Java Doc)
public void setOnMouseDown(String onMouseDown)(Code)(Java Doc)
public void setOnMouseMove(String onMouseMove)(Code)(Java Doc)
public void setOnMouseOut(String onMouseOut)(Code)(Java Doc)
public void setOnMouseOver(String onMouseOver)(Code)(Java Doc)
public void setOnMouseUp(String onMouseUp)(Code)(Java Doc)
public void setOnSelect(String onSelect)(Code)(Java Doc)
public void setReadOnly(boolean readOnly)(Code)(Java Doc)
public void setSelected(Object selected)(Code)(Java Doc)
public void setStyle(String style)(Code)(Java Doc)
public void setStyleClass(String styleClass)(Code)(Java Doc)
public void setTabIndex(int tabIndex)(Code)(Java Doc)
public void setToolTip(String toolTip)(Code)(Java Doc)
public void setValueBinding(String name, ValueBinding binding)(Code)(Java Doc)
public void setVisible(boolean visible)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.