Show TOC

Object documentationMessage Bar Locate this document in the navigation structure

 

The message bar allows to display application messages at the beginning (top) or at the end (bottom) of the form. The message can display an icon at the beginning of the messages that indicates the nature of the message (info, error and so on). The message bar has to be added to the form component. The form component has the methods to define if the message bar is displayed at the beginning or at the end of the form.

  • id

    Identification name of the message bar.

  • message

    Defines the messageType and the messageText for the message bar.

  • messageText

    Defines the messageText for the message bar. A messageType has to be defined, using method 'message' or 'messageType'. If no messageType is defined, the messageText is not displayed.

  • messageType

    Nature of the message.

    • ERROR

      Displays icon Error (Error).

    • INFO

      Displays icon Info (Info).

    • LOADING

      Displays the rotating icon Loading (Loading).

    • NONE

      Displays no icon.

    • STOP

      Displays the ERROR icon.

    • VALIDATION

      Displays the ERROR icon .

    • WARNING

      Displays icon Warning (Warning).

Attributes

M

Values

Usage

id

*

String (cs)

Taglib

id="mBar"

Classlib

Defined with the messageBar object.

message

String

Taglib

No tag available

Classlib

setMessage(MessageType.type, String mess)

messageText

String

Taglib

messageText="Invalid date"

Classlib

setMessageText("Invalid date")

messageType

ERROR

INFO

LOADING

NONE

STOP

VALIDATION

WARNING

Taglib

setMessage(MessageType.type, String mess)

Classlib

setMessage(MessageType.type, String mess)

Example

Using the taglib

Syntax Syntax

  1.   <hbj:form 
        id="myFormId"
        method="post"
        target="_blank"
        encodingType="multipart/form-data"
        action="/htmlb/servlet/com.sap.htmlb.test.MyTestJsp1Test"
        >
        <hbj:messageBar 
            id="mBar"
            messageType="ERROR"
            messageText="Fatal Error">
            <% 
                myFormId.setMessageBar(mBar); 
                %>
        </hbj:messageBar>
      </hbj:form>
    
End of the code.

Using the classlib

Syntax Syntax

  1.     Form form = (Form) this.getForm();
        MessageBar mb = new MessageBar("messageBar");
    
        mb.setMessage(MessageType.ERROR, "Fatal Error");
        form.setMessageBar(mb);
    
        form.setMessageBarAtFormEnd(true);
    
        form.setMessageBarRequired(true);
    
End of the code.
Result

This graphic is explained in the accompanying text.