Hi John,
Thanks for your reply of my previous post.
My requirement is to show the "create entry successfully" message in the index page (or page_list page) after user submits the add . So look at following code in the ajaxtodo example,
public String create() {
ActiveRecord newEntry = null;
try {
newEntry = Entry.newRecord();
newEntry.setData(params());
newEntry.save();
flash("notice", "Entry was successfully created.");
}
catch(Exception ex) {
log.error("Error in create() caused by " + ex.getMessage());
flash("error", "There was a problem creating the entry record.");
}
setViewData("entry", newEntry);
setViewData("entries", Entry.findAll());
return renderView("index");
}
In my test, there is no message showed up. But if I change the return to "return redirectTo("/entries");" , I can get it. (But there will be a refresh on the page, non ajax any more)
Any comments?