Java Doc for Button.java in  » J2EE » wicket » org » apache » wicket » markup » html » form » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » wicket » org.apache.wicket.markup.html.form 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.wicket.markup.html.form.LabeledWebMarkupContainer
   org.apache.wicket.markup.html.form.FormComponent
      org.apache.wicket.markup.html.form.Button

All known Subclasses:   org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton,  org.apache.wicket.ajax.markup.html.form.AjaxButton,  org.apache.wicket.markup.html.form.ImageButton,  org.apache.wicket.extensions.wizard.WizardButton,
Button
public class Button extends FormComponent implements IFormSubmittingComponent(Code)
A form button.

Within a form, you can nest Button components. Note that you don't have to do this to let the form work (a simple <input type="submit".. suffices), but if you want to have different kinds of submit behavior it might be a good idea to use Buttons.

The model property is used to set the "value" attribute. It will thus be the label of the button that shows up for end users. If you want the attribute to keep it's markup attribute value, don't provide a model, or let it return an empty string.

When you add a Wicket Button to a form, and that button is clicked, by default the button's onSubmit method is called first, and after that the form's onSubmit method is called. If you want to change this (e.g. you don't want to call the form's onSubmit method, or you want it called before the button's onSubmit method), you can override Form.delegateSubmit.

One other option you should know of is the 'defaultFormProcessing' property of Button components. When you set this to false (default is true), all validation and formupdating is bypassed and the onSubmit method of that button is called directly, and the onSubmit method of the parent form is not called. A common use for this is to create a cancel button.


author:
   Jonathan Locke
author:
   Eelco Hillenius



Constructor Summary
public  Button(String id)
     Constructor without a model.
public  Button(String id, IModel model)
     Constructor taking an model for rendering the 'label' of the button (the value attribute of the input/button tag).

Method Summary
final public  booleangetDefaultFormProcessing()
     Gets the defaultFormProcessing property.
protected  StringgetOnClickScript()
     Gets any script that should rendered as the "onclick" attribute of the button.
protected  IModelinitModel()
     Override of the default initModel behaviour.
protected  voidonComponentTag(ComponentTag tag)
     Processes the component tag.
public  voidonSubmit()
     Override this method to provide special submit handling in a multi-button form.
final public  ButtonsetDefaultFormProcessing(boolean defaultFormProcessing)
     Sets the defaultFormProcessing property.
public  voidupdateModel()
     This method does nothing, as any model of a button is only used to display the button's label (by setting it's markup attribute "value").


Constructor Detail
Button
public Button(String id)(Code)
Constructor without a model. Buttons without models leave the markup attribute "value". Provide a model if you want to set the button's label dynamically.
See Also:   org.apache.wicket.Component.Component(String)



Button
public Button(String id, IModel model)(Code)
Constructor taking an model for rendering the 'label' of the button (the value attribute of the input/button tag). Use a org.apache.wicket.model.StringResourceModel for a localized value.
Parameters:
  id - Component id
Parameters:
  model - The model property is used to set the "value"attribute. It will thus be the label of the button that showsup for end users. If you want the attribute to keep it'smarkup attribute value, don't provide a model, or let itreturn an empty string.




Method Detail
getDefaultFormProcessing
final public boolean getDefaultFormProcessing()(Code)
Gets the defaultFormProcessing property. When false (default is true), all validation and formupdating is bypassed and the onSubmit method of that button is called directly, and the onSubmit method of the parent form is not called. A common use for this is to create a cancel button. defaultFormProcessing



getOnClickScript
protected String getOnClickScript()(Code)
Gets any script that should rendered as the "onclick" attribute of the button. Returns null by default, override this method to provide any script. Any onClick JavaScript that should be used, returns null bydefault



initModel
protected IModel initModel()(Code)
Override of the default initModel behaviour. This component will not use any compound model a parent, but only a model that is explicitly set.
See Also:   org.apache.wicket.Component.initModel



onComponentTag
protected void onComponentTag(ComponentTag tag)(Code)
Processes the component tag. A value attribute is added with the value of the model object, if available. An onclick attribute is added if the subclass specified javascript.

NOTE. For a <button> the value attribute is not rendered, markup needs to be added within the button to display the button's label.


Parameters:
  tag - Tag to modify
See Also:   org.apache.wicket.Component.onComponentTag(ComponentTag)



onSubmit
public void onSubmit()(Code)
Override this method to provide special submit handling in a multi-button form. It is called whenever the user clicks this particular button.



setDefaultFormProcessing
final public Button setDefaultFormProcessing(boolean defaultFormProcessing)(Code)
Sets the defaultFormProcessing property. When false (default is true), all validation and form updating is bypassed and the onSubmit method of that button is called directly, and the onSubmit method of the parent form is not called. A common use for this is to create a cancel button.
Parameters:
  defaultFormProcessing - defaultFormProcessing This



updateModel
public void updateModel()(Code)
This method does nothing, as any model of a button is only used to display the button's label (by setting it's markup attribute "value").
See Also:   org.apache.wicket.markup.html.form.FormComponent.updateModel



Fields inherited from org.apache.wicket.markup.html.form.FormComponent
final protected static short FLAG_CONVERT_EMPTY_INPUT_STRING_TO_NULL(Code)(Java Doc)
public static String VALUE_SEPARATOR(Code)(Java Doc)

Methods inherited from org.apache.wicket.markup.html.form.FormComponent
final public FormComponent add(IValidator validator)(Code)(Java Doc)
public boolean checkRequired()(Code)(Java Doc)
final public void clearInput()(Code)(Java Doc)
protected void convertInput()(Code)(Java Doc)
protected Object convertValue(String[] value) throws ConversionException(Code)(Java Doc)
public void error(IValidationError error)(Code)(Java Doc)
protected List getBehaviors(Class type)(Code)(Java Doc)
final public Object getConvertedInput()(Code)(Java Doc)
public Form getForm()(Code)(Java Doc)
public String getInput()(Code)(Java Doc)
public String[] getInputAsArray()(Code)(Java Doc)
public String getInputName()(Code)(Java Doc)
protected String getModelValue()(Code)(Java Doc)
final public String getRawInput()(Code)(Java Doc)
final public Class getType()(Code)(Java Doc)
public String getValidatorKeyPrefix()(Code)(Java Doc)
final public List getValidators()(Code)(Java Doc)
final public String getValue()(Code)(Java Doc)
final public boolean hasRawInput()(Code)(Java Doc)
final protected int inputAsInt()(Code)(Java Doc)
final protected int inputAsInt(int defaultValue)(Code)(Java Doc)
final protected int[] inputAsIntArray()(Code)(Java Doc)
final public void inputChanged()(Code)(Java Doc)
protected void internalOnModelChanged()(Code)(Java Doc)
final public void invalid()(Code)(Java Doc)
public boolean isInputNullable()(Code)(Java Doc)
public boolean isMultiPart()(Code)(Java Doc)
final public boolean isPersistent()(Code)(Java Doc)
public boolean isRequired()(Code)(Java Doc)
final public boolean isValid()(Code)(Java Doc)
protected void onComponentTag(ComponentTag tag)(Code)(Java Doc)
protected void onDetach()(Code)(Java Doc)
protected void onDisabled(ComponentTag tag)(Code)(Java Doc)
protected void onInvalid()(Code)(Java Doc)
protected void onValid()(Code)(Java Doc)
public boolean processChildren()(Code)(Java Doc)
final public void processInput()(Code)(Java Doc)
final public void setConvertedInput(Object convertedInput)(Code)(Java Doc)
public FormComponent setLabel(IModel labelModel)(Code)(Java Doc)
public void setModelValue(String value)(Code)(Java Doc)
public void setModelValue(String[] value)(Code)(Java Doc)
final public FormComponent setPersistent(boolean persistent)(Code)(Java Doc)
final public FormComponent setRequired(boolean required)(Code)(Java Doc)
final public FormComponent setType(Class type)(Code)(Java Doc)
protected boolean supportsPersistence()(Code)(Java Doc)
public void updateModel()(Code)(Java Doc)
final public void valid()(Code)(Java Doc)
final public void validate()(Code)(Java Doc)
final protected void validateRequired()(Code)(Java Doc)
final protected void validateValidators()(Code)(Java Doc)
final public static void visitFormComponentsPostOrder(Component component, FormComponent.IVisitor visitor)(Code)(Java Doc)

Methods inherited from org.apache.wicket.markup.html.form.LabeledWebMarkupContainer
public IModel getLabel()(Code)(Java Doc)
protected void setLabelInternal(IModel labelModel)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.