changing query on a freeform browser while runtime without temp tables

psuter

New Member
Dear progress developpers

I've used a freeform browser in addition with a temp temple to be able to change the query while runtime. In the attributes of the browser I've found a QUERY attribute and asked myself if it is possible to assign a dynamic query handle directly to that attribute without using a temp temple, because the temp table slows down my performance. Perhaps this is a silly question, but I'm new in the progress world.

I know that it is possible using dynamic browsers.

Could anybody help me in that matter?

Best regards, Pascal
 
I don't know if this answers your question, but....

We use
A dynamic query v-hQuery AND the default buffer of a dynamic temp-table v-hTmp_Buffer

And create
A dynamic browse

CREATE BROWSE v-hBrowse
ASSIGN QUERY = v-hQuery
PARENT = FRAME {&FRAME-NAME}:FIRST-CHILD
COLUMN = 1.8
ROW = 1.19
WIDTH-CHARS = 78.4
HEIGHT-CHARS = 10.67
COLUMN-SCROLLING = FALSE
COLUMN-RESIZABLE = TRUE
COLUMN-MOVABLE = TRUE
ROW-MARKERS = FALSE
SEPARATORS = TRUE
MAX-DATA-GUESS = v-hQuery:NUM-RESULTS
VISIBLE = TRUE
SENSITIVE = TRUE.

IF v-hBrowse:SET-REPOSITIONED-ROW(2,"CONDITIONAL") THEN.

DO v-iLoop = 1 TO v-hTmp_Buffer:NUM-FIELDS:
ASSIGN v-hField = v-hTmp_Buffer:BUFFER-FIELD(v-iLoop).
v-hBrowse:ADD-LIKE-COLUMN(v-hField).
END.

IF v-hBrowse:REFRESH() THEN.

APPLY "HOME" TO v-hBrowse.
APPLY "ENTRY" TO v-hBrowse.
 

psuter

New Member
Thank you very much for answering my question, but this is the solution for a dynamic browser. You instantiate the dynamic browser while runtime, but I want to use a standard freeform browser that could be placed on the form while "Design-Mode".

Best regards, Pascal
 
I would have thought that a static freeform browser would require a compilable OPEN_QUERY statement.
This, in turn, would suggest something to stick at the end of your FOR EACH/PRESELECT EACH clause.
If you don't use a temp table or a database table, what do you use?

Static is old-hat. Come on over to dynamic. :devil:
 

psuter

New Member
O.k. you're deadly right, but I've thought of giving the browser an open-query to compile and change somehow the query over the query attribute on the browser itself while runtime. As you've seen, this was the thinking of a man that did not really understand the behaviour of a static browser.

Best regards, Pascal
 
I've just tried this on our dynamic example and it worked.

Put your freeform browser on the window. Go to the OPEN_QUERY "trigger" and choose to DELETE THE TRIGGER. It will give you a warning message - don't worry.

Then as before.......

/* New code */
ASSIGN v-hBrowse = {&BROWSE-NAME}:HANDLE
v-hBrowse:QUERY = v-hQuery.

/* Comment out CREATE BROWSE */

IF v-hBrowse:SET-REPOSITIONED-ROW(2,"CONDITIONAL") THEN.

DO v-iLoop = 1 TO v-hTmp_Buffer:NUM-FIELDS:
ASSIGN v-hField = v-hTmp_Buffer:BUFFER-FIELD(v-iLoop).
v-hBrowse:ADD-LIKE-COLUMN(v-hField).
END.

IF v-hBrowse:REFRESH() THEN.

APPLY "HOME" TO v-hBrowse.
APPLY "ENTRY" TO v-hBrowse.
 

psuter

New Member
Now, I'm a little bit confused! Does this really mean that my suggestion was right? There is hope!

Thank you very much, I'll try the code tomorrow.

Very special regards, Pascal :)
 
Top