Try OpenEdge Now
skip to main content
Developing WebSpeed Applications
SpeedScript : WebSpeed API functions : Message handling : Generating messages with a custom tag
Generating messages with a custom tag
For HTML-mapping Web objects, WebSpeed provides a custom tag (<!--WSMSG -->) in tagmap.dat to output messages at strategic points in a mapped HTML file. Generally, you invoke the queue-message function to append a message to the message queue. If you want a certain group of messages to be output to the Web, you can insert the <!--WSMSG --> tag for that group of messages at any point in the HTML file.
This custom tag takes two optional attributes:
*NAME — The name of the message group or "all" for all messages in the queue
*VALUE — The heading to appear prior to the messages output for the specified group
Using the custom tag with no attributes defaults to TYPE="application messages" and NAME="all".
The following HTML example contains two <!--WSMSG --> tags, one for messages in a CustNum group and one for messages in a CustName group. When the HTML-mapping Web object invokes the output-fields event procedure, the messages for each respective group are output in the Web page at the specified point, as shown in this code:
<FORM ACTION="custnum.w" METHOD="post">
<!--WSMSG NAME="CustNum" VALUE="Customer Number Errors" --> <HR>
Enter Customer Number:
<INPUT TYPE="text" NAME="Customer_Number"> <BR>
<!--WSMSG NAME="CustName" VALUE="Customer Name Errors" -->
Customer Name:
<INPUT TYPE="text" NAME="Customer_Name"> <BR>
Customer Phone:
<INPUT TYPE="text" NAME="Customer_Phone">
The tagmap utility procedure install-path/src/web/support/webmsg.p contains the default web.output control handler to output the HTML for this custom tag.