Row-display trigger in a smart-browse error 5906

Tranborg

New Member
I want to colour a row/columns value red then value is < 0 in a browser.
In 8.3 it is easy. In row-display trigger I test on buffer.myfield < 0 then buffer.myfield:fgcolor in browse {browse-name} = 14.

But in 9.1 the rowObject is not available and screen-value is not readable (Error 5906).
How do I do? Please someone help me.

Regards Lennart
 

Stefan De Leyn

New Member
Please find below an example of how I've done what you are looking for. I've used this many times already and have never encountered any problems.
This code is in the ROW-DISPLAY-trigger of the browse-table.
Hope this helps you out.


IF rowobject.FaktBet = FALSE OR rowobject.faktdat > TODAY - 15 THEN
ASSIGN rowobject.faktuur:FGCOLOR IN BROWSE {&browse-name} = 12
rowobject.faktuur:FONT = 6.
ELSE
ASSIGN rowobject.faktuur:FGCOLOR IN BROWSE {&browse-name} = ?
rowobject.faktuur:FONT = ?.
 

Tranborg

New Member
Thanks Stefan!

It works but I still don't understand how rowObject can be available when it not available. The problem I had was the first line in my ROW-DISPLAY trigger:

IF NOT AVAILABLE rowObject THEN RETURN.

rowObject was never available, so I always exit with a RETURN.

When I deleted that line it works!? MAGIC or just a 9.1 feature? :confused:

Thanks again Stefan :awink:
 

Stefan De Leyn

New Member
The rowobject is always available in a smartbrowser. It is basically nothing more then a temp-table (although it does have some special features) being filled up with the data from the SDO. Even if there is no data the rowobject-table will still exist, it will simply be empty.
If you merely had the 'if avail ...' statement then you will always exit because there is nothing available without having a find-statement first (as with any table in Progress).
You are just changing the appearance of the row based upon a value in the record to be displayed. If there is no record then the ROW-DISPLAY trigger will simply not execute so no need to do an available check first.

Hope this clears it up for you.
 

Tranborg

New Member
Not really. It's still magic for me. I beleve I understand the behaivour of tables and temp-tables. At least in V8.
How can I read the data if the data-buffer is not available?
I think Progress have a bug in there. Or there are different levels of availablility of temp-table rowObject.

Still confused.
 

Stefan De Leyn

New Member
You assume correct.
The rowobject table is normally only accesable through it's screen-values although the ROW-DISPLAY trigger seems to be an exception to this general rule.

It is not quite clear yet to me as well how the entire system works but the databuffer for this temp-table seems to be the actual SDO (as far as I have been able to figure it out).
 

Tranborg

New Member
OK this is really hard to understand.

My next problem. In the Deafult-action trigger of the browser I want to get rowObject values. How do I do?
Now the rowObject is not available but screen-value in browse {browse-name} works.
But I want a value thats not visible in the browser. Like rowObject.Rownum or whatever they called it.

Why is everything so hard to do in V9 where in V8 was easy an understandable? Everything takes 5-10 times more time to do now. And this is only a simple static browser! Don't mention the problems you can get when going dynamics!

Don't take this personally Stefan. You have ben really helpful. I just have to complain about this. And I don't beleve I'm the only one getting frustrated with Progress V9 new ADM2.
I'd made some tests. V8 ADM is 5-10 times faster to develope and 5-10 times faster to execute against V9 ADM2! Really! I had a small project made in V8 ADM migrated to V9 ADM2. But I had to go back to V8 again because it was to slow to execute and to complicated to develope. The ADM2 overhead is huge.


I hope Progress have a better plan for us developers. Just now (9.1C) they are not my friend anymore. :dead:
 

Stefan De Leyn

New Member
You need to keep in mins that with the SDO there is no more need for Database connections when working with AppServer. This means higher security but also that you need to use the SDO for all 'communications' with the Database. I admit that working in v9.1 and v8.0 is very different. The main reason being that the developer had the liberty in v8.0 to put code wherever and whenever he wanted to in a program. In v9.1c this is no longer the case. You are forced to work in a certain way because of the standard now set by Progress. It is a big changeover and means changing the way of developing programs. I've been working in v9.1 for little over a year and struggled through the first months as well but now find that the reusability of the SDO makes developing applications easier. I always compare the SDO to the Include-files which made life easy as well once you got the hang of it (and that is the problem for quite a few developers).

To answer your question on how to access non-Browser fields :
You can always retrieve any field directly from the SDO by using the following SDO/Browser API-functions:
/* I always include below 2 lines in any Smartviewer. As soon as you need to check something against the DataBase you need this handle anyway since you need te revert to the SDO */
/* IN DEFINITIONS */
def var hanDataSource as handle no-undo.
/* PRIOR TO SUPER OF INITIALIZEOBJECT */
hanDataSource = DYNAMIC-FUNCTION('getDataSource':U).

/* retrieve the value you need from the currently selected row */
DYNAMIC-FUNCTION('columnValue':U IN hanDataSource, INPUT pcColumn /* Name of the column*/).

Hope this does the trick for you.
 
Top