Changes for page Your First Stateful Project
Last modified by Bastian Triller on 2021/08/07 03:59
From version 12.1
edited by Pascal Robert
on 2012/08/09 04:59
on 2012/08/09 04:59
Change comment:
There is no comment for this version
To version 14.1
edited by Pascal Robert
on 2012/12/12 07:57
on 2012/12/12 07:57
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,7 +5,3 @@ 1 -{{info}} 2 -Work in progress 3 -{{/info}} 4 - 5 5 So far, we have seen two of the technologies, D2W and ERRest, that Project Wonder offers for viewing and managing the data. In this tutorial, we will show how to do it with the "stateful" way of doing things. Stateful have been around since the beginning of WebObjects in 1996, so it's the oldest way of presenting data and constructing pages. 6 6 7 7 Stateful means that you don't have to worry about creating sessions and keeping track of data coming from HTML input fields and controls. In fact, D2W is also stateful. ... ... @@ -138,8 +138,17 @@ 138 138 139 139 {{/code}} 140 140 141 -Save the file. N ext:weneed toadd a componentto present the login form to theuser. Right-click on the **Components** folderin the project,andselect **New** > **WOComponent**. Changethename ofthe component to be **AdminMainPage**and changee superclass to**er.extensions.components.ERXComponent**.137 +Save the file. Now open Author.java and add the following method: 142 142 139 +{{code}} 140 +public static Author validateLogin(EOEditingContext editingContext, String _emailAddress) { 141 + // TODO Auto-generated method stub 142 + return null; 143 +} 144 +{{/code}} 145 + 146 +Next: we need to add a component to present the login form to the user. Right-click on the **Components** folder in the project, and select **New** > **WOComponent**. Change the name of the component to be **AdminMainPage** and change the superclass to **er.extensions.components.ERXComponent**. 147 + 143 143 After the component have been created, open **AdminMainPage.java** and override the content of the class with the following code: 144 144 145 145 {{code}} ... ... @@ -239,16 +239,16 @@ 239 239 240 240 {{code}} 241 241 242 - 247 +<wo:AjaxUpdateContainer id="main"> 243 243 <wo:if condition="$isLogged"> 244 244 <wo:if condition="$displayGroup.hasMultipleBatches"> 245 245 <div> 246 246 <wo:link action="$displayGroup.displayPreviousBatch">Previous</wo:link> 247 - | Batch 252 + | Batch 248 248 <wo:str value="$displayGroup.currentBatchIndex" /> 249 - of 254 + of 250 250 <wo:str value="$displayGroup.batchCount" /> 251 - | 256 + | 252 252 <wo:link action="$displayGroup.displayNextBatch">Next</wo:link> 253 253 </div> 254 254 </wo:if> ... ... @@ -365,7 +365,7 @@ 365 365 366 366 {{code}} 367 367 368 - 373 +<wo:form> 369 369 <div> 370 370 <label>Title:</label> 371 371 <wo:textfield value="$blogEntry.title" /> ... ... @@ -384,16 +384,16 @@ 384 384 385 385 {{code}} 386 386 387 - 392 +public WOActionResults editBlogEntry() { 388 388 EditBlogEntry nextPage = pageWithName(EditBlogEntry.class); 389 389 nextPage.setBlogEntry(_blogEntryItem); 390 390 return nextPage; 391 391 } 392 - 397 + 393 393 public WOActionResults createBlogEntry() { 394 394 EditBlogEntry nextPage = pageWithName(EditBlogEntry.class); 395 395 nextPage.setBlogEntry(null); 396 - return nextPage; 401 + return nextPage; 397 397 } 398 398 399 399 {{/code}} ... ... @@ -422,4 +422,4 @@ 422 422 423 423 {{/code}} 424 424 425 -Save everything, run the app, click on the "admin" link, login and check if you can create or edit a blog entry. Everything should be working, and just created your first stateful Project Wonder application !430 +Save everything, run the app, click on the "admin" link, login and check if you can create or edit a blog entry. Everything should be working, and just created your first stateful Project Wonder application [[It's time to deploy an application>>Your First Deployment]].