You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Message Queue (PRIM_MSGQ)
Message Queue provides access to the messages generated for the application
Ancestors - Object (PRIM_OBJT)

Details


The Message Queue provides access to all messages generated during the execution of the application through SYS_MSGQ object.
Messages are generated through a variety of means such as repository validation rules and the MESSAGE command.
Messages generated on the server are automatically routed to the client.

Example


In this example, contextual messages are added directly to the UI when validating a user ID and password.
Begin_Com Role(*EXTENDS #PRIM_WEB) Height(448) Width(721) Theme(#SYS_THEME<2015LightGreen>)
Define_Com Class(#PRIM_TBLO) Name(#TableLayout1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Column1) Displayposition(1) Parent(#TableLayout1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row1) Displayposition(1) Parent(#TableLayout1)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutItem1) Column(#Column1) Manage(#Messages) Parent(#TableLayout1) Row(#Row1) Sizing(None)
Define_Com Class(#xDemoPassword.Visual) Name(#gPassword) Displayposition(1) Left(8) Parent(#COM_OWNER) Tabposition(2) Top(40) Width(385) Height(25)
Define_Com Class(#xDemoAlpha128.Visual) Name(#gUserID) Displayposition(2) Left(8) Parent(#COM_OWNER) Tabposition(1) Top(8) Width(385) Height(25) Caption('UserID') Labeltype(Caption)
Define_Com Class(#PRIM_PHBN) Name(#OK) Displayposition(4) Left(312) Parent(#COM_OWNER) Tabposition(4) Top(80) Caption('OK') Buttondefault(True)
Define_Com Class(#xDemoWebMessagesPopup) Name(#Messages) Height(248) Parent(#COM_OWNER) Width(393) Left(164) Top(100) Autoclose(True)
Evtroutine Handling(#OK.Click)
#Com_owner.Validate
Endroutine
Mthroutine Name(Validate)
#sys_msgq.Clearall
If (#gUserID.uppercase <> USER)
#sys_msgq.Add( "Username is invalid" #gUserID )
Endif
If (#gPassword = "")
#sys_msgq.Add( "Password cannot be blank" #gPassword )
Endif
If (#gPassword.uppercase <> PASSWORD)
#sys_msgq.Add( ("Password is invalid for user &1").Substitute( #gUserID ) #gPassword )
Endif
If (*Not #Sys_Msgq.Messages.IsEmpty)
#Messages.Show
Endif
Endroutine
End_Com

Properties

Name

Description

ComponentClassName

ComponentClassName is the name of the component's class. Inherited from Object (PRIM_OBJT)

ComponentMembers

ComponentMembers provides access to all the member components of this component Inherited from Object (PRIM_OBJT)

ComponentPatternName

ComponentPatternName is used to qualify the class of the component. Inherited from Object (PRIM_OBJT)

ComponentTag

Generic space allowing a value to be stored for the instance Inherited from Object (PRIM_OBJT)

ComponentType

ComponentType gives you access to the type information about the component Inherited from Object (PRIM_OBJT)

ComponentTypeName

ComponentTypeName is the fully qualified name of the component's class. Inherited from Object (PRIM_OBJT)

Messages

Messages on the message queue

Name

Name identifies the component Inherited from Object (PRIM_OBJT)

Owner

Owner owns this component Inherited from Object (PRIM_OBJT)

Parent

The component instance to which this instance is attached. The visual container for a control or the collector of a set of child instances Inherited from Object (PRIM_OBJT)

Events

Name

Description

CreateInstance

CreateInstance is signalled when an instance of a component is created Inherited from Object (PRIM_OBJT)

DestroyInstance

DestroyInstance is signalled when an instance of a component is about to be destroyed Inherited from Object (PRIM_OBJT)

MessageAdded

Fired when a message has been added Message

MessageRemoved

Fired when a message is deleted Message

Methods

Name

Description

Add

Add a message to the queue Result, Text, Control

Clear

Remove messages from the queue for a particular control Control

ClearAll

Remove all messages

See also

All Component Classes
Technical Reference

  • No labels