Component : Message Box

The JSAction messagebox is a component for display of information and error. This solution is a much more elegant form to inform a user as with an JavaScript alert.

Types

Beside the JSAction standard messages also own messages can be displayed in the box. The following three types are available:

info
General informationen
warn
Warnings
error
Error messages

HTML Code

You define the message box simply with the following line in the HTML code. JSAction recognizes the box automatically by the id and creates an collapsable and scollable message box.

<div id="messages" class="hide"></div>

CSS

The layout of the message box will be done global with CSS selectors. Standard the info messages are green, warnings are orange and errors are red displayed.

For the correct presentation the followeing must be defined:

  1. All definitions of the item messages of the global CSS file [2]
  2. The following two CSS definitions
*{margin:0; padding:0} .hide{display:none}

Example

The message box adjust its layout automatically depending to the amount of messages. If there are many messages a fold out function and if neccessary a scrollbar will be displayed.

Info
Single information message
Warn
Some warnings
Error
Many error messages

Johannes Hammoud Component : Message Box 05.12.2009

I Coding : Community about Java programing

Language German+-

Java JSF JavaScript HTML CSS NetBeans GlassFish MySQL

Imprint

Visits
5744493
Today
62