Question Dynamic DISPLAY and SET/UPDATE

KMoody

Member
Progress: 10.2b SP7
OpenEdge Architect: 3.4.2.R342_v20090122-9I96EiWElHi8lheoJKJIvhM3JfVsYbRrgVIWL
OpenEdge OS: Windows 7 Professional 2009 SP1


I’d like to create a function which receives a record or list of records. If a user has Can-Read rights to a field in that record, then the program displays the field. If the user has Can-Write rights to the field, then the user can also update that field.
  1. Is it possible to pass a record/record list to a function? If not, could I pass a query instead?
  2. How can I set up dynamic displays and updates/sets? I tried the following, but neither worked:
Code:
FIND item WHERE part-num = "2000".
DEF VAR dx as char init "part-num item-description".
SET item STRING(dx) WITH FRAME dtehdr.
Code:
FIND item WHERE part-num = "2000".
DEF VAR dx as char init "part-num item-description".
SET item VALUE(dx) WITH FRAME dtehdr.
 
1. yes, yes
2. yes, but not with static update / set - you will need to create dynamic fill-ins (see create widget statement)
 
Thanks, Stefan.

So there's no way to pass a variable array or a string list of fields to an update or set statement? You have to handle it through the fill-in widget? If so, I'd like to understand why this is the case.
 
I'm sure Stefan has a better answer, but here is mine: SET and UPDATE are from Progress 1995, before any dynamic or GUI features existed. When it sees SET/UPDATE it is statically laying out a frame and so forth at compile time. I suppose they could have implemented it the way you imply but instead they chose to create a whole new SET/UPDATE alternative (if you will) using static/dynamic widgets.

In general, Progress differs from C#/Java in that most things (widgets, fields, temp-tables etc.) have both a dynamic and a static version, whereas in C#/Java it is roughly true that everything is dynamic. The 'static stuff' is much older and in some ways clunkier/less flexible, although I would argue that it's also more reliable since it benefits from fairly thorough compile-time checking. IMO there is a place for both, we generally prefer dynamic objects for GUI but static temp-tables except where there is a clear need otherwise. YMMV of course.
 
Thanks, that's very helpful. I think I misunderstood what widgets are. I thought of them as GUI pieces that only drew on existing OpenEdge features; it seems they're much more than that!
 
I would say "widgets are GUI pieces" is true, but "drew on existing features" is false (if by "existing features" you mean SET, UPDATE etc.)
 
Just in case anyone else out there has the same question as I did: I found a very helpful article called "Create, Update and Delete Records Using Dynamic Buffers."

Thanks again, everyone.
 
Back
Top