hi,

you can use @Persist("flash") ... after the second request
the fields will be removed from the session automatically

have you thought about using a ASO (application state object)?

g,
kris




Dapeng <[EMAIL PROTECTED]> 
13.12.2007 10:16
Bitte antworten an
"Tapestry users" <users@tapestry.apache.org>


An
Tapestry users <users@tapestry.apache.org>
Kopie

Thema
[T5] HOW-TO wirte a generic feedback message page ??







Hi guys

there are several actions that need to display user the operation's status

e.g.

if user edit his profile, then the page looks like (the raw HTML)

    <h1>Profile Updated</h1>
 
    <p>Your profile has been updated</p>

    <a href=''>Back to main page</a>
 

therefore i need a generic feedback message page.

here is what i am doing

Feedback.tml

<h1>${title}</h1>

<p>${message}</p>

<a:pagelink page="${returnPage}">Next</a:pagelink>




public class Feedback
{
    private String title;
    private String message;
    private returnPage;

    // -- getters setters omitted
}




-----------------
this is how i use it


public class ChangeProfile
{
    @InjectPage
    private Feedback feedback;


    Object onSuccess
    {
       feedback.setTitle("Profile Updated");
       feedback.setMessage("Your profile has been updated");
       feedback.setReturnPage("start");

       return feedback;
    }
}






my problem is when i doing things like above, the feedback page won't 
display anything unless i set @Persist to all the properties

i understand that this is due to the 2-phase request processing, as the 
actual retrieval of the page happens as a separate render request


so to over come the problem i have to set @Persist to all the 
properties, and do a manual cleanup upon the page finishes rendering






is there any better way of doing this ???











---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to