|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.tagext.TagSupport javax.servlet.jsp.tagext.BodyTagSupport com.bea.wlw.netui.tags.AbstractBaseTag com.bea.wlw.netui.tags.DataSourceTag com.bea.wlw.netui.tags.DefaultableDataSourceTag com.bea.wlw.netui.tags.OptionsDataSourceTag com.bea.wlw.netui.tags.html.RadioButtonGroup
public class RadioButtonGroup
Groups a collection of RadioButtonOptions, and handles databinding of their values. If RadioButtonGroup uses any Format tags, it must have those tags come before above any nested RadioButtonOption tags.
Attribute Descriptions | |||
---|---|---|---|
Attribute | Required | Runtime Expression Evaluation | Data Bindable |
dataSource | Yes | No | Read / Write |
The name of a form bean property or an expression that contains the RadioButtonGroup state | |||
defaultValue | No | No | Read Only |
A literal value or an expression that is used to set the RadioButtonGroup's initial state | |||
disabled | No | No | Read Only |
A boolean value which if true will cause the RadioButtonGroup to be disabled. | |||
labelStyle | No | No | No |
The style of the label for each contained RadioButtonOption | |||
labelStyleClass | No | No | No |
The style class of the label for each contained RadioButtonOption | |||
optionsDataSource | No | No | Read Only |
An expression which is used to generate a set of dynamic RadioButtonOptions | |||
tagId | No | No | No |
The ID of this radioButtonGroup used by the enclosing html tag to get the tag's name for javascript purposes |
RadioButtonOption
,
Serialized Form<netui:radioButtonGroup optionsDataSource="{pageFlow.hashMap}" dataSource="{actionForm.selection}" />Assuming that the
optionsDataSource
attribute refers to the following HashMap object...
public HashMap hashMap = new HashMap(); protected void onCreate() { hashMap.put("value1", "Display Text 1"); hashMap.put("value2", "Display Text 2"); hashMap.put("value3", "Display Text 3"); }...then the following HTML will be generated in the browser...
<netui:radioButtonGroup dataSource="{actionForm.selection}"> <netui:radioButtonOption value="value1">Display Text 1</netui:radioButtonOption><br> <netui:radioButtonOption value="value2">Display Text 2</netui:radioButtonOption><br> <netui:radioButtonOption value="value3">Display Text 3</netui:radioButtonOption><br> </netui:radioButtonGroup>
[BEA_HOME]/weblogic81/samples/SamplesApp/WebApp/tagSamples/netui/radioButtons/
The <netui:radioButtonGroup> tag can generate a set of radiobutton options in two ways:
- they can be dynamically generated by pointing the <netui:radioButtonGroup> tag at a
java.util.HashMap
or String[] object- they can be statically generated by providing a set of children
RadioButtonOption
tags
Dynamically Generated Radiobutton Options
You can dynamically generate a set of radionbutton options by
pointing the <netui:radioButtonGroup> tag at a HashMap
(or any object that implements the java.util.Map
interface).
public HashMap hashMap = new HashMap(); hashMap.put("value1", "Display Text 1"); hashMap.put("value2", "Display Text 2"); hashMap.put("value3", "Display Text 3");
To point the <netui:radioButtonGroup>
at the Map object use the optionsDataSource
attribute.
<netui:radioButtonGroup optionsDataSource="{pageFlow.hashMap}">
In the generated radiobutton options, the display text and the submitted value can be made to differ. The HashMap keys will form the submitted values, while the HashMap entries will form the display texts.
<input type="radio" value="value1">Display Text 1</input> <input type="radio" value="value2">Display Text 2</input> <input type="radio" value="value3">Display Text 3</input>
Note that you can point the <netui:radioButtonGroup> tag at a String[] object. A set of radiobutton options will be generated, but there will be no difference between the display texts and the submitted values.
Statically Generated Radiobutton Options
To statically generate radiobutton options, place a set of <netui:radioButtonOption> tags inside the <netui:radioButtonGroup> tag.
<netui:radioButtonGroup dataSource="{actionForm.selection}"> <netui:radioButtonOption value="value1">Display Text 1</netui:radioButtonOption><br> <netui:radioButtonOption value="value2">Display Text 2</netui:radioButtonOption><br> <netui:radioButtonOption value="value3">Display Text 3</netui:radioButtonOption><br> </netui:radioButtonGroup>
Submitting Radionbutton Options
A <netui:radioButtonGroup> is submitted as a String value. Use the dataSource
attribute
to submit to a String object.
<netui:radioButtonGroup dataSource="{actionForm.selection}">
In this case, the <netui:radioButtonGroup> submits to a String field of a Form Bean.
public static class ProcessDataForm extends FormData { private String selection; public void setSelection(String selection) { this.selection = selection; } public String getSelection() { return this.selection; } }
Nested Class Summary | |
---|---|
static class |
RadioButtonGroup.RadioButtonGroupPrefixHandler
The handler for naming and indexing the RadioButtonGroup. |
Field Summary | |
---|---|
protected String |
defaultRadio
|
protected String |
labelStyle
|
protected String |
labelStyleClass
|
protected String |
match
The actual values we will match against, calculated in doStartTag(). |
static String |
RADIOBUTTONGROUP_KEY
|
protected String |
saveBody
The saved body content of this tag. |
Fields inherited from class com.bea.wlw.netui.tags.AbstractBaseTag |
---|
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, JAVASCRIPT_STATUS, NETUI_UNIQUE_CNT |
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
bodyContent |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
Fields inherited from interface com.bea.wlw.netui.tags.html.HtmlConstants |
---|
ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEIGHT, HREF, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, RULES, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TD, TEXT, TEXTAREA, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH |
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
RadioButtonGroup()
|
Method Summary | |
---|---|
int |
doAfterBody()
Save the body content of the RadioButtonGroup. |
int |
doEndTag()
Render the set of RadioButtonOptions. |
int |
doStartTag()
Determine the match for the RadioButtonGroup |
protected Object |
evaluateDefaultValue()
|
protected Object |
evaluateOptionsDataSource()
This method will evalute the optionsDataSource and return an object. |
String |
getDisabled()
Returns the boolean value or expression indicating the disable state of the RadioButtonGroup. |
String |
getLabelStyle()
Return the label style for each contained CheckBoxOption.. |
String |
getLabelStyleClass()
Return the label style class for each contained CheckBoxOption.. |
String |
getStyle()
Gets the style of the rendered html tag. |
String |
getStyleClass()
Gets the style class of the rendered html tag. |
String |
getTagId()
Return the ID of the radiobutton group. |
String |
getTagName()
Return the name of the Tag. |
boolean |
isMatched(String value)
Does the specified value match one of those we are looking for? |
protected void |
localRelease()
Release any acquired resources. |
String |
qualifyDataSource()
|
void |
setDisabled(String disabled)
Set the disable state either with the literal "true" or "false" or with an expression. |
void |
setLabelStyle(String labelStyle)
Set the label style for each contained CheckBoxOption.. |
void |
setLabelStyleClass(String labelStyleClass)
Set the label style class for each contained CheckBoxOption.. |
void |
setStyle(String style)
Sets the style of the rendered html tag. |
void |
setStyleClass(String styleClass)
Sets the style class of the rendered html tag. |
void |
setTagId(String tagId)
Set the ID of the radiobutton group. |
Methods inherited from class com.bea.wlw.netui.tags.OptionsDataSourceTag |
---|
getOptionsDataSource, setOptionsDataSource |
Methods inherited from class com.bea.wlw.netui.tags.DefaultableDataSourceTag |
---|
getDefaultValue, setDefaultValue |
Methods inherited from class com.bea.wlw.netui.tags.DataSourceTag |
---|
addNamingInterceptor, doNaming, evaluateDataSource, getDataSource, qualifyAttribute, removeNamingInterceptor, setDataSource |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
doInitBody, getBodyContent, getPreviousOut, setBodyContent |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
---|
getParent, setParent |
Field Detail |
---|
public static final String RADIOBUTTONGROUP_KEY
protected String match
protected String saveBody
protected String defaultRadio
protected String labelStyle
protected String labelStyleClass
Constructor Detail |
---|
public RadioButtonGroup()
Method Detail |
---|
public String getTagName()
getTagName
in class AbstractBaseTag
protected Object evaluateDefaultValue()
evaluateDefaultValue
in class DefaultableDataSourceTag
protected Object evaluateOptionsDataSource() throws javax.servlet.jsp.JspException
evaluateOptionsDataSource
in class OptionsDataSourceTag
javax.servlet.jsp.JspException
public String getLabelStyle()
public void setLabelStyle(String labelStyle)
labelStyle
- - the label stylepublic String getLabelStyleClass()
public void setLabelStyleClass(String labelStyleClass)
labelStyleClass
- - the label stylepublic void setStyle(String style)
style
- - the html style.public String getStyle()
public void setStyleClass(String styleClass)
styleClass
- - the html style class.public String getStyleClass()
public String getTagId()
public void setTagId(String tagId)
tagId
- - the ID.String value. Sets the id
(or name
) attribute of the rendered HTML tag.
Note that the real id attribute rendered in the browser may be
changed by the application container (for example, Portal containers may change
the rendered id value to ensure the uniqueness of
id's on the page). In this case, the real id rendered
in the browser may be looked up
through the JavaScript function getNetuiTagName( tagId, tag ).
For example, assume that some tag's tagId
attribute is set to foo
.
<netui:textBox tagId="foo" />
Then the following JavaScript function will return the real id attribute rendered in the browser:
getNetuiTagName( "foo", this )
To get a <netui:form> element and all of its children elements in JavaScript, use
the same JavaScript function getNetuiTagName( tagId, tag )
. For example,
assume that there is a <netui:form> whose
tagId attribute is set to bar
.
<netui:form tagId="bar" >
Then the following JavaScript function will return the <netui:form> element and its children (packaged as an array).
document[getNetuiTagName( "bar", this )]
To retreive the value entered into a <netui:textBox> within the <netui:form> tag, use the following JavaScript expression.
document[getNetuiTagName("bar", this)][getNetuiTagName("foo", this)].value
The second parameter ensures that the JavaScript function
begins its search within the correct Portlet scope. Pass the
JavaScript keyword this
as the second parameter.
For detailed information on using the function
getNetuiTagName( tagId, tag )
see
Using JavaScript in Page Flow and Portal Applications.
public String getDisabled()
public void setDisabled(String disabled)
disabled
- - true or false or an expressionpublic boolean isMatched(String value)
value
- Value to be comparedpublic int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
- if a JSP exception has occurredpublic int doAfterBody() throws javax.servlet.jsp.JspException
doAfterBody
in interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
- if a JSP exception has occurredpublic int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
- if a JSP exception has occurredprotected void localRelease()
localRelease
in class OptionsDataSourceTag
public String qualifyDataSource() throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException
|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |