Dynamic CURRENT-COLUMN of Browse

KMoody

Member
I'm having trouble setting the current column of a browse widget:

Code:
CREATE BROWSE hBrowsePopup
  ASSIGN
  FRAME = FRAME popupFrame:HANDLE
  QUERY = hPopupQuery
  TITLE = "Select"
  COLUMN = 1
  HEIGHT-CHARS = 10
  DOWN = 10
  SENSITIVE = TRUE
  READ-ONLY = TRUE
  COLUMN-SCROLLING = TRUE
  SEPARATORS = YES
  MULTIPLE = canSelectMultiple 
  VISIBLE = FALSE
  REFRESHABLE  = TRUE
  ALLOW-COLUMN-SEARCHING = TRUE
  COLUMN-MOVABLE = FALSE
  NO-VALIDATE = TRUE

  TRIGGERS:
  ON ANY-PRINTABLE
  DO:
   hSortColumn = hBrowsePopup:CURRENT-COLUMN.
 
    IF hSortColumn = ? THEN
    do:
      def var cur-col AS WIDGET-HANDLE NO-UNDO.
      cur-col = hBrowsePopup:FIRST-COLUMN.
      apply "entry" TO cur-col.
      hBrowsePopup:CURRENT-COLUMN = cur-col.
      apply "start-search" to hBrowsePopup.
    END.
  END.
  ON START-SEARCH
  DO:
    /* ... */
  END.
/* ...... Other triggers below...... */
END TRIGGERS.

However, "start-search" won't work because hBrowsePopup:CURRENT-COLUMN never gets set. Why doesn't "hBrowsePopup:CURRENT-COLUMN = cur-col" set the current column?
 
Last edited:
It seems the same problem exists with a static browse as well, and this article - http://knowledgebase.progress.com/articles/Article/P183763 - may provide the solution and in particular this part:
Code:
def var cur-col as handle.
address2:read-only in browse browse-1 = false.
cur-col = address2:handle in browse browse-1.
apply "entry"to cur-col.
apply "start-search" to browse browse-1.
address2:read-only in browse browse-1 = true.
As a quick test I defined a static browse, set one of the fields to be enabled, and before the browse was enabled set this field to read only - Customer.address1:READ-ONLY IN BROWSE hBrowsePopup = TRUE. Using your exact code for the ON ANY-PRINTABLE trigger and not the one in the Progress solution, found that hBrowsePopup:CURRENT-COLUMN = cur-col did get set.

I don't know if this helps.
 
Back
Top