Changes for page Your First Stateful Project
Last modified by Bastian Triller on 2021/08/07 03:59
From 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
To 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
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,3 +1,7 @@ 1 +{{info}} 2 +Work in progress 3 +{{/info}} 4 + 1 1 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. 2 2 3 3 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. ... ... @@ -134,17 +134,8 @@ 134 134 135 135 {{/code}} 136 136 137 -Save the file. N ow openAuthor.javaand addthe followingmethod:141 +Save the file. 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**. 138 138 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 - 148 148 After the component have been created, open **AdminMainPage.java** and override the content of the class with the following code: 149 149 150 150 {{code}} ... ... @@ -244,16 +244,16 @@ 244 244 245 245 {{code}} 246 246 247 -<wo:AjaxUpdateContainer id="main"> 242 + <wo:AjaxUpdateContainer id="main"> 248 248 <wo:if condition="$isLogged"> 249 249 <wo:if condition="$displayGroup.hasMultipleBatches"> 250 250 <div> 251 251 <wo:link action="$displayGroup.displayPreviousBatch">Previous</wo:link> 252 - | Batch 247 + | Batch 253 253 <wo:str value="$displayGroup.currentBatchIndex" /> 254 - of 249 + of 255 255 <wo:str value="$displayGroup.batchCount" /> 256 - | 251 + | 257 257 <wo:link action="$displayGroup.displayNextBatch">Next</wo:link> 258 258 </div> 259 259 </wo:if> ... ... @@ -370,7 +370,7 @@ 370 370 371 371 {{code}} 372 372 373 -<wo:form> 368 + <wo:form> 374 374 <div> 375 375 <label>Title:</label> 376 376 <wo:textfield value="$blogEntry.title" /> ... ... @@ -389,16 +389,16 @@ 389 389 390 390 {{code}} 391 391 392 -public WOActionResults editBlogEntry() { 387 + public WOActionResults editBlogEntry() { 393 393 EditBlogEntry nextPage = pageWithName(EditBlogEntry.class); 394 394 nextPage.setBlogEntry(_blogEntryItem); 395 395 return nextPage; 396 396 } 397 - 392 + 398 398 public WOActionResults createBlogEntry() { 399 399 EditBlogEntry nextPage = pageWithName(EditBlogEntry.class); 400 400 nextPage.setBlogEntry(null); 401 - return nextPage; 396 + return nextPage; 402 402 } 403 403 404 404 {{/code}} ... ... @@ -427,4 +427,4 @@ 427 427 428 428 {{/code}} 429 429 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]].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!