Refreshing xBrowse Problem

Refreshing xBrowse Problem

Postby Adolfo » Tue May 08, 2018 3:21 pm

Mr Rao.

I have a xBrowse which I need to update with a different FwhMysql rowset. When I created it I do

oDbDat:=oSvr:Rowset(xSelect)
oBrow:setMysql(oDbDat,.T.,.T.)

Later on I need to change the select (same fields, but different data), then I do.

oDbNew:=oSvr:Rowset(NewSelect)
oDbDat:=oDbNew
oBrw:Refresh()
SysRefresh()

But nothing changes on the Browse, the old data is still present ( if I call a xBrowse(oDbDat) after assign oDbDat:=oDbNew to check it, the new data is there, but no replicated in the Browse)

Any Ideas
FWH 17.04
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile

Re: Refreshing xBrowse Problem

Postby nageswaragunupudi » Tue May 08, 2018 3:48 pm

Please try this sample.
You may adopt this logic to your situation
Code: Select all  Expand view  RUN
  local oCn, oRs, oRs2
   local oDlg, oBrw

   oCn   := FW_DemoDB()
   oRs   := oCn:RowSet( "SELECT first,city,state,salary FROM customer where state = 'NY'" )

   DEFINE DIALOG oDlg SIZE 600,400 PIXEL TRUEPIXEL

   @ 60,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE oRs AUTOCOLS CELL LINES NOBORDER
   oBrw:CreateFromCode()

   @ 20,20 BUTTON "Change RS" SIZE 150,30 PIXEL OF oDlg ;
      ACTION ( oRs2  := oCn:RowSet( "SELECT first,city,state,salary FROM customer WHERE state = 'CA'" ), ;
               oBrw:oDbf   := oRs2, ;
               oBrw:GoTop(),        ;
               oBrw:Refresh() )

   ACTIVATE DIALOG oDlg CENTERED
   oRs := nil
   oRs2 := nil
   oCn:Close()
   oCn := nil
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10662
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Refreshing xBrowse Problem

Postby Adolfo » Wed May 09, 2018 12:51 pm

Thanks a lot...it works perfect

Greetings from Chile
Adolfo
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
User avatar
Adolfo
 
Posts: 860
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 55 guests