net.sf.click.extras.control
Class PageButton

java.lang.Object
  extended bynet.sf.click.control.AbstractControl
      extended bynet.sf.click.control.AbstractLink
          extended bynet.sf.click.control.PageLink
              extended bynet.sf.click.extras.control.PageButton
All Implemented Interfaces:
Control, Serializable

public class PageButton
extends PageLink

Provides a Page link Button control:   <input type='button'>.

The PageButton is provides link style navigation button to a Page that is rendered in form of a button (an input HTML element with the type="button" more precisely) plus javascript getting the borwser to the location of that Page.

PageButton Advantages

Note: this control is related to PageLink and not to PageSubmit.

Author:
Ahmed Mohombe
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.click.control.PageLink
pageClass
 
Fields inherited from class net.sf.click.control.AbstractLink
disabled, imageSrc, label, parameters, tabindex, title
 
Fields inherited from class net.sf.click.control.AbstractControl
actionListener, attributes, listener, listenerMethod, messages, name, parent, styles
 
Fields inherited from interface net.sf.click.Control
CONTROL_MESSAGES
 
Constructor Summary
PageButton()
          Create a PageButton with no name defined.
PageButton(Class targetPage)
          Create a PageButton for the given target Page class.
PageButton(String name)
          Create a PageButton for the given name.
PageButton(String name, Class targetPage)
          Create a PageButton for the given name and target Page class.
PageButton(String name, String label, Class targetPage)
          Create a PageButton for the given name, label and target Page class.
 
Method Summary
 String getOnClick()
          Return the Button's onClick() String, representing a javascript location of the Page to get.
 String getTag()
          Return the links html tag: input.
 void render(HtmlStringBuffer buffer)
          Render the HTML representation of the button.
 String toString()
          Return a HTML rendered Button string.
 
Methods inherited from class net.sf.click.control.PageLink
getHref, getPageClass, onProcess, setListener, setPageClass
 
Methods inherited from class net.sf.click.control.AbstractLink
getHtmlImports, getId, getImageSrc, getLabel, getParameter, getParameters, getTabIndex, getTitle, hasParameters, isDisabled, setDisabled, setImageSrc, setLabel, setParameter, setTabIndex, setTitle
 
Methods inherited from class net.sf.click.control.AbstractControl
addStyleClass, appendAttributes, getActionListener, getAttribute, getAttributes, getContext, getControlSizeEst, getMessage, getMessage, getMessage, getMessages, getName, getPage, getParent, getStyle, getStyles, hasAttribute, hasAttributes, hasStyles, onDeploy, onDestroy, onInit, onRender, registerActionEvent, removeStyleClass, renderTagBegin, renderTagEnd, setActionListener, setAttribute, setId, setName, setParent, setStyle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PageButton

public PageButton(String name)
Create a PageButton for the given name.

Parameters:
name - the page button name
Throws:
IllegalArgumentException - if the name is null

PageButton

public PageButton(String name,
                  Class targetPage)
Create a PageButton for the given name and target Page class.

Parameters:
name - the page button name
targetPage - the target page class
Throws:
IllegalArgumentException - if the name is null

PageButton

public PageButton(String name,
                  String label,
                  Class targetPage)
Create a PageButton for the given name, label and target Page class.

Parameters:
name - the page button name
label - the page button label
targetPage - the target page class
Throws:
IllegalArgumentException - if the name is null

PageButton

public PageButton(Class targetPage)
Create a PageButton for the given target Page class.

Parameters:
targetPage - the target page class
Throws:
IllegalArgumentException - if the name is null

PageButton

public PageButton()
Create a PageButton with no name defined.

Please note the control's name and target pageClass must be defined before it is valid.

Method Detail

getTag

public String getTag()
Return the links html tag: input.

Returns:
this controls html tag
See Also:
AbstractControl.getTag()

render

public void render(HtmlStringBuffer buffer)
Render the HTML representation of the button. Note the button label is rendered as the HTML "value" attribute.

Parameters:
buffer - the specified buffer to render the control's output to

toString

public String toString()
Return a HTML rendered Button string. Note the button label is rendered as the HTML "value" attribute.

Returns:
a HTML rendered Button string
See Also:
Object.toString()

getOnClick

public String getOnClick()
Return the Button's onClick() String, representing a javascript location of the Page to get.

Returns:
the Button's onClick() String, representing a javascript location of the Page to get.