How to set the bgcolor of a browse row in a dynamic browse

Beeb

Member
What i have:
I created a dynamic browse with as data-source a temp-table.
code:
CREATE BUFFER table-name FOR TABLE "tt_productie".
CREATE QUERY dyn-query.

dyn-query:SET-BUFFERS(table-name).

CREATE BROWSE dyn-browse-prod
ASSIGN WIDTH = 71
HEIGHT = 12
EXPANDABLE = FALSE
COLUMN = 1
ROW = 1
FRAME = FRAME frm_prod:HANDLE
READ-ONLY = TRUE
SENSITIVE = TRUE
SEPARATORS = TRUE
ROW-MARKERS = TRUE
VISIBLE = TRUE
COLUMN-RESIZABLE = TRUE
TRIGGERS:
ON ROW-DISPLAY PERSISTENT RUN prodCol.
END.

dyn-browse-prod:QUERY = dyn-query.
query-value = "For each tt_productie by dept by tiknr"
dyn-query:QUERY-PREPARE(query-value).

ASSIGN v_list = "tt_productie.keynr,tt_productie.dept,tt_productie.machine,tt_productie.tiknr,tt_productie.action,tt_productie.prodtijd,tt_productie.prodstil,tt_productie.totaal".

DO cntr = 1 TO NUM-ENTRIES(v_list, ","):
col-handle = dyn-browse-prod:ADD-LIKE-COLUMN(ENTRY(cntr,v_list,",")).
col-handle:READ-ONLY = TRUE.
IF cntr = 1
THEN col-handle:VISIBLE = FALSE.
CASE cntr:
WHEN 2 THEN col-handle:WIDTH = 6.
WHEN 3 THEN col-handle:WIDTH = 13.
WHEN 4 THEN col-handle:WIDTH = 7.
OTHERWISE col-handle:WIDTH = 8.
END CASE.
END.

dyn-query:QUERY-OPEN().

APPLY "home" TO dyn-browse-prod.

I think i need to do the colorchange in the "on-row-display" event.
here i need to check whether the value of the key-field (first column in the browse) of the row to display is available in a comma-seperated list. If so, the color of that row needs to change.

Can anybody give me a hint about this?
Thanks a lot!

Kind regards,

Elise
 
In the ROW-DISPLAY trigger simply use the handle to the column whose BGCOLOR attribute needs to be changed and change it with code similar to the following:

HandleToColumnInTheDynamicBrowse:BGCOLOR = SomeColorNumber.


Straight from the knowledge base i hope this helps
 
First of all thanks for the reaction!

how to just change to color i found out myself too..
I tried something like the following.. but it doesn't work.

code:
col-handle = dyn-browse-prod:GET-BROWSE-COLUMN(1).
fld-handle = col-handle:BUFFER-FIELD.
ASSIGN v_keynr = fld-handle:BUFFER-VALUE.

IF LOOKUP(STRING(v_keynr),v_errorlist
THEN col-handle:BGCOLOR = 15.

But then i get the error: GET-BROWSE-COLUMN cannot be queried within a ROW-DISPLAY trigger for BROWSE widget.

How can i solve this?

Thanks!
 
i would help you here but the problem is we stay away from dynamic browsers in most of our apps i mean their are some but im only 6 months in exp of progress. So im not that much experienced yet, and rarely do work with dynamic widgets and what not. But if i figure it out ill be sure to help.
 
Back
Top