Use flash persistence.
A simple sample, user CRUD.

EditUser.java

public class EditUser {
    @InjectPage
    private UserList list;

    onSuccess() {
    list.setMessage("Your record was created succesfully!");
    }
}

public class UserList {
    @Persist("flash")
    private String message;
    public void setMessage(String message) {
        this.message = message;
    }
    public String getMessage() {
        return this.message;
    }
}

Next time when accessing user list, the message would be gone.

Thanks,

DH


----- Original Message ----- 
From: "inrila" <[EMAIL PROTECTED]>
To: <users@tapestry.apache.org>
Sent: Friday, November 28, 2008 12:36 PM
Subject: How to share "flash" message across pages better?


> 
> Hi,
> 
> As I figured out @Persist will basically store the value in the
> session/flash for _this_ specific page. 
> 
> Let's say I created simple CRUD, where on the "List" page I am showing all
> records.
> When adding new record after onSuccess() I want to put some flash message
> i.e. "Your record was created succesfully!" and return List.class so user
> will get to "List" page automatically. 
> 
> And user should see this flash message. But how can I do do that? Is there
> some existing mechanism to use for that? As I mentioned above, @Persist will
> not work, as we are working with different pages. And @ApplicationState is
> an overkill, because I basically need only flash message.
> Any other options? 
> 
> Thanks!
> -- 
> View this message in context: 
> http://www.nabble.com/How-to-share-%22flash%22-message-across-pages-better--tp20728892p20728892.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

Reply via email to