|
jacquard 1.12.0 by The Web Engineering Factory and Toolworks | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.co.weft.htform.ResourceConsumerImpl
uk.co.weft.domutil.NodeGeneratorImpl
uk.co.weft.htform.Widget
uk.co.weft.htform.ActionWidget
An action widget for a hypertext form. Essentially a wrapper around a submit button, but... The theory of it is that the action widget carries it's own action. In practice, of course, because the HTML submit input specification makes the value of the submit input the same as the text on the submit input, there is no actual way of differentiating (at the receiving end) between two submit inputs with the same text.
So, You may have as many ActionWidgets as you like in a Form. If two (or more) do exactly the same thing there's no real harm in their having the same label. But: the despatcher method in the form will pass control to the execute() method of the first ActionWidget which claims it, and the default claim method matches the value against the value of the ActionWidget the user clicked. OK? Got that? You have been warned.
| Field Summary | |
static java.lang.String |
commandToken
|
| Fields inherited from class uk.co.weft.htform.Widget |
ACTIONCSSCLASS, akprompt, attrs, CONTEXTATTRIBUTESSUFFIX, cssClass, DANGEROUSCSSCLASS, debug, DEFAULTTOKEN, dflt, form, generateAs, GENERATEASHTML, GENERATEASXFORM, GENERATEASXML, help, HELPTOKEN, immutable, ISIMMUTABLETOKEN, ISMANDATORYTOKEN, mandatory, MANDATORYCSSCLASS, maxVisibleSize, name, NAMETOKEN, OPTIONALCSSCLASS, PREVIOUSVALUESUFFIX, prompt, PROMPTTOKEN, size, SIZETOKEN, type, TYPETOKEN |
| Fields inherited from class uk.co.weft.domutil.NodeGeneratorImpl |
namespaceURI |
| Fields inherited from class uk.co.weft.htform.ResourceConsumerImpl |
resourceBundleName |
| Fields inherited from interface uk.co.weft.domutil.NodeGenerator |
NAMESPACEURIMAGICTOKEN |
| Fields inherited from interface uk.co.weft.htform.ResourceConsumer |
RESOURCEBUNDLEMAGICTOKEN |
| Constructor Summary | |
ActionWidget()
set up my input type |
|
ActionWidget(java.lang.String myname)
I would like a name |
|
ActionWidget(java.lang.String name,
java.lang.String prompt)
name and prompt is better |
|
ActionWidget(java.lang.String name,
java.lang.String prompt,
java.lang.String help)
name, prompt and helptext is better still. |
|
| Method Summary | |
protected void |
execute(Context c)
the default execute method does nothing whatever. |
Node |
generateInnerHTML(Document doc,
Context context)
Generate a node representing the XHTML 1.0 representation of this widget. |
protected void |
layout(Context context,
java.lang.String inputType,
int tabIndex)
layout *just* the widget, without prompt, help, or surrounding context. |
protected boolean |
maybeExecute(Context context,
Context whinges)
decide whether to claim the right to execute my action in this context; if claiming the right execute the action and return true; otherwise just return false. |
protected boolean |
validateOK(Context context,
Context whinges)
Determine whether it is safe to execute in this context. |
| Methods inherited from class uk.co.weft.htform.Widget |
clone, generate, generateAttributes, generateAttributes, generateHTML, generateHTMLPrompt, generateValue, generateXML, getContextAttribute, getCssClass, getHeight, getHelp, getName, getPrompt, getTabPlaces, getType, getWidth, init, layout, layout, layout, layoutAttribute, layoutAttributes, layoutValue, makeReady, maybeLayout, maybeLayout, onloadRequest, onloadRequest, postProcess, preProcess, scriptRequest, scriptRequest, setAttribute, setContextAttribute, setCssClass, setDebug, setDefault, setHelp, setImmutable, setMandatory, setMandatory, setName, setPrompt, setSize, setType |
| Methods inherited from class uk.co.weft.domutil.NodeGeneratorImpl |
getNamespaceURI, setNamespaceURI |
| Methods inherited from class uk.co.weft.htform.ResourceConsumerImpl |
getContextOrResource, getResource, getResourceOrContext, getResourceString, grs, grs |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface uk.co.weft.domutil.NodeGenerator |
generate, getName, getNamespaceURI, init, setDebug |
| Field Detail |
public static final java.lang.String commandToken
| Constructor Detail |
public ActionWidget()
public ActionWidget(java.lang.String myname)
public ActionWidget(java.lang.String name,
java.lang.String prompt)
public ActionWidget(java.lang.String name,
java.lang.String prompt,
java.lang.String help)
| Method Detail |
protected void layout(Context context,
java.lang.String inputType,
int tabIndex)
throws DataFormatException,
javax.servlet.ServletException,
java.io.IOException
layout in class Widgetcontext - the service contextinputType - the input type to lay me out astabIndex - the tabindex to use, ot the tab index of my first
sub-widget if I have more than one
javax.servlet.ServletException - I don't, but things which specialise me may
java.io.IOException - if can't write to the output stream
DataFormatException
protected boolean maybeExecute(Context context,
Context whinges)
throws java.lang.Exception
context - the context containing all the values entered by
the userwhinges - a context containing exceptions thrown while
pre-processing widgets
java.lang.Exception
protected boolean validateOK(Context context,
Context whinges)
context - the context containing all the values entered by
the userwhinges - a context containing exceptions thrown while
pre-processing widgets
protected void execute(Context c)
throws java.lang.Exception
c - the context of this request
doesn't - actually throw any exception but things
which specialise it may want to.
java.lang.Exception
public Node generateInnerHTML(Document doc,
Context context)
throws GenerationException
generateInnerHTML in class Widgetdoc - the document within which I am to be createdcontext - the context in which I am to be created.
GenerationExceptionWidget.layout(Context),
Widget.generateHTML(Document, Context)
|
jacquard 1.12.0 by The Web Engineering Factory and Toolworks | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||