From: richard.townsendrose on
hi all

we have this quite complex bbrowse with columns which are created on
the fly as follows:

********************************
DO WHILE ! SELF:oPF:EoF
cItem:=SELF:oPF:FIELDGET(#ItemNo)
cTrig:=SELF:oPF:FIELDGET(#TRIGCOL)
cTip:=AllTrim(SELF:oPF:FIELDGET(#FLOWTITLE))+CRLF+;
IIF(SELF:oPF:FIELDGET(#DOCTYPE)==DOC_TYPE_CONTACT,'Contact,
Subject:',IIF(SELF:oPF:FIELDGET(#DOCTYPE)==DOC_TYPE_MAIL,'Gen Doc,
Subject:','Fwd Gen Doc, Subject:')) + SELF:oPF:FIELDGET(#TYPEREF)+CRLF
+;
IIF(Empty(SELF:oPF:FIELDGET(#KEYWORD)),'','Keyword:
'+AllTrim(SELF:oPF:FIELDGET(#KEYWORD))) + ;
IIF(Empty(SELF:oPF:FIELDGET(#TRIGCOL)),'', CRLF + 'Trigger:
'+cTrig + ', Type: ' +
IIF(SELF:oPF:FIELDGET(#TRIGTYPE)==TRIG_TYPE_EMPTY,'Empty',
IIF(SELF:oPF:FIELDGET(#TRIGTYPE)==TRIG_TYPE_FULL,'Not Empty',
IIF(SELF:oPF:FIELDGET(#TRIGTYPE)==TRIG_TYPE_YES,'Yes', 'No'))))
cHead:=cItem + CRLF + AllTrim(SELF:oPF:FIELDGET(#FLOWTITLE))

oCol:=bDataColumn{SELF:oDCbrGroups,SELF:oAD,{|oSvr, oWin, cItem|
oWin:GetInfo(oSvr:FIELDGET(#ASSETREF), cItem)}, #Expression, SELF,
cItem}
oCol:HyperLabel:=HyperLabel{AsSymbol(cItem), cHead, cTip}
oCol:HeightVariable := BACTIVE
oCol:Width:=80
SELF:oDCbrGroups:AddColumn(oCol)
SELF:oDCbrGroups:OpenColumn(oCol)

SELF:oPF:Skip()
ENDDO
******************************

we have a filtering mechanism which operates on the results displayed
in the columns. this works very well ... the browse is driven off a
bdbserver using EXcluded record array. its fast

now i want to apply the filter immediately the browse has loaded ....
so i need to know when the browse has finished its work ... all i seem
to be able to do is operate on a columns which dont seem to have yet
got a value ...

HOW do i do that ?

regards

richard
From: richard.townsendrose on
Hi all

as usual, i found a bug inaother item of code - one of the filters
doesn't work ...

however, this is what i had to do to get the "column selected"
METHOD RefreshFilter() CLASS WFReview
// ONLY Called just after browse has been created
LOCAL cCol AS STRING

// select column... baPF contains definition of created columns
cCol:=SELF:cFilterCol
IF SELF:baPF:Locate({|oSvr|oSvr:FIELDGET(#ITEMNO)==cCol})
// set tdoc browse header column indicator
SELF:oDCbrGroups:SetActiveColumn(SELF:baPF:RECNO+1)
// set the column BEFORE as current column
SELF:oDCbrGroups:SetCurrentColumn(SELF:baPF:RECNO)
// put the focus to cell in the column
SELF:oDCbrGroups:SkipToCell(#Next,,BPF_SELECTSINGLE)
// now run the filter
SELF:FilterSet(SELF:cFilterType)
ENDIF

RETURN NIL
From: Stephen Quinn on
Richard

> SELF:oDCbrGroups:SetActiveColumn(SELF:baPF:RECNO+1)
> // set the column BEFORE as current column
> SELF:oDCbrGroups:SetCurrentColumn(SELF:baPF:RECNO)

How do you guarantee that the RECNO will never exceed the number of
columns??

CYA
Steve


From: richard.townsendrose on
Steve

we only allow 20 columns ...

and in fact we only needed this line
// set tdoc browse header column indicator
SELF:oDCbrGroups:SetActiveColumn(SELF:baPF:RECNO+1)
the method called sets the focus ok

r

From: Stephen Quinn on
Riichard

> we only allow 20 columns ...
But how many RECORDS??
RECNO has nothing to do with returning the number of columns.

Unless you meant you only allow 20 'records' with 20 columns
If so why use a filter as that's NOTa guanteed way to limit the number of
records to <= 20.

CYA
Steve


 | 
Pages: 1
Prev: ChildAppWindow in WED
Next: Menu and toolbar