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

Compare with Current View Page History

Version 1 Next »

iMonitorSubject Interface (PRIM_DC.IMonitorSubject)
Interface that allows a visual host reusable part to interact with other components via a monitor
Ancestors - None

Details


Interface that allows a visual host reusable part to interact with other components via a Monitor.
This interface is used in a reusable part as part of a hosted field visualization.

Example


The following example uses the iMonitorSubject and iContextualSubject to support use as a field visualization, in this case an autocomplete feature for SURNAME.
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_PANL *implements #Prim_dc.iMonitorSubject #Prim_dc.iContextualSubject) Defaultpty(Value) Displayposition(1) Height(19) Layoutmanager(#TableLayout_1) Left(0) Tabposition(1) Tabstop(False) Top(0) Width(418)
Define_Com Class(#Surname.Visualedit) Name(#Surname) Displayposition(1) Height(19) Marginleft(0) Parent(#COM_OWNER) Tabposition(1) Width(418)
Define_Com Class(#PRIM_TBLO) Name(#TableLayout_1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row_1) Displayposition(1) Parent(#TableLayout_1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Column_1) Displayposition(1) Parent(#TableLayout_1)
Define_Com Class(#PRIM_TBLO.Item) Name(#Item_1) Column(#Column_1) Manage(#Surname) Parent(#TableLayout_1) Row(#Row_1)

  • Default property of the Value to allow data values to beset/retrieved
    Define_Pty Name(Value) Get(*auto #Surname) Set(*auto #Surname)
    Mthroutine Name(OnContextChanged) Options(*redefine)
  • If being hosted in a field
    If (#Context *Is #prim_evp)
  • Match the edit to the component field state
    #Surname.ReadOnly := (#Context *As #prim_evp).ReadOnly
    #Surname.ShowError := (#Context *As #prim_evp).ShowError
    Endif
    Endroutine
    Evtroutine Handling(#Surname.Changed)
    Signal Event(ValueChanged)
    Endroutine
    Evtroutine Handling(#Surname.AutoCompleting) Value(#Value)
  • Find the first record matching the entered value
    Select Fields(#Surname) From_File(pslmst2) With_Key(#Value) Generic(*yes)
    #Value := #Surname
    Leave
    Endselect
    Endroutine
    End_Com

    Events

    Name

    Description

    ValueChanged

    Signals that the current value of a field has changed

    Methods

    Name

    Description

    ApplyMonitoredValue

    Informs a monitoring Target of a change in a monitored Source value MonitorSubject

    GetValue

    Obtains the value of a monitored source component Result

    See also

    All Component Classes
    Technical Reference
  • No labels