mr-pupu / nc-spring-practice-12-group4

Automatically exported from code.google.com/p/nc-spring-practice-12-group4
0 stars 0 forks source link

Messages #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Log in using some employee( especially admin and travel support manager)
2. Try to make some important change (add new destination, delete employee or 
department, ...) or action which is not allowed

What is the expected output? What do you see instead?
Message should appear (it is not)

Please use labels and text to provide additional information.

Original issue reported on code.google.com by goldsm...@gmail.com on 10 May 2012 at 7:32

GoogleCodeExporter commented 9 years ago
Here is an algorithm for handling this:
1. Add "error" and "success" fields into json's formed by servlets. "Error" is 
the class of the message (could be "success", "info" or "error"); "success" is 
the message you want to display.
2. Add the following to your page: <div class="container" id="notifier">
        </div>
3. Include script file message-maker.js
4. When handling the json with Javascript (for instance, during the $.getJSON 
method) call addMessage(data), where data is the json you are processing.

What's left is to implement it on all pages.

Original comment by Jiallomb...@gmail.com on 12 May 2012 at 1:31

GoogleCodeExporter commented 9 years ago
Another note - warning messages for incorrectly filled fields. These include:
1. Fields with empty values
2. Null choices in dropdown
3. Incorrectly formed e-mails
4. Logins that already exist

This could be accomplished by adding a, for example, "fields" parameter to the 
json, which will be a pairs array of such structure: "fieldname" : 
"errormessage". The corresponding field names are highlighted as erratic (see 
commented code on index page - you just need to change add a class to the input 
field), and a message is written underneath them (just like in the example). A 
message should also appear at the top of the screen.

Original comment by Jiallomb...@gmail.com on 13 May 2012 at 7:16

GoogleCodeExporter commented 9 years ago
partly finished. Every ajax process servlet (when processing changes made by 
user) in now sending message back (successful or error)

Original comment by goldsm...@gmail.com on 15 May 2012 at 10:11