Show TOC Start of Content Area

Object documentation Message Bar  Locate the document in its SAP Library structure

Definition

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 This graphic is explained in the accompanying text.

¡        INFO

Displays icon This graphic is explained in the accompanying text.

¡        LOADING

Displays the rotating icon This graphic is explained in the accompanying text.

¡        NONE

Displays no icon.

¡        STOP

Displays the ERROR icon.

¡        VALIDATION

Displays ERROR icon .

¡        WARNING

Displays icon This graphic is explained in the accompanying text.

 

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

  <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>

 

using the classlib

    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);

 

Result

This graphic is explained in the accompanying text

 

 

End of Content Area