Discussion:
onChangeCommitted
(too old to reply)
Frank J. Polan
2008-11-07 23:48:58 UTC
Permalink
Does the combobox onChangeCommitted actually work.

I'm trying to find a way to fire the onChange event for the first row
in the combobox without adding a dummy first selection

Thanks

Frank Polan
Ken Mayer [dBVIPS]
2008-11-08 00:32:08 UTC
Permalink
Post by Frank J. Polan
Does the combobox onChangeCommitted actually work.
I'm trying to find a way to fire the onChange event for the first row
in the combobox without adding a dummy first selection
Based on the help for this event:

--------------------
onChangeCommitted will fire in the following cases:

Left click on an item in the listbox (all styles) when the item is
different from the current ComboBox value.
Press Enter with an item highlighted in the dropdown list for a style 1
or 2 ComboBox (or a style 0 or 1 columnComboBox) when the item is
different from the current ComboBox value.
For style 0 or for style 1 or 2 ComboBox (with the dropdown list
closed) (or a style 0 or 1 columnComboBox), press the Up Arrow, Down
Arrow, PgUp, or PgDn keys.

Left click on the ComboBox button for a style 1 or 2 ComboBox (or a
style 0 or 1 columnComboBox) when the dropdown list is open and the
highlighted item in the dropdown list is different from the current
ComboBox value.

onChangeCommitted() will not fire for a style 1 or 2 ComboBox (or a
style 0 or 1 columnComboBox) when the dropdown list is open and the Up
Arrow, Down Arrow, PgUp, or PgDn keys are pressed. (Note that this is
different from the onChange() event which does fire in these cases).

onChangeCommitted() fires only after the ComboBox's value property has
been updated with the selected value.

When the dropdown list closes, either onChangeCommitted will fire or
onChangeCancel will fire, not both.

--------------------

It most likely depends on the Combobox Style, and how you're selecting
the value ...

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/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
Frank J. Polan
2008-11-08 14:55:09 UTC
Permalink
Ken,

I read all that before I posted - maybe I just don't understand it<g>
After rereading it again - several times actually, I don't see much
that's different from the onChange

So I guess it's not possible to initiate a combobox action from the
first item in the datasource - it needs a Dummy entry

Thanks

Frank Polan


On Fri, 07 Nov 2008 16:32:08 -0800, "Ken Mayer [dBVIPS]"
Post by Ken Mayer [dBVIPS]
Post by Frank J. Polan
Does the combobox onChangeCommitted actually work.
I'm trying to find a way to fire the onChange event for the first row
in the combobox without adding a dummy first selection
--------------------
Left click on an item in the listbox (all styles) when the item is
different from the current ComboBox value.
Press Enter with an item highlighted in the dropdown list for a style 1
or 2 ComboBox (or a style 0 or 1 columnComboBox) when the item is
different from the current ComboBox value.
For style 0 or for style 1 or 2 ComboBox (with the dropdown list
closed) (or a style 0 or 1 columnComboBox), press the Up Arrow, Down
Arrow, PgUp, or PgDn keys.
Left click on the ComboBox button for a style 1 or 2 ComboBox (or a
style 0 or 1 columnComboBox) when the dropdown list is open and the
highlighted item in the dropdown list is different from the current
ComboBox value.
onChangeCommitted() will not fire for a style 1 or 2 ComboBox (or a
style 0 or 1 columnComboBox) when the dropdown list is open and the Up
Arrow, Down Arrow, PgUp, or PgDn keys are pressed. (Note that this is
different from the onChange() event which does fire in these cases).
onChangeCommitted() fires only after the ComboBox's value property has
been updated with the selected value.
When the dropdown list closes, either onChangeCommitted will fire or
onChangeCancel will fire, not both.
--------------------
It most likely depends on the Combobox Style, and how you're selecting
the value ...
Ken
Ken Mayer [dBVIPS]
2008-11-08 17:06:27 UTC
Permalink
Post by Frank J. Polan
Ken,
I read all that before I posted - maybe I just don't understand it<g>
After rereading it again - several times actually, I don't see much
that's different from the onChange
So I guess it's not possible to initiate a combobox action from the
first item in the datasource - it needs a Dummy entry
It's a bit confusing. I am not sure I see a need for the new event
handler, but ... if nothing else, when the form first loads, just call
the combobox's onChange event handler:

form.MyCombobox.onChange()

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/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
Frank J. Polan
2008-11-08 17:25:32 UTC
Permalink
Ken,

Normally I would do that but in this instance it's not feasible - I'll
put in a dummy first item

Thanks

Frank Polan

On Sat, 08 Nov 2008 09:06:27 -0800, "Ken Mayer [dBVIPS]"
Post by Ken Mayer [dBVIPS]
Post by Frank J. Polan
Ken,
I read all that before I posted - maybe I just don't understand it<g>
After rereading it again - several times actually, I don't see much
that's different from the onChange
So I guess it's not possible to initiate a combobox action from the
first item in the datasource - it needs a Dummy entry
It's a bit confusing. I am not sure I see a need for the new event
handler, but ... if nothing else, when the form first loads, just call
form.MyCombobox.onChange()
Ken
Ken Mayer [dBVIPS]
2008-11-09 15:53:38 UTC
Permalink
Post by Frank J. Polan
Ken,
Normally I would do that but in this instance it's not feasible - I'll
put in a dummy first item
Ah. Well, sometimes that is the way to go. I have a filter routine that
I use that has at the top "No Option Selected" (or words to that
effect), then I pull data from there. I use an array, load the first
option, load the rest from the lookup table, and go ...

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/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
Bruce Beacham
2008-11-10 10:14:08 UTC
Permalink
Post by Frank J. Polan
Ken,
I read all that before I posted - maybe I just don't understand it<g>
After rereading it again - several times actually, I don't see much
that's different from the onChange
I have reported this but I don't know if it's been acted on:

"I'm maybe going over old ground, but it seems to me that the onChange
of the combobox is not firing when it should when there's a lookuprowset
on the datalinked field.

In the code below, click the dropdown button and slowly roll the pointer
down the list. I would expect the onChange to fire repeatedly as the
pointer changes the highlighted item, but it is only when I make a
selection that the onChange - and of course the onChangeCommitted - does
fire, and then only once."


Also this:

"Run the code [given in the original post] and click the drop down.
Use the down arrow to move the selection one row, to Clown Triggerfish.
Nothing appears in the Results Pane. But it should, by virtue of
the onChange code.

If you now click the Next navigation button to save that data and move
to the next row in the rowset, and then move back, you will see that the
selection of Clown Triggerfish has not been saved. This only happens
if one selects the first row of the lookuprowset, and one doesn't first
go any lower in the list."


So, IMO there is something not as it should be with the first row in a
combobox.


Bruce Beacham
Frank J. Polan
2008-11-10 13:28:17 UTC
Permalink
Bruce

Thanks for the confirmation that something seems wrong

Frank Polan

On Mon, 10 Nov 2008 10:14:08 +0000, Bruce Beacham
Post by Bruce Beacham
Post by Frank J. Polan
Ken,
I read all that before I posted - maybe I just don't understand it<g>
After rereading it again - several times actually, I don't see much
that's different from the onChange
"I'm maybe going over old ground, but it seems to me that the onChange
of the combobox is not firing when it should when there's a lookuprowset
on the datalinked field.
In the code below, click the dropdown button and slowly roll the pointer
down the list. I would expect the onChange to fire repeatedly as the
pointer changes the highlighted item, but it is only when I make a
selection that the onChange - and of course the onChangeCommitted - does
fire, and then only once."
"Run the code [given in the original post] and click the drop down.
Use the down arrow to move the selection one row, to Clown Triggerfish.
Nothing appears in the Results Pane. But it should, by virtue of
the onChange code.
If you now click the Next navigation button to save that data and move
to the next row in the rowset, and then move back, you will see that the
selection of Clown Triggerfish has not been saved. This only happens
if one selects the first row of the lookuprowset, and one doesn't first
go any lower in the list."
So, IMO there is something not as it should be with the first row in a
combobox.
Bruce Beacham
Loading...