:refreshall() not updating browse

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Tim K
Posts: 51
Joined: Thu Jun 03, 2010 3:55 pm

:refreshall() not updating browse

#1 Post by Tim K »

I'm pretty new to the Xpress browsing windows so I might be missing something obvious. I'm building a restore function so that a user can continue from a saved state. I save the data array to a file and then update the main data array to the saved array. The data array gets updated fine but the browse won't update after a :refreshall() and forcestable(). The array is private. I can see in the DC_xbpBrowse object that the :datasource is still not updated.

Wolfgang Ciriack
Posts: 484
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: :refreshall() not updating browse

#2 Post by Wolfgang Ciriack »

You don't need to make the array private, make it local and set a new array for the DCBROWSE with dc_getbrowarray(oBrowse, aNew). For saving and restoring the array to a file use the functions DC_ARRAY_W(aAct,myfile) and aNew:=DC_ARRAY_R(myfile).
_______________________
Best Regards
Wolfgang

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: :refreshall() not updating browse

#3 Post by rdonnay »

When you restore an array using DC_Array_R() or DC_ARestore(), you are creating a new pointer to the array in memory.

To attached the new array pointer to the browse do the following:

Code: Select all

aNewArray := DC_ARestore('MyNewArray.Ar')
oBrowse:dataSource := aNewArray
oBrowse:refreshAll()
The eXpress train is coming - and it has more cars.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: :refreshall() not updating browse

#4 Post by Cliff Wiernik »

Roger,

Are you saying we should be updating of the browse:dataSource instead of DC_Getbrowarray() or is there no difference using one method versus the other.

Cliff

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: :refreshall() not updating browse

#5 Post by rdonnay »

They both do the same thing.
The eXpress train is coming - and it has more cars.

User avatar
Tim K
Posts: 51
Joined: Thu Jun 03, 2010 3:55 pm

Re: :refreshall() not updating browse

#6 Post by Tim K »

That did it, thanks, guys!

User avatar
digitsoft
Posts: 461
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

Re: :refreshall() not updating browse

#7 Post by digitsoft »

Hi Roger
Doing it this oBrowse Best Form :refreshAll (aNewArray) and that: refreshall you do this oBrowse: DataSource: = aNewArray) if you send the parameter, this modification the tube to do, but I would like to be Native Expresss

Because the same problem is if we use Object SQL

Thank you
Nolberto Paulino
Regards

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: :refreshall() not updating browse

#8 Post by rdonnay »

Nolberto -

That sounds like a good idea and an easy implementation.
I just added it to _DCXBROW.PRG.

Line 1340

Code: Select all

WAS:
METHOD DC_XbpBrowse:RefreshAll()

IS:
METHOD DC_XbpBrowse:RefreshAll( aNewArray )
Line 1368

Code: Select all

WAS:
elseif ::dataSourceType = BROWSE_ARRAY   

IS:
elseif ::dataSourceType = BROWSE_ARRAY     
   IF Valtype(aNewArray) == 'A'
     ::dataSource := aNewArray
   ENDIF
The eXpress train is coming - and it has more cars.

Post Reply