|
PAJES 3.0.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pajes.html.Tag
org.pajes.html.Input
org.pajes.html.Submit
org.pajes.html.SubmitAnchor
public class SubmitAnchor
This class builds an HTML ANCHOR tag (<A></A>) that can submit a form or act as a standard hyper-link.
| Field Summary |
|---|
| Fields inherited from class org.pajes.html.Tag |
|---|
ON_CLICK_ATTRIBUTE, TAG_CLOSE, TAG_LEFT, TAG_RIGHT |
| Constructor Summary | |
|---|---|
SubmitAnchor(Anchor source,
Form form)
Create an HTML Anchor tag which performs a submit of a form for an existing Anchor instance. |
|
SubmitAnchor(Form form,
HTML object)
Create an HTML Anchor tag which performs a submit of a form. |
|
SubmitAnchor(Form form,
HTML object,
boolean disableOnClickValidation)
Create an HTML Anchor tag which performs a submit of a form. |
|
SubmitAnchor(Form form,
java.lang.String text)
Create an HTML Anchor tag which performs a submit of a form. |
|
SubmitAnchor(Form form,
java.lang.String text,
boolean disableOnClickValidation)
Create an HTML Anchor tag which performs a submit of a form. |
|
| Method Summary | |
|---|---|
SubmitAnchor |
addParameter(java.lang.String name)
Add a parameter to the URL where the value of the parameter is determined from the current request (either the query string or a submitted form). |
SubmitAnchor |
addParameter(java.lang.String name,
Input field)
Add a parameter to the URL where the value of the parameter is determined at button press time by the value of a specified Input field. |
SubmitAnchor |
addParameter(java.lang.String name,
java.lang.String value)
Add a parameter to the URL. |
java.lang.Object |
clone()
Performs a deep clone, cloning and replacing the validation functions, and fixing "this" parameter references. |
java.lang.String |
getContainedText()
Returns the text that this object contains. |
protected HTML |
getText()
Returns the text that this anchor or link surrounds. |
protected void |
init()
Called by the constructor and the Tag.destroy() method to correctly
clear and initialise internal variables. |
SubmitAnchor |
setBase(java.lang.String href)
Sets the base URL. |
SubmitAnchor |
setTarget(java.lang.String frameTarget)
Sets the target frame of the anchor. |
SubmitAnchor |
setText(HTML text)
Sets the text of the anchor. |
SubmitAnchor |
setText(java.lang.String text)
Sets the text of the anchor. |
SubmitAnchor |
setURL(java.lang.String url)
Sets the destination URL of the anchor. |
Input |
setValue(java.lang.String value)
Over-rides Input.setValue(java.lang.String) to consistently set the display value
of that anchor, in the same way that setValue on SubmitButton sets the
display value of the button. |
protected void |
writeContent(Browser browser)
Called by the Submit.write(org.pajes.servlet.Browser) method to write the actual tag to the
browser. |
protected void |
writeSubmitJavaScript(Browser browser,
java.lang.StringBuilder onClickHandler)
Called by the Submit.write(org.pajes.servlet.Browser) method to append the appropriate
JavaScript to the OnClick handler written to the browser to handle the
form submission. |
| Methods inherited from class org.pajes.html.Submit |
|---|
getHiddenField, getHiddenFieldValue, getInactiveText, isActive, isOnChangeCheckingDisabled, isOnClickValidationDisabled, setActive, setChanged, setCheckForChangedFields, setCheckForChangedFieldsConfirmation, setHiddenField, setInactiveText, setInactiveText, setOnClickValidation, setSubmitConfirmation, write, writeTag |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SubmitAnchor(Anchor source,
Form form)
source - the Anchor instance to be copied.form - the form which is to be submitted.
public SubmitAnchor(Form form,
HTML object)
form - the form which is to be submitted.object - the HTML Object to appear in the anchor
public SubmitAnchor(Form form,
HTML object,
boolean disableOnClickValidation)
form - the form which is to be submitted.object - the HTML Object to appear in the anchordisableOnClickValidation - if true, suppresses the onClick validation.
public SubmitAnchor(Form form,
java.lang.String text)
form - the form which is to be submitted.text - the text to appear in the anchor.
public SubmitAnchor(Form form,
java.lang.String text,
boolean disableOnClickValidation)
form - the form which is to be submitted.text - the text to appear in the anchor.disableOnClickValidation - if true, suppresses the onClick validation.| Method Detail |
|---|
public SubmitAnchor addParameter(java.lang.String name)
name - the name of the variable name.
public SubmitAnchor addParameter(java.lang.String name,
Input field)
throws java.lang.IllegalArgumentException
Note that you cannot add another SubmitAnchor as a
parameter. this will throw an IllegalArgumentException.
name - the name of the variable namefield - the Input field containing the value
java.lang.IllegalArgumentException - if the field is an instance of SubmitAnchor.
public SubmitAnchor addParameter(java.lang.String name,
java.lang.String value)
name - the name of the variable name.value - the value of the parameter.
public java.lang.Object clone()
clone in interface HTMLclone in class Inputpublic java.lang.String getContainedText()
getContainedText in interface TextContainerpublic SubmitAnchor setBase(java.lang.String href)
SubmitAnchor builds a string of
JavaScript to carry out its functionality, and relies on the
location.href= syntax. However, if a relative URL is used and a <BASE> header tag relied upon, the process will fail as
location.href= does not appear ot observer the
<BASE> tag.
href - the base URL that will be pre-pended to any relative URL. If provided, it must have a trailing /.
setURL(java.lang.String)public SubmitAnchor setTarget(java.lang.String frameTarget)
frameTarget - the name of the target frame.
public SubmitAnchor setText(HTML text)
text - is the HTML text object to be displayed.
public SubmitAnchor setText(java.lang.String text)
text - is the text to be displayed.
public SubmitAnchor setURL(java.lang.String url)
url - the destination URL.
setBase(java.lang.String)public Input setValue(java.lang.String value)
Input.setValue(java.lang.String) to consistently set the display value
of that anchor, in the same way that setValue on SubmitButton sets the
display value of the button. If a hidden field
has been defined, it's value will also be set to the specified value when
this anchor is selected.
setValue in class Inputvalue - the value to assign.
protected HTML getText()
protected void init()
Tag.destroy() method to correctly
clear and initialise internal variables.
init in class Tag
protected void writeContent(Browser browser)
throws java.io.IOException
Submit.write(org.pajes.servlet.Browser) method to write the actual tag to the
browser.
writeContent in class Tagbrowser - the browser to which the results are to be output.
java.io.IOException - if an I/O error occurs writing to the browser.Tag.setWriteEndTag(boolean)
protected void writeSubmitJavaScript(Browser browser,
java.lang.StringBuilder onClickHandler)
Submit.write(org.pajes.servlet.Browser) method to append the appropriate
JavaScript to the OnClick handler written to the browser to handle the
form submission.
writeSubmitJavaScript in class Submitbrowser - the browser to which the results are to be output.onClickHandler - the onClickHandler to which the JavaScript code should be
appended.
|
PAJES 3.0.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||