[jboss-user] [JBoss Seam] - Update example: how to do ?
miloslav.vlach
do-not-reply at jboss.com
Wed Jun 13 04:36:07 EDT 2007
How to create edit action ? I am using the page parameter and call method load (in edit.page.xml file). But when push Update button the viewArtcile doesn't contain all of the loaded attributes. The Account is not set for example....
How to create update action ?
Thanks Mila
| @Name("articleEditAction")
| public class ArticleEditAction {
|
| @In
| Session ses;
|
| @In
| ViewArticle viewArticle;
|
| @Logger
| Log log;
|
| @In(create = true)
| Configuration configuration;
|
| @End
| public String save() {
| log.info("saving the article: #0", viewArticle);
|
| // article doesn't contains all attributes loaded in method load()
| ses.update(viewArticle);
|
|
| return "success";
| }
|
| @Begin
| public String load(Long id) {
| viewArticle = (ViewArticle) ses.load(ViewArticle.class, id);
| log.info("loaded article for edit: #0", viewArticle);
| return null;
| }
|
| @Remove
| @Destroy
| public void remove() {
| log.info("deleting object articleEditAction");
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4053846#4053846
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4053846
More information about the jboss-user
mailing list