Java Doc for WPageEvents.java in  » Database-ORM » SimpleORM » simpleorm » simplewebapp » core » 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 » Database ORM » SimpleORM » simpleorm.simplewebapp.core 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   simpleorm.simplewebapp.core.WPageEvents

All known Subclasses:   simpleorm.simplewebapp.core.WPagelet,
WPageEvents
abstract class WPageEvents (Code)
Parent to WPagelet, mainly containing Event stubs. Overrides should always call super.

The events are generally grouped by pagelet, so that all of a pagelets processing happens at once.

But each pagelet's OnInitalize method is called first. Then each pagelets feilds are loaded but not validated. This is done before the non-interleaved events so that pagelets could interact with each other if really needed.

Then the for each pagelets their onPreValidate/Field Valdiation, *Submitted and Error events are called. These are not interleaved with other pagelets.

These non-interleaved methods can throw WValidationErrors will be caught and displayed to the user. This will prevent any further proccessing non-interleaved methods of this pagelet, but the page will continue. So a Crud error will not prevent a tree or list pagelet from working.

Then the onListRow methods are called as seen in the JSP. Finally each pagelet's onFinalize is called, after the JSP exits.

Normally a database connection is shared between pagelets, with error events doing rollbacks. Open the connection on the Page initializer, not the pagelet one. This approach keeps things simple.

(Why is this more complex than Rails (say)? Mainly because we support the implementation of independently written pagelets.)

(See WPageStructure.main() for precice details as to how these are called.)

(Having the *Submitted events is a little more compex than just having one doBody event and testing if wasSubmitted within it. But it is convenient to have these split up for the user. Individual buttons are not split up because typically one wants shared processing between Insert, Update, Delete user actions.)

(To extend a Page/Pagelet one simply subtypes them, and thus having access to the super types events. However, might allow other non-pagelet classes to extend this directly later, and then regester themselves to receive the events. But not now.)





Method Summary
protected  voidonFinalize()
     Override this to close database connections etc.
 voidonFinalizeInternal()
     Provided to destroy data structures in case onFinalize does not call Super.
protected  voidonInitialize()
     Override this to initalize the system, as an alternative to constructors. Called for each pagelet up front, before field values are retrieved, so can be used to generate fields.
protected  booleanonListRow()
     For list pagelets, this is called once for each iteration of the JSP's foreachrow loop.
protected  voidonMaybeErroneous()
     Called just after onPostMaybeSubmitted, but called even if an earlier method produces a WValidation error. Use isErroneous to determine whether the pageLET had thrown an validation exception.

Use this to rollback Crud pages if necessary.

protected  voidonNotSubmitted()
     Called when the form is called initially from a menu, ie not submitted via a submit button.
protected  voidonPostMaybeSubmitted()
     Override this to process the form data just after either onNotSubmitted or onWasSubmitted. Ie.
protected  voidonPreMaybeSubmitted()
     Override this to process the form data just before either onNotSubmitted or onWasSubmitted, but after all the field validators have succeeded. Ie.
protected  voidonPreValidate()
     Called after field.text values have been retrieved but before validators have been run.
protected  voidonWasSubmitted()
     Called when the form is submitted via a submit button, normally back to itself. Ie.



Method Detail
onFinalize
protected void onFinalize() throws Exception(Code)
Override this to close database connections etc. Guaranteed to always be called, even if there are errors, normally by </WPage>.




onFinalizeInternal
void onFinalizeInternal() throws Exception(Code)
Provided to destroy data structures in case onFinalize does not call Super.



onInitialize
protected void onInitialize() throws Exception(Code)
Override this to initalize the system, as an alternative to constructors. Called for each pagelet up front, before field values are retrieved, so can be used to generate fields.

wPageContext has been set before this is called. WValidationErrors are NOT caught here and will kill the page.

Not a good place to open db connections, particularly thread local ones, as other paglets' onInitialize will be called before the body of this pagelet is executed. onPreValidate or onPreMaybeSubmitted are better places to open connections if that needs to be done on a per pagelet level.




onListRow
protected boolean onListRow() throws Exception(Code)
For list pagelets, this is called once for each iteration of the JSP's foreachrow loop. Return false when there is no more data to display.

Normally the implementation moves data into the WField objects in the list group. The JSP then just accesses the field values directly, as ${WPage.fields.myfield}.

This is a low level interface that can be used to set any field attributes, once per field. Eg. AnchorHRefs, but also anything else eg. highlight some rows. A high level DataSet oriented structure might be added later.

Calls to this are suppressed if WPagelet.isErroneous() because queries that drive it are unlikely to be set up.

Obviously not interleaved with other pagelets, see class docs.
See Also:   WFieldGroupList
See Also:    which maps the foreach collection to this method.




onMaybeErroneous
protected void onMaybeErroneous() throws Exception(Code)
Called just after onPostMaybeSubmitted, but called even if an earlier method produces a WValidation error. Use isErroneous to determine whether the pageLET had thrown an validation exception.

Use this to rollback Crud pages if necessary. We don't do this by default because there may be Tree or List pagelets following, which need to run. (Non-WValidationExceptions always just abort the entire page -- they are a programming error.)

Can also throw WValidationErrors will be caught and displayed to the user. Not interleaved with other pagelets, see class docs.




onNotSubmitted
protected void onNotSubmitted() throws Exception(Code)
Called when the form is called initially from a menu, ie not submitted via a submit button. All fields are set and validated. Can throw WValidationErrors will be caught and displayed to the user. Not interleaved with other pagelets, see class docs.



onPostMaybeSubmitted
protected void onPostMaybeSubmitted() throws Exception(Code)
Override this to process the form data just after either onNotSubmitted or onWasSubmitted. Ie. Called regardless of whether the form was called from a menu or posted back. Can throw WValidationErrors will be caught and displayed to the user. Not interleaved with other pagelets, see class docs.



onPreMaybeSubmitted
protected void onPreMaybeSubmitted() throws Exception(Code)
Override this to process the form data just before either onNotSubmitted or onWasSubmitted, but after all the field validators have succeeded. Ie. Called regardless of whether the form was called from a menu or posted back. Can be used to open datbase connections etc. Can throw WValidationErrors will be caught and displayed to the user. Not interleaved with other pagelets, see class docs.



onPreValidate
protected void onPreValidate() throws Exception(Code)
Called after field.text values have been retrieved but before validators have been run. Thus data values will not be set up yet. Any thrown WValidationErrors will be caught and displayed to the user, and will prevent further validation or processing of the PageLET. Often used to define buttons. Not interleaved with other pagelets, see class docs.



onWasSubmitted
protected void onWasSubmitted() throws Exception(Code)
Called when the form is submitted via a submit button, normally back to itself. Ie. not from a menu. All fields are set and validated. Can throw WValidationErrors will be caught and displayed to the user. Not interleaved with other pagelets, see class docs.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.