|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.woody.formmodel.AbstractWidget org.apache.cocoon.woody.formmodel.BooleanField
public class BooleanField
A widget to select a boolean value. Usually rendered as a checkbox.
You may wonder why we don't use a Field
widget with an associated
Boolean Datatype instead. The reason is that many of the features of the Field
widget are overkill for a Boolean: validation is unnecessary (if the field is
not true it is false), the selectionlist associated with a Datatype also
has no purpose here (there would always be only 2 choices: true or false),
and the manner in which the request parameter of this widget is interpreted
is different (missing or empty request parameter means 'false', rather than null value).
Constructor Summary | |
---|---|
BooleanField(BooleanFieldDefinition definition)
|
Method Summary | |
---|---|
void |
broadcastEvent(WidgetEvent event)
Broadcast an event previously queued by this widget to its event listeners. |
void |
generateLabel(ContentHandler contentHandler)
Generates SAX events for the label of this widget. |
void |
generateSaxFragment(ContentHandler contentHandler,
Locale locale)
Generates an XML representation of this widget. |
String |
getId()
Gets the id of this widget. |
Object |
getValue()
Returns the value of the widget. |
void |
readFromRequest(FormContext formContext)
Lets this widget read its data from a request. |
void |
setValue(Object object)
Sets value of the field. |
boolean |
validate(FormContext formContext)
Always return true (an action has no validation) |
Methods inherited from class org.apache.cocoon.woody.formmodel.AbstractWidget |
---|
addValidator, generateItemSaxFragment, generateSaxFragment, getForm, getFullyQualifiedId, getLocation, getNamespace, getParent, getWidget, isRequired, removeValidator, setDefinition, setLocation, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BooleanField(BooleanFieldDefinition definition)
Method Detail |
---|
public String getId()
AbstractWidget
getId
in interface Widget
getId
in class AbstractWidget
public void readFromRequest(FormContext formContext)
Widget
public boolean validate(FormContext formContext)
true
(an action has no validation)
validate
in interface Widget
validate
in class AbstractWidget
public void generateSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException
Widget
SAXException
public void generateLabel(ContentHandler contentHandler) throws SAXException
Widget
generateLabel
in interface Widget
generateLabel
in class AbstractWidget
SAXException
public Object getValue()
Widget
getValue
in interface Widget
getValue
in class AbstractWidget
public void setValue(Object object)
setValue
in interface Widget
setValue
in class AbstractWidget
public void broadcastEvent(WidgetEvent event)
Widget
broadcastEvent
in interface Widget
broadcastEvent
in class AbstractWidget
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |