|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.forms.formmodel.AbstractWidget org.apache.cocoon.forms.formmodel.Messages
public class Messages
A widget to output one or messages. This widget doesn't respond to input from the user, except that on each form submit the messages are cleared.
This widget is typically used to communicate extra validation errors or other messages to the user, that aren't associated with any other widget in particular.
Field Summary |
---|
Fields inherited from class org.apache.cocoon.forms.formmodel.AbstractWidget |
---|
wasValid |
Fields inherited from interface org.apache.cocoon.forms.formmodel.Widget |
---|
PATH_SEPARATOR |
Constructor Summary | |
---|---|
protected |
Messages(MessagesDefinition definition)
|
Method Summary | |
---|---|
void |
addMessage(String message)
Adds a string message. |
void |
addMessage(XMLizable message)
Adds a message in the form an object that implements the XMLizable interface. |
void |
generateItemSaxFragment(ContentHandler contentHandler,
Locale locale)
Generates nested additional content nested inside the main element for this widget which is generated by AbstractWidget.generateSaxFragment(ContentHandler, Locale)
The implementation on the AbstractWidget level inserts no additional XML. |
WidgetDefinition |
getDefinition()
Concrete subclasses should allow access to their underlaying Definition through this method. |
String |
getXMLElementName()
The XML element name used in AbstractWidget.generateSaxFragment(ContentHandler, Locale)
to produce the wrapping element for all the XML-instance-content of this Widget. |
void |
readFromRequest(FormContext formContext)
Lets this widget read its data from a request. |
boolean |
validate()
Validates this widget and returns the outcome. |
Methods inherited from class org.apache.cocoon.forms.formmodel.AbstractWidget |
---|
addValidator, broadcastEvent, generateDisplayData, generateLabel, generateSaxFragment, getAttribute, getChild, getCombinedState, getForm, getFullName, getId, getLocation, getName, getParent, getRequestParameterName, getState, getValue, getWidget, getXMLElementAttributes, initialize, isRequired, isValid, lookupWidget, removeAttribute, removeValidator, setAttribute, setParent, setState, setValue, toString, widgetNameChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected Messages(MessagesDefinition definition)
Method Detail |
---|
public WidgetDefinition getDefinition()
AbstractWidget
null
they should also organize
own implementations of AbstractWidget.getId()
, AbstractWidget.getLocation()
,
AbstractWidget.validate()
, AbstractWidget.generateLabel(ContentHandler)
and
AbstractWidget.generateDisplayData(ContentHandler)
to avoid NPE's.
getDefinition
in interface Widget
getDefinition
in class AbstractWidget
WidgetDefinition.createInstance()
)public void readFromRequest(FormContext formContext)
Widget
public boolean validate()
Widget
Widget.generateSaxFragment(ContentHandler, Locale)
method.
validate
in interface Widget
validate
in class AbstractWidget
true
to indicate all validations were ok,
false
otherwiseWidget.validate()
public void addMessage(String message)
public void addMessage(XMLizable message)
A useful implementation is I18nMesage
.
public String getXMLElementName()
AbstractWidget
AbstractWidget.generateSaxFragment(ContentHandler, Locale)
to produce the wrapping element for all the XML-instance-content of this Widget.
getXMLElementName
in class AbstractWidget
public void generateItemSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException
AbstractWidget
AbstractWidget.generateSaxFragment(ContentHandler, Locale)
The implementation on the AbstractWidget level inserts no additional XML.
Subclasses need to override to insert widget specific content.
generateItemSaxFragment
in class AbstractWidget
contentHandler
- to send the SAX events tolocale
- in which context potential content needs to be put.
SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |