FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Replacing an oTree on an xbrowse at runtime (solved)
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Replacing an oTree on an xbrowse at runtime (solved)
Posted: Mon Dec 09, 2013 02:24 PM
Hi.

I have a tree being xbrowsed that needs to be totally replaced at run time. I figured I could simply reassign the otree property of the xbrowse and then refresh but this is not working. Any ideas?

Code (fw): Select all Collapse
//------------------------------------------------------------------------------
METHOD ToggleFilter() CLASS TIcd10Browser
   LOCAL cFilter  := ::cFilter
   LOCAL nCurrRec := ::oDbf:RecNo()

   IF ::isFilterON

      IF !EMPTY( ::cFilterExpression )

         //sanitize the filter expression first.      
         ::cFilterExpression := STRTRAN( ::cFilterExpression, "'", "" )
         cFilter := ::cFilter + " .AND. CONTAINS( *, '" + ALLTRIM( ::cFilterExpression ) + "' )" 

         ::ReBuildChaptersTree()  //creates a new ::oTree 
         ::oBrw:oTree := ::oTree
         ::oBrw:Refresh()
         
      ENDIF

   ENDIF

  …

RETURN .T.


Thank you.


Reinaldo.
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: Replacing an oTree on an xbrowse at runtime
Posted: Mon Dec 09, 2013 02:31 PM

Sorry, I was wrong. It is working by simply re-assigning the new ::otree to the otree property of the xbrowse object. (solved).

Reinaldo.

Continue the discussion