Hello again,

I want to provide forms for creating new items and for editing these items
later on. I was wondering wether it's better to create two seperate forms
and two actions for this purpose or to create just one form and one action
to handle this. Right now I'm trying to do this:

I have one action called EditItemAction which implements CommandDriven. This
is in my views.properties:

addItem.action=EditItem!add
addItem.input=editItemForm.jsp
addItem.success=editItemForm.jsp

saveItem.action=EditItem!save
saveItem.input=editItemForm.jsp
saveItem.success=listItems.action

editItem.action=EditItem!edit
editItem.input=editItemForm.jsp
editItem.success=listItems.action

updateItem.action=EditItem!update
updateItem.input=editItemForm.jsp
updateItem.success=listItems.action

Now when I want to display the form to create a new item to the user, I call
addItem.action, and EditItem.doAdd() forwards to the form. On submit, the
form forwards to saveItem.action.

The first problem I ran into that doValidation() doesn't seem to be called
using this method, so I'm calling it in EditItem.doSave(). However, the
server replies with this error:

No view for result [input] exists for action [saveItem]

Obviously, the input view is provided in views.properties, and if I change
the last line in EditItem.doSave() from "return SUCCESS;" to "return
INPUT;", it works. Is this a bug? Or is my approach so stupid that I
shouldn't be doing it this way?

Thanks in advance.
Kristian



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to