KingCubicle
New Member
Hi everyone, I'm trying to build a dynamic browse class that accepts a dynamic temp table, query for said table and some parameters for screen location and size. I've hit a bit of a road block getting browse triggers to fire. Basically, I have the code below implemented, and cannot get any events to fire. I have to be doing something wrong. I haven't been able to find very many examples of classes generating dynamic UI components and their triggers.
Here's the constructor....
And the methods...
I found Parul's response here, and tried to implement it to no avail. I can get 'MOUSE-SELECT-DOWN' to fire when I attach it to BrowseHandle from outside the class (there's also a method I didn't list that returns the browse handle), but I can't get the trigger I really want to fire - START-SEARCH - to go.
And while we're at it, speaking of what I want to fire on 'START-SEARCH', BrowseHandle:CURRENT-COLUMN always returns the unknown value (?). Like I mentioned, I used the method Parul suggested to get the trigger (and in turn, the method below) to fire. Does anyone have any idea why that would be?
Thanks in advance everyone!!
Here's the constructor....
Code:
CONSTRUCTOR DyBrowse(INPUT dyTThan AS HANDLE , INPUT cQueryText AS CHAR, INPUT FrameHandle AS HANDLE,
INPUT dColumn AS DECIMAL , INPUT dRow AS DECIMAL , INPUT dBrowseWidth AS DECIMAL, INPUT dBrowseHeight AS DECIMAL):
ASSIGN THIS-OBJECT:dyTThan = dyTThan
THIS-OBJECT:cQueryText = cQueryText
THIS-OBJECT:FrameHandle = FrameHandle
THIS-OBJECT:hBuffer = dyTThan:DEFAULT-BUFFER-HANDLE
THIS-OBJECT:dColumn = dColumn
THIS-OBJECT:dRow = dRow
THIS-OBJECT:dBrowseWidth = dBrowseWidth
THIS-OBJECT:dBrowseHeight= dBrowseHeight.
setUpQuery().
setUpBrowse().
END CONSTRUCTOR.
And the methods...
Code:
METHOD PRIVATE VOID setUpQuery():
create handle, set-buffers, query-prepare, query-open, get-first, etc.
END METHOD.
METHOD PRIVATE VOID setUpBrowse():
create browse BrowseHandle
assign
ROW-MARKERS = FALSE
frame = FrameHandle
query = QueryHandle
ROW = dRow
COLUMN = dColumn
WIDTH = dBrowseWidth
HEIGHT = dBrowseHeight
separators = yes
multiple = yes
visible = yes
sensitive = TRUE
read-only = YES
max-data-guess = 25
COLUMN-RESIZABLE = FALSE
COLUMN-SCROLLING = TRUE
COLUMN-RESIZABLE = TRUE
ALLOW-COLUMN-SEARCHING = TRUE
SCROLLBAR-VERTICAL = TRUE
FIT-LAST-COLUMN = TRUE
TRIGGERS:
/* I know this isn't the right place for this, where should i put it? */
ON 'MOUSE-SELECT-DOWN' MESSAGE 'OK' VIEW-AS ALERT-BOX.
END TRIGGERS.
END METHOD.
I found Parul's response here, and tried to implement it to no avail. I can get 'MOUSE-SELECT-DOWN' to fire when I attach it to BrowseHandle from outside the class (there's also a method I didn't list that returns the browse handle), but I can't get the trigger I really want to fire - START-SEARCH - to go.
And while we're at it, speaking of what I want to fire on 'START-SEARCH', BrowseHandle:CURRENT-COLUMN always returns the unknown value (?). Like I mentioned, I used the method Parul suggested to get the trigger (and in turn, the method below) to fire. Does anyone have any idea why that would be?
Code:
METHOD PUBLIC VOID mpSortColumn():
DO WITH FRAME FrameHandle:
IF VALID-HANDLE(BrowseHandle:CURRENT-COLUMN)
MESSAGE 'YAY' VIEW-AS ALERT-BOX.
ELSE
MESSAGE 'OH NO' VIEW-AS ALERT-BOX.
END.
END METHOD.
Thanks in advance everyone!!