SmartFolder/SmartFilter behavior

Don Carlson

New Member
This might be an easy one, but it has me stumped . . . Any help will be greatly appreciated! Using 9.1d08 in a Win2k environment.

- I have a SmartWindow with a SmartFolder and a SmartToolBar.
- The SmartFolder has 6 tabs, each with a SDO, SDV, SDB, and a SmartFilter.
- The SmartFilters are each in their own separate SmartWindows and the Instance Properties are set so they shouldn't be Enabled or Viewed on initialization.

When the program is run, Tab 1 automatically is chosen and the SmartFilter window does not come into view and is not enabled. The user then chooses Tab 2. Once again, the SmartFilter window is not enabled or viewed, exactly as it should be.

The problem is when the user clicks back to Tab 1, the SmartFilter window comes into view, and sometimes it enables itself and sometimes not. This should not be happening as the user has not clicked on the filter in the SmartToolBar. The same behavior occurs when the user goes back to Tab 2. If the user has closed both windows since they weren't needed, they will not automatically re-appear again in that session.

This occurs on all 6 tabs. The first time the user goes to a tab, it works fine, the second time, the SmartFilter window automatically appears, the user closes it and it doesn't come back. However, if the user has clicked on the SmartToolBar to go to the SmartFilter, then it won't automatically appear if they come back to the tab.

It's got me stumped. Thanks for any ideas or suggestions!

Don
 
Makes perfect sense, I think! :dizzy:

The first time the tab is selected, the filters will be initalized and because you have said that they shouldn't be viewed on initialization, they don't appear.

But when you return to tab 1, all objects on tab 1 will be viewed. This is just standard ADM behaviour - when a tab (page) is selected, the ADM will call viewObject for each object on that page - it's up to you to decide whether to override or not.

So basically, if you place any visual object on an ADM page, you can expect viewObject and hideObject to be called when the page is viewed or hidden.

A really simple fix for this is to override the viewObject method and place a RETURN statement before the RUN SUPER. This will effectively disable the viewObject method. You can then add your own method to perform the viewing on demand - e.g. you call the method when you want the filter window to become visible. In the method, you can say something like:

RUN viewObject IN SUPER.

HTH

Mike.
 
Top