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

NameDescription
ComponentClassNameComponentClassName is the name of the component's class. Inherited from Object (PRIM_OBJT)
ComponentMembersComponentMembers provides access to all the member components of this component Inherited from Object (PRIM_OBJT)
ComponentPatternNameComponentPatternName is used to qualify the class of the component. Inherited from Object (PRIM_OBJT)
ComponentTagGeneric space allowing a value to be stored for the instance Inherited from Object (PRIM_OBJT)
ComponentTypeComponentType gives you access to the type information about the component Inherited from Object (PRIM_OBJT)
ComponentTypeNameComponentTypeName is the fully qualified name of the component's class. Inherited from Object (PRIM_OBJT)
MessagesMessages on the message queue
NameName identifies the component Inherited from Object (PRIM_OBJT)
OwnerOwner owns this component Inherited from Object (PRIM_OBJT)
ParentThe 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

NameDescription
CreateInstanceCreateInstance is signalled when an instance of a component is created Inherited from Object (PRIM_OBJT)
DestroyInstanceDestroyInstance is signalled when an instance of a component is about to be destroyed Inherited from Object (PRIM_OBJT)
MessageAddedFired when a message has been added
Message
MessageRemovedFired when a message is deleted
Message

Methods

NameDescription
AddAdd a message to the queue
Result, Text, Control
ClearRemove messages from the queue for a particular control
Control
ClearAllRemove all messages

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2