Answered Add columns to empty SDB

djahn66

New Member
OpenEdge 10.2B
Windows 7

I'm using the ADM2 dynamic browser object (adm2/dynbrowse.w), which has been placed on a SmartFolder in a SmartWindow. I want to add different columns (from a linked SDO) to the browser depending on which SmartFolder page I'm on. Each folder page will have different columns. I'll also have to "clear" the browser for each page change then add the appropriate columns for that page.

Anyone know how I can go about doing this?
 
The ADM2 is not designed for that. Why so complicated? Why don't put a correct browser on each folder page because that's the way the ADM2 works?

Heavy Regards, RealHeavyDude.
 
ADM2 isn't designed for that? Really? Why does adm2/dynbrowser.w even exist then? Why did John Sadd write the "Creating Data Driven Smart Containers" white paper? Why does Progress/OpenEdge give us the ability to use the dynamic-function feature to change instance attributes?

The application I am developing can have up to 10 tabs, based on the user. There are over 40 different fields that can be in the browser. And the user needs to be able to order their columns in the browser. So to do a static browser, I'd have to code thousands of them. The only difference with each tab of the SmartFolder will be the order of the columns, which fields are to be displayed and the right-click functionality. NTM, I'm big on code reusability.

I can already assign the tabs labels of the folder based on the user at run time. I also have been able to use {set DisplayedFields xvariable} to initialize the fields of the dynamic browser. I just can't get it to change those fields when the page is changed. That's what the original question was asking.
 
Obviously I did not get what you mean from your desription and probably I still don't get it fully. Do you link a different SDO to the SDB when you change the page or does the SDB always have the same SDO as its data source?

Heavy Regards, RealHeavyDude.
 
The SDB always has the same SDO as it's data source.

Additional Info:

- The dynamic SDB is on page 0 of the SmartFolder.
- I can initialize the Displayed Fields to ? using {set DisplayedFields ?}
- I can set the Displayed Fields to a comma-delimited list when I view the first page and it works
- When I change the page, I cannot get the previously displayed columns removed from the browser and the Displayed fields function is not working.
 
You need to bear with me as the ADM2 dates back to the end of the 90s of the last century and even when Progress considered it "smokin' hot" it has not been used widely. The last time I did somthing with it seriously was back in 2002.

I am just thinking out loud - what if you did the following on changing the folder page:
  • Remove the data link to the SDO.
  • Destroy the SDB
  • Create the SDB again ( have a look into adm-create-objects [ don't know anymore if that's the correct name of the internal procedure but there must be somthing there named in such a way ] to see how it's done.
  • Add te data link to the SDO.
  • Initialize the SDB ( of course you would have an ovverride of initializeObject where - before run super - you would change the displayedFields property accordingly )
I have not tried it. But in the past I found it best to work with the ADM2, not against it - therefore using framework standard logic wherever I could. For you that could mean that it is easier to re-create the object on an as-needed basis as trying to modify the existing one.

Heavy Regards, RealHeavyDude.
 
Back
Top