Start-Search - Trigger in a browse

Storzum

Member
I want to use the Start-Search - Trigger in a browse and have set
the attribute ALLOW-COLUMN-SEARCHING to true.
But I am not able to select the "title-row" in the browse.
 

Storzum

Member
OMG.

Ihave coded some other triggers in my browse and they are not working too.

Here`s the code.
Any idea?

CREATE BROWSE mybrowse IN WIDGET-POOL "dynBuff"
ASSIGN FRAME = FRAME fmain:HANDLE
COLUMN = 2
ROW = 3.38
WIDTH = 145
HEIGHT = 25.95
QUERY = myqry
TITLE = "Journalanzeige"
SENSITIVE = TRUE
READ-ONLY = FALSE
MAX-DATA-GUESS = 3000
VISIBLE = TRUE
EXPANDABLE = TRUE
COLUMN-RESIZABLE = FALSE
COLUMN-MOVABLE = FALSE
COLUMN-SCROLLING = TRUE
FIT-LAST-COLUMN = FALSE
SEPARATORS = TRUE
MENU-MOUSE = 3
ALLOW-COLUMN-SEARCHING = TRUE
TRIGGERS:
ON START-SEARCH DO:
MESSAGE "HA"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
h-col = mybrowse:CURRENT-COLUMN.
RUN SortBrowse.
APPLY "END-SEARCH" TO SELF.
END.
ON SELECTION DO:
MESSAGE "Selektion"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.
ON ROW-ENTRY DO:
MESSAGE "Row entry"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.
END TRIGGERS.

Greets
Storzum
 

Storzum

Member
OK.
I don`t understand it, but it works.
I have put the trigger phrase in the definitions-section:
on start-search anywhere...
 

jongpau

Member
When you create dynamic widgets (browser, fill-ins etc etc) you need to use "PERSISTENT RUN" in the triggers.

For instance:
Code:
CREATE FILL-IN myHandle  
ASSIGN FRAME =  <handle to frame>
etc 
etc
TRIGGERS:    
ON VALUE-CHANGED
  PERSISTENT RUN <name of internal procedure> IN THIS-PROCEDURE (INPUT myHandle, INPUT "VALUE-CHANGED":U).  
END TRIGGERS.
What will happen is, when the value-changed trigger fires, it will automatically run the internal procedure that is mentioned in the trigger. That internal procedure can then do what you normally would do in a static widget's trigger. You can pass parameters to the internal procedure (as in the little example above) so you could, for instance, write some general code that can handle events for multiple widgets. How you would do that ultimately depends on what you would like to (or need to) do. Also note the "IN THIS-PROCEDURE" bit. If you do not use that, Progress will look for an external procedure instead of an internal one. This means that you can have your trigger procedures either as internal or external procedures or you could have these stored in some persistent procedure that is already running (in which case you would have to use IN <handle of the persistent procedure>).

So, in your case, the triggers of your dynamic browse do not fire because they are not using the PERSISTEN RUN option on the trigger. Change that (and remove that very ugly "ON START-SEARCH ANYWHERE" thing) and your code should work fine.
 
Top