actionErrors: Is this a common problem

kieranocallaghan
kieranocallaghan used Ask the Experts™
on
Hi all,
I just started using action errors with my application.
I added action errors to a form I for creating a new Course, I check if the course name and course code were already used (in the database).

Note: I am using this same actionForm for create course, edit course and delete course.

All good so far  
Next, I ran my application again and, I checked the update Course page and, since I am using the same form, the course name and course code are highlighted as errors even though I haven't changed them (actionErrors check the Database for course name and course code and finds that they already exist).
Is this a common problem and how can I avoid it?
Any help would be appreciated.
Cheers,
Kieran
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2011

Commented:
1)      The error is not from an ActionScript is server side error you need to pass appropriate message usually is error code or error type + description
2)      The all errors must be handle by your listener functions and popup an Alert box
3)      Is the error such as Null pointer exception you will not be notifying by Flash Player is you are installed consumer version. You must use debugger Flash Player and download from this url
http://www.adobe.com/support/flashplayer/downloads.html
4)      The user requests and responses or error description you may need to log for reviewing later. The easiest way use flashlog.txt  http://livedocs.adobe.com/flex/3/html/help.html?content=logging_04.html

Top Expert 2016

Commented:
think about your logic.

add a course will check the database and return an error if the course exists in the database while edit/delete a course must check that the course exists and error if the course does NOT exist.

Author

Commented:
Hi ve3ofa,
Thanks for your reply, yes that's the situation I am in!
I tried another approach:
In action errors check if user is creating a course, editing a course or deleting a course but this caused lots more complexity.
I though about creating a different form for create, edit and delete course but this doesn't make sense either.
I am wondering if there is a standard way to handle this situation.
Regards,
Kieran
Top Expert 2016
Commented:
you will need 2 forms - add  
delete/modify can use the same logic but the action will be different

Author

Commented:
I just tried that and it works great, thanks ve3ofa!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial