|
Home > Archive > Programming with dBASE > March 2006 > Controls Content not Updating
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Controls Content not Updating
|
|
| Eddie Muniz 2006-03-05, 8:27 pm |
| I have a form that accesses various tables and some of these table use
comboboxes that have FIELD LIST of the some other tables within the control.
What happens is for example if I add a record or delete a record from table
INSURANC and then I go to add a new PATIENT, the combobox in the PATIENT
editing screen does not show the newly added or removed item. I have the
form.refreshalways = .t. I have even tried to do a form.refresh() after
all editing. The only way to get the new list in the combobox is to exit
the form and go back in. Am I overlooking something, this is a big
problem for my customers.
Eddie Muniz
| |
| Eddie Muniz 2006-03-05, 8:27 pm |
| SORRY I forgot -----> Version is 5.7
"Eddie Muniz" <eddie0605@bellsouth.net> wrote in message
news:PrMgn8UPGHA.1740@news-server...
>I have a form that accesses various tables and some of these table use
>comboboxes that have FIELD LIST of the some other tables within the
>control. What happens is for example if I add a record or delete a record
>from table INSURANC and then I go to add a new PATIENT, the combobox in
>the PATIENT editing screen does not show the newly added or removed item.
>I have the form.refreshalways = .t. I have even tried to do a
>form.refresh() after all editing. The only way to get the new list in the
>combobox is to exit the form and go back in. Am I overlooking something,
>this is a big problem for my customers.
>
> Eddie Muniz
>
>
| |
| Jan Hoelterling 2006-03-05, 8:27 pm |
| I am not familiar with Version 5.7, but the way comboboxes work is that they
read the choices into an array, which - as you found out - does not get
refreshed. In DB2K & PLUS, that property is called DATASOURCE and all you
need to do is to "re-state" it:
this.datasource = this.datasource.
I don't know what it's called in 5.7, but the principle should be the same
Hope this helps,
Jan
| |
| Eddie Muniz 2006-03-05, 8:27 pm |
| Well I found a way around it by resetting the control on the ONGOTFOCUS
event but PLEASE TELL ME I dont have to do this for all my controls in the
entire program
form.combobox.datasource = form.combobox.datasource
ARGHHH
PLEASE HELP
Eddie
"Eddie Muniz" <eddie0605@bellsouth.net> wrote in message
news:Ay2LK9UPGHA.560@news-server...
> SORRY I forgot -----> Version is 5.7
>
> "Eddie Muniz" <eddie0605@bellsouth.net> wrote in message
> news:PrMgn8UPGHA.1740@news-server...
>
>
| |
| Todd Kreuter 2006-03-05, 8:27 pm |
| Eddie Muniz wrote:
>
> Well I found a way around it by resetting the control on the ONGOTFOCUS
> event but PLEASE TELL ME I dont have to do this for all my controls in the
> entire program
>
> form.combobox.datasource = form.combobox.datasource
>
> ARGHHH
Of course not. Comboboxes load their lists when the form opens and
remain static until you tell them to update.
--
Todd Kreuter [dBVIPS]
| |
| Eddie Muniz 2006-03-05, 8:27 pm |
| Todd I am aware of that, but according to the documentation I have read
the REFRESHALWAYS method of the form is supposed to update controls when
certain movements take place in the tables. Also FORM.REFRESH() is
supposed to do the same of all controls on the form but manually, but
neither one of those are working.
Did I read something wrong ? If so what the hell do these functions do ?
Eddie
"Todd Kreuter" <tkreuter@dbvips.usa> wrote in message
news:440618C9.B4780E8A@dbvips.usa...
> Eddie Muniz wrote:
>
> Of course not. Comboboxes load their lists when the form opens and
> remain static until you tell them to update.
>
> --
> Todd Kreuter [dBVIPS]
| |
| Ken Mayer [dBVIPS] 2006-03-05, 8:27 pm |
| Eddie Muniz wrote:
> Todd I am aware of that, but according to the documentation I have read
> the REFRESHALWAYS method of the form is supposed to update controls when
> certain movements take place in the tables. Also FORM.REFRESH() is
> supposed to do the same of all controls on the form but manually, but
> neither one of those are working.
> Did I read something wrong ? If so what the hell do these functions do ?
The refresh options I believe you are thinking of deal with refreshing
the form's dataLinked controls. However, this does not refresh a
combobox's data*SOURCE* ...
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
| |
| Todd Kreuter 2006-03-05, 8:27 pm |
| Eddie Muniz wrote:
>
> Todd I am aware of that, but according to the documentation I have read
> the REFRESHALWAYS method of the form is supposed to update controls when
> certain movements take place in the tables. Also FORM.REFRESH() is
> supposed to do the same of all controls on the form but manually, but
> neither one of those are working.
> Did I read something wrong ? If so what the hell do these functions do ?
Is there something in your forms not updating besides the combobox
dropdownlists which as I explained will never automatically update
unless you tell it to? You make it sound like you are having some major
problems with something, but all you mentioned previously was the
combobox.
Those form methods are carryovers from prior versions when tables were
used in various work areas. As far as I know they do nothing when using
today's OODML
--
Todd Kreuter [dBVIPS]
| |
| Eddie Muniz 2006-03-05, 8:27 pm |
| Todd and Ken, Thanks for the response, I guess I understood incorrectly
about the controls being updated by the refresh methods. My comboboxes are
Datalinked and have a datasource as well, which is what is not updating. I
fugured if it updated the datalinked controls, since the comboboxes are
datalinked, that it would refresh the DATASOURCE property as well ???
I know how to fix it
***
Ongonfocus EVENT do the following
form.control.datasource = form.control.datasource
****
but not very elegant, I felt that Dbase would handle this with a method of
the form such as Refreshalways. Anyways any suggestions other that doing
things this way ?
Is this handled any better or different in db2K ??
I need to get over to the newer version, just cant seem to make enough time
to do it..
Eddie
"Ken Mayer [dBVIPS]" < dbase@_nospam_golden
stag.net> wrote in message
news:SWp9I8fPGHA.1152@news-server...
> Eddie Muniz wrote:
>
> The refresh options I believe you are thinking of deal with refreshing the
> form's dataLinked controls. However, this does not refresh a combobox's
> data*SOURCE* ...
>
> Ken
>
> --
> /(Opinions expressed are purely my own, not those of dataBased
> Intelligence, Inc.)/
>
> *Ken Mayer* [dBVIPS]
> /Golden Stag Productions/
> dBASE at goldenstag dot net
> http://www.goldenstag.net/dbase/dBASEBook.htm
> http://www.goldenstag.net/GSP
> http://www.goldenstag.net/dbase
| |
| Todd Kreuter 2006-03-05, 8:27 pm |
| Eddie Muniz wrote:
>
> Todd and Ken, Thanks for the response, I guess I understood incorrectly
> about the controls being updated by the refresh methods. My comboboxes are
> Datalinked and have a datasource as well, which is what is not updating. I
> fugured if it updated the datalinked controls, since the comboboxes are
> datalinked, that it would refresh the DATASOURCE property as well ???
Of course a dataLink and a dataSource are two very different animals.
One represents a single item (field value) from a specific table. The
other represents multiple items (as many as 65,000 plus for a single
combobox) from a variety of sources. I doubt it would be very efficent
to refresh a dataSource everytime you refresh a datalink.
Comboboxes are designed to be static, for a reason. Its a fairly simple
process to update their dataSource when we need.
--
Todd Kreuter [dBVIPS]
|
|
|
|
|