• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Message handling (error, validation, information, success etc)

[eluser]MgM Web[/eluser]
Im currently devloping a booking website which have a lot of CRUD (create,read,update,delete) going on. I have 5 "modules" to manage (news,units,rooms,reservations etc.). In each module it is possible to create new items, read all items (in table view), update each item and delete each item.

I would like the entire solution to use only one view to display error messages, another for validation messages, another for information messages and one for success messages since they are mostly the same. It would also be easier to maintain the presentation of all messages.

Every module has its index page, here is all the items presented in a table view. From here you can delete a row, update a row and create a new row.

If you delete a row, you get an confirmation message inline on the index page above the table. The table is then updated using jQuery.load. In this way the page will not "flash". This is working as it should, and im using the same view for every delete message.

The problem occurs when I try to create an item. When you decide to create an item you are being redirected to the create form, you fill in all the information and press "Enter". As my solution is now, a confirmation message is beeing shown above the form when everything is ok.
But I want to transfer the user to the index page and show the confirmation message above the items table instead of above the registration form.

But since these two are on different pages I do not know how to manage this. I could transfer the user to the index page and add some information in the url that says "success" or something and then the index page would display the message. But I think this is a bad solution.

Is there any other possibilities, or have any of you solved this?
I would like to know the "best practice" ragarding presenting messages, so if there are any good guides or such I would like to know!

Phew... long post, sorry!

why you would not snet post vie ajax to save method, and in case of success it would return js code for sucess method, and if it would fail js code for error message. and then eval response?

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.