Java Doc for RadioButtonRenderer.java in  » IDE-Netbeans » visualweb.api.designer » com » sun » rave » web » ui » renderer » 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.renderer 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.sun.rave.web.ui.renderer.AbstractRenderer
   com.sun.rave.web.ui.renderer.RbCbRendererBase
      com.sun.rave.web.ui.renderer.RadioButtonRenderer

RadioButtonRenderer
public class RadioButtonRenderer extends RbCbRendererBase (Code)

The RadioButtonRenderer renders a com.sun.rave.web.ui.component.RadioButton component.

Encoding

The RadioButtonRenderer renders a RadioButton as:

  • An INPUT element of type radio for each radio button.
  • An optional image. The component rendered for this feature is obtained from a call to getImageComponent() on the component being rendered.
  • An optional label. The component rendered for this feature is obtained from a call to getLabelComponent() on the component being rendered.

The CSS selectors for the elements and components that comprise a radio button are identified by java constants defined in the ThemeStyles class.

  • RADIOBUTTON for the INPUT element
  • RADIOBUTTON_DISABLED for the INPUT element of a disabled radio button
  • RADIOBUTTON_LABEL for label component if a label is rendered
  • RADIOBUTTON_LABEL_DISABLED for a label component of a disabled radio button, if a label is rendered
  • RADIOBUTTON_IMAGE for an image component if an image is rendered
  • RADIOBUTTON_IMAGE_DISABLED for an image component of a disabled radio button if an image is rendered.
Note that these selectors are appended to any existing selectors that may already exist on the styleClass property of the RadioButton component and the optional image and label components.

For more details on the encoding the RadioButton component see the super class com.sun.rave.web.ui.renderer.RbCbRendererBase

Decoding

If the INPUT element representing a radio button is selected on the the client, the submitted request will contain a request parameter whose name is the value of the name attribute of the selected HTML INPUT element. The value of the request parameter will be the value of the value attribute of the selected HTML INPUT element.

The component being decoded is selected if the component's isDisabled and isReadOnly methods return false and:

  • a request parameter exists that is equal to its name property. If the name property is null, then a request parameter exists that is equal to its clientId property.

And

  • the request parameter's value is String.equal to the the component's selectedValue property, after conversion to a String, by calling ConversionUtilities.convertValueToString. If the component was encoded as a boolean control, then the request parameter's value must be equal to the component's clientId property.

If selected, a String[1] array is assigned as the component's submitted value where the single array element is the String version of the selectedValue property or "true" if the component was encoded as a boolean control.
If not selected, a String[0] array is assigned as the component's submitted value or a String[1] array where the single array element is "false" if the component was encoded as a boolean control.

If the component's isDisabled or isReadOnly methods return true no submitted value is assigned to the component, and results in a null submitted value implying the component was not submitted, and the state of the component is unchanged.

Since the RadioButtonRenderer only renders a single RadioButton component it cannot enforce that at least one radio button should be selected among a group of RadioButton components with the same name property.

If the RadioButton is selected, the selected property will be the same value as the selectedValue property. If more than one RadioButton component is encoded with the same name property and more than one RadioButton's is selectred, the last selected RadioButton component that is encoded will be appear as checked in the HTML page. Subsequently during the next submit, only the checked RadioButton component will be selected.



Field Summary
protected  String[]styles
    

Constructor Summary
public  RadioButtonRenderer()
    

Method Summary
public  voiddecode(FacesContext context, UIComponent component)
    

Decode the RadioButton selection.

If the value of the component's name property has been set, the value is used to match a request parameter. If it has not been set the component clientId is used to match a request parameter.

protected  StringgetStyle(Theme theme, int styleCode)
    
protected  booleanisSelected(FacesContext context, UIComponent component)
     Return true if the component is selected, false otherwise.
public  voidrenderEnd(FacesContext context, UIComponent component, ResponseWriter writer)
     RadioButtonRenderer renders the entire RadioButton component within the renderEnd method.
public  voidrenderStart(FacesContext context, UIComponent component, ResponseWriter writer)
     Ensure that the component to be rendered is a RadioButton instance.

Field Detail
styles
protected String[] styles(Code)




Constructor Detail
RadioButtonRenderer
public RadioButtonRenderer()(Code)
Creates a new instance of RadioButtonRenderer




Method Detail
decode
public void decode(FacesContext context, UIComponent component)(Code)

Decode the RadioButton selection.

If the value of the component's name property has been set, the value is used to match a request parameter. If it has not been set the component clientId is used to match a request parameter. If a match is found, and the value of the of the request parameter matches the String value of the component's selectedValue property, the radio button is selected. The component's submitted value is assigned a String[1] array where the single array element is the matching parameter value.

If no matching request parameter or value is found, an instance of String[0] is assigned as the submitted value, meaning that this is a component was not selected.

If the component was encoded as a boolean control the value of the matching request attribute will be the component's clientId property if selected. If selected the submitted value is new String[] { "true" } and new String[] { "false" } if not selected.

It is the developer's responsibility to ensure the validity of the name property (the name attribute on the INPUT element) by ensuring that it is unique to the radio buttons for a given group within a form.


Parameters:
  context - FacesContext for the request we are processing.
Parameters:
  component - The RadioButtoncomponent to be decoded.



getStyle
protected String getStyle(Theme theme, int styleCode)(Code)
Return the style class name for the structural element indicated by styleCode
Parameters:
  theme - The Theme for this request.
Parameters:
  styleCode - identifies the style class for the element aboutto be rendered.



isSelected
protected boolean isSelected(FacesContext context, UIComponent component)(Code)
Return true if the component is selected, false otherwise.
Parameters:
  context - FacesContext for the request we are processing.
Parameters:
  component - UIComponent to test for selected.



renderEnd
public void renderEnd(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException(Code)
RadioButtonRenderer renders the entire RadioButton component within the renderEnd method.
Parameters:
  context - FacesContext for the request we are processing.
Parameters:
  component - UIComponent to be decoded.



renderStart
public void renderStart(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException(Code)
Ensure that the component to be rendered is a RadioButton instance. Actual rendering occurs during renderEnd
Parameters:
  context - FacesContext for the request we are processing.
Parameters:
  component - UIComponent to be decoded.



Fields inherited from com.sun.rave.web.ui.renderer.RbCbRendererBase
final protected static int IMAGE(Code)(Java Doc)
final protected static int IMAGE_DIS(Code)(Java Doc)
final protected static int INPUT(Code)(Java Doc)
final protected static int INPUT_DIS(Code)(Java Doc)
final protected static int LABEL(Code)(Java Doc)
final protected static int LABEL_DIS(Code)(Java Doc)
final public static String RBCB_EVENTS_ATTRIBUTES(Code)(Java Doc)
final protected static int SPAN(Code)(Java Doc)
final protected static int SPAN_DIS(Code)(Java Doc)

Methods inherited from com.sun.rave.web.ui.renderer.RbCbRendererBase
public void encodeChildren(FacesContext context, UIComponent component) throws IOException(Code)(Java Doc)
public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException(Code)(Java Doc)
abstract protected String getStyle(Theme theme, int styleCode)(Code)(Java Doc)
abstract protected boolean isSelected(FacesContext context, UIComponent component)(Code)(Java Doc)
protected void renderImage(FacesContext context, UIComponent component, Theme theme, ResponseWriter writer) throws IOException(Code)(Java Doc)
protected void renderInput(FacesContext context, UIComponent component, Theme theme, ResponseWriter writer, String type) throws IOException(Code)(Java Doc)
protected void renderLabel(FacesContext context, UIComponent component, Theme theme, ResponseWriter writer) throws IOException(Code)(Java Doc)
protected void renderSelection(FacesContext context, UIComponent component, Theme theme, ResponseWriter writer, String type) throws IOException(Code)(Java Doc)

Fields inherited from com.sun.rave.web.ui.renderer.AbstractRenderer
final protected static String BUNDLE(Code)(Java Doc)
final public static String EVENTS_ATTRIBUTES(Code)(Java Doc)
final public static String I18N_ATTRIBUTES(Code)(Java Doc)

Methods inherited from com.sun.rave.web.ui.renderer.AbstractRenderer
protected void addBooleanAttributes(FacesContext context, UIComponent component, ResponseWriter writer, String names) throws IOException(Code)(Java Doc)
protected void addCoreAttributes(FacesContext context, UIComponent component, ResponseWriter writer, String styles) throws IOException(Code)(Java Doc)
protected void addIntegerAttributes(FacesContext context, UIComponent component, ResponseWriter writer, String names) throws IOException(Code)(Java Doc)
protected static void addStringAttributes(FacesContext context, UIComponent component, ResponseWriter writer, String names) throws IOException(Code)(Java Doc)
public void decode(FacesContext context, UIComponent component)(Code)(Java Doc)
public void encodeBegin(FacesContext context, UIComponent component) throws IOException(Code)(Java Doc)
public void encodeChildren(FacesContext context, UIComponent component) throws IOException(Code)(Java Doc)
public void encodeEnd(FacesContext context, UIComponent component) throws IOException(Code)(Java Doc)
protected Application getApplication()(Code)(Java Doc)
protected Object getAsObject(FacesContext context, UIComponent component, String value)(Code)(Java Doc)
protected String getAsString(FacesContext context, UIComponent component)(Code)(Java Doc)
protected ExternalContext getExternalContext()(Code)(Java Doc)
protected FacesContext getFacesContext()(Code)(Java Doc)
protected Object getSubmittedValue(FacesContext context, UIComponent component)(Code)(Java Doc)
protected boolean isDisabled(UIComponent component)(Code)(Java Doc)
protected boolean isPortlet(FacesContext context)(Code)(Java Doc)
protected boolean isReadOnly(UIComponent component)(Code)(Java Doc)
protected void renderAttributes(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException(Code)(Java Doc)
protected void renderEnd(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException(Code)(Java Doc)
protected void renderMarkup(FacesContext context, UIComponent component, ResponseWriter writer, Markup markup) throws IOException(Code)(Java Doc)
protected void renderStart(FacesContext context, UIComponent component, ResponseWriter writer) throws IOException(Code)(Java Doc)
protected void setSubmittedValue(FacesContext context, UIComponent component)(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.