ADM2 - SmartDataBrowse: Error 5905 within resizeObject

moveIT

New Member
My Environment: Windows XPSP2 with Progress 9.1D07

I am having a problem resizing a smartdatabrowse. Choosing a button makes the browser bigger and smaller. This works fine!
Now I make the browse so small that it becomes scrollable and only some records are visible. Than I want to make the browse bigger and now I get following error:

**All or part of BROWSE xy is being placed outside of FRAME z by setting HEIGHT. (5905)

This error appears within "adm2\browser.p" in procedure "resizeObject" at the red marked line (variable otherWidget is no):
[...]
/* If the width is getting smaller, do the browse first else the frame */
IF pd_width < hBrowse:WIDTH THEN
ASSIGN hBrowse:WIDTH = pd_width - (hBrowse:COLUMN - 1) WHEN NOT otherWidget
hFrame:WIDTH = MAX(pd_width,dSearchSize) NO-ERROR.
ELSE
ASSIGN hFrame:WIDTH = MAX(pd_width,dSearchSize)
hBrowse:WIDTH = pd_width - (hBrowse:COLUMN - 1) WHEN NOT otherWidget
NO-ERROR.
ASSIGN hBrowse:HEIGHT = pd_height - (hBrowse:ROW - 1) WHEN NOT otherWidget NO-ERROR.
/* Error 6422 is given because the browse requires minimum 2 rows in viewport.*/
IF ERROR-STATUS:ERROR AND ERROR-STATUS:GET-NUMBER(1) = 6422 THEN
DO:
/* Make the browse as low as allowed */
hBrowseOWN = 2.
pd_Height = hBrowse:HEIGHT + (hBrowse:ROW - 1).
END.
hFrame:HEIGHT = pd_height NO-ERROR.
[...]


Can anyone help me with my problem?
How can error 5905 appear although this ASSIGN-statement has set the option NO-ERROR?
Why does it work fine as long as the browse is not set to scrollable?
 
I had a similar problem recently with a smart object. I spent several hours trying to figure it out, but in the end used a kludge:


SESSION:SUPPRESS-WARNINGS = TRUE. /* Fudge to avoid annoying error message I couldn't eliminate. Error only occurs SECOND time repositionobject is called! */

RUN repositionObject IN h_pupdsav ( 17.43 , 81.00 ) NO-ERROR.

SESSION:SUPPRESS-WARNINGS = FALSE.


This is of course, a completely unsatisfying 'fix', and I would have thought there is a more correct answer to the general resizing Smart Objects problem, so let us know if you sort it.
 
Thanks, but I found following solution, that works in the same unsatisfying way. I overwrote resizeObject of my SDB where I corrected the HEIGHT-CHARS of the frame manually bevor running SUPER.

PROCEDURE resizeObject :
/* resizeObject */
DEFINE INPUT PARAMETER pd_height AS DECIMAL NO-UNDO.
DEFINE INPUT PARAMETER pd_width AS DECIMAL NO-UNDO.
FRAME wFrameDocumentPositions:SCROLLABLE = NO.
ASSIGN
FRAME wFrameDocumentPositions:HEIGHT-CHARS = pd_height
WHEN FRAME wFrameDocumentPositions:HEIGHT-CHARS < pd_height
.
RUN SUPER( INPUT pd_height, INPUT pd_width).
IF VALID-HANDLE(ghDataSource) THEN DO:
/* aktuell selektierte Position merken */
DEFINE VARIABLE lcPosSNr AS CHARACTER NO-UNDO.
lcPosSNr = DYNAMIC-FUNCTION('columnValue':U IN ghDataSource, "DocSNr":U).
/* Browse aktualisieren */
RUN refreshBrowse.
/* War zuvor eine Position selektiert? */
IF NOT IS-EMPTY(lcPosSNr) THEN DO:
/* Zuvor selektierte Position wieder selektieren */
DYNAMIC-FUNCTION("findRowWhere":U IN ghDataSource, "DocSNr":U, lcPosSNr, ?).
END.
END.
END PROCEDURE. /* resizeObject */

Problem in your and my solution is that the browse has after running SUPER display-errors. Some record lines are displayed white. But refreshing it helps!
 
Back
Top