:refreshall() not updating browse
:refreshall() not updating browse
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.
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: :refreshall() not updating browse
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
Best Regards
Wolfgang
Re: :refreshall() not updating browse
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:
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.
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: :refreshall() not updating browse
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
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
Re: :refreshall() not updating browse
They both do the same thing.
The eXpress train is coming - and it has more cars.
Re: :refreshall() not updating browse
That did it, thanks, guys!
Re: :refreshall() not updating browse
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
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
Regards
Re: :refreshall() not updating browse
Nolberto -
That sounds like a good idea and an easy implementation.
I just added it to _DCXBROW.PRG.
Line 1340
Line 1368
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 )
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.