2007-06-19

SimpleTapestry 5 CRUD application -Step 07, Cancel button, variant 1.

Added "Cancel" button on AddNew page:

1.Turned off client validation:
AddNew.html, <form t:id="regform" t:clientValidation="false">
2.
AddNew.html, added <input t:type="submit" value="Cancel" t:id="Cancel"/>
3. AddNew.java, added
private String _pageToReturn;
------------------------------------
String onSuccess() {
if (_pageToReturn!=null){return _pageToReturn;}...
------------------------------------
void onSelectedFromCancel(){
_regform.clearErrors();
_pageToReturn = "Start";
}

Of course, there should be a better way... Let me search or drop a ray of light, if you have one :).

8. Step 08, Simple authentication

7. SimpleTapestry 5 CRUD application -Step 07, Cancel button, variant 1.
6. SimpleTapestry 5 CRUD application -Step 06, tweaking a grid a bit.
5. Simple Tapestry 5 CRUD application - BeanEditForm and Grid screencasts aprobation.
4. SimpleTapestry 5 CRUD application -Step 04 Adding some basic Hibernate features into the project.
3. SimpleTapestry 5 CRUD application -Step 03, "user" bean creation.
2. SimpleTapestry 5 CRUD application -Step 02, adding a service.
1. SimpleTapestry 5 CRUD application -Step 01.

2007-06-11

SimpleTapestry 5 CRUD application -Step 06, tweaking a grid a bit.

Added several modifications into the files:

1. Home page grid doesn't show the PWD column any more (but BeanEditForm example page (UpdateExisting) does), it's made by using/correcting the "model" attribute of "Grid" in Home.java:

//Inspired by http://tapestry.apache.org/tapestry5/tapestry-core/guide/beaneditform.html
void pageLoaded()
{
_model = _beanModelSource.create(TUser.class, true, _resources);
_model.remove("password");
}
and Home.html

<table t:type="grid" rowsPerPage="5" row="tUser" source="usersList" model="model">

2.
I renamed Registration page to UpdateExisting, it's now used for displaying and editing data of existing users - from Home page click a user name in the grid to get his/her details available for editing. onActivate()+ onPassivate() approach is used:

UpdateExisting.java


Home.html changes:
<table t:type="grid" rowsPerPage="5" row="tUser" source="usersList" model="model">
<t:parameter name="usernameCell">
<a t:type="PageLink" t:page="UpdateExisting" context="tUser.userName">${tUser.userName}</a>
</t:parameter>
</table>

3. UpdateExisting.html was changed to show "password" field values as PasswordFied type (i.e. hidden by *****):

<form t:type="BeanEditForm" object="tUser" submitLabel="Update">
<t:parameter name="password">
<t:label for="password"/>
<t:passwordfield t:id="password" value="tUser.password"/>
</t:parameter>
</form>

4. Added UTF-8 support, thanks to HowTo. A probable issue here is AppModule.java, IDE complains on new UTF_8 code. It was resolved by adding \jetty-5.1.7\lib\javax.servlet.jar into the classpath.



7. SimpleTapestry 5 CRUD application -Step 07, Cancel button, variant 1.
6. SimpleTapestry 5 CRUD application -Step 06, tweaking a grid a bit.
5. Simple Tapestry 5 CRUD application - BeanEditForm and Grid screencasts aprobation.
4. SimpleTapestry 5 CRUD application -Step 04 Adding some basic Hibernate features into the project.
3. SimpleTapestry 5 CRUD application -Step 03, "user" bean creation.
2. SimpleTapestry 5 CRUD application -Step 02, adding a service.
1. SimpleTapestry 5 CRUD application -Step 01.