Issue 14703 - (form) control event behaviour changed
Summary: (form) control event behaviour changed
Status: CLOSED FIXED
Alias: None
Product: gsl
Classification: Code
Component: code (show other issues)
Version: OOo 1.1 Beta2
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 1.1 RC
Assignee: berend.cornelius
QA Contact: issues@gsl
URL:
Keywords:
: 14565 (view as issue list)
Depends on:
Blocks:
 
Reported: 2003-05-21 12:23 UTC by Frank Schönheit
Modified: 2003-07-25 09:39 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
bugdoc showing changed behaviour of radio buttons, list boxes, and text fields (7.53 KB, application/octet-stream)
2003-05-21 12:24 UTC, Frank Schönheit
no flags Details
new bugdoc, including check boxes now, and with improved logging of the events (8.41 KB, application/octet-stream)
2003-05-21 14:21 UTC, Frank Schönheit
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Frank Schönheit 2003-05-21 12:23:24 UTC
between 1.0 and 1.1 Beta (2), the conditions how events are fired by form
controls (I strongly suspect that it also affects basic controls) has changed.

Specifically, it seems that nowadays listeners are called when the data of a
control is changed by using the UNO API. E.g., the "textChanged" listener of an
edit control is called when the text is changed from within a Basic script.
Similarily, the itemStateChanged listener for list boxes as well as radio
buttons is called when the state is changed from within a Basic script. I bet
something similar holds for checkboxes, combo boxes, etc (didn't try everything).
All of this wasn't the case in 1.0.x.

This is potentially (extremly) bad for existing solutions based on the old
behaviour. Finally, we are destabilizing our API with this. If people can't rely
on our UNO API being stable, they won't accept it.

I'll attach a bugdoc showing the changed behaviour.
Comment 1 Frank Schönheit 2003-05-21 12:24:07 UTC
Created attachment 6316 [details]
bugdoc showing changed behaviour of radio buttons, list boxes, and text fields
Comment 2 Frank Schönheit 2003-05-21 12:29:49 UTC
Targeting. I know that "OOo 1.1 RC" sounds hard, but I strictly
believe that our UNO API should be stable (even if we talk about
deprecated interfaces and services).

I heard about customers (small companies) where people created
applications based on forms, written in Basic, with 2000+ lines of
code. This is a huge amount of work invested, and such customers will
definately not be happy if we tell them that they have to change their
implementations, again.
Comment 3 frank 2003-05-21 14:03:05 UTC
Please have a look at internal ID #109809# this is definitly a must
for RC.

Frank
Comment 4 Frank Schönheit 2003-05-21 14:21:57 UTC
Created attachment 6317 [details]
new bugdoc, including check boxes now, and with improved logging of the events
Comment 5 malte_timmermann 2003-05-21 16:07:27 UTC
Events are also coming in 6.0 when using awt functions.
Only difference now is that events are also triggered when changing 
properties in the model, I think this is the only thing we should 
change.

To do this, I suggest the following:

When a property changed, the peers are only updated via 
VCLXWindowPeer::setProperty().
Only in this case we shouldn't fire awt events.
Use a counter at start/end of setProperty() for bBlockAWTEvents.

I think it's OK to block all events in 
IMPL_LINK( VCLXWindow, WindowEventListener, VclSimpleEvent*, pEvent )
, but only these should be the important events:

VCLEVENT_RADIOBUTTON_TOGGLE
VCLEVENT_CHECKBOX_TOGGLE
VCLEVENT_LISTBOX_SELECT
VCLEVENT_EDIT_MODIFY
Comment 6 malte_timmermann 2003-05-21 17:49:50 UTC
MT->FS: You offered to do that :)
Comment 7 Frank Schönheit 2003-05-22 10:18:12 UTC
accepting
Comment 8 Frank Schönheit 2003-05-22 16:00:12 UTC
some comments on the bugdoc (the second version I attached) and what I
think needs to be changed. There are 4 control sections in the bug
doc, which all demonstrate differences between events in 1.0 and
events in 1.1.

radio buttons
=============
in the first section, there are three radio buttons forming a group.
For every radio button, the "item state changed" event is knitted to
the "radioClicked" function. When the third button is selected, this
is rejected, and the selection is moved back to th first button.

1.0:
In 1.0, selecting a single button results in _1_ call to the macro (as
you can see in the tracing window). When the basic macro selects the
first radio (because the user selected the third one which is
forbidden), this did _not_ trigger the macro, again.

1.1:
Selecting a button results in two calls: one for the radio being
deselected, and one for the radio being selected.
Selecting the third button (prohibited) resulted in the 2 calls
mentioned, and in two additional calls when the macro resets the
selection to the first radio.


text field
==========

In the second section, there is a text field. a macro is bound to the
"text changed" event. The field allows inputs with up to 5 characters
- if a sixth character is entered, then the macro resets the text of
the field to the last known valid text.
(I know that this particular scenario - input length restriction via
macro - is rather senseless, because the same can be reached with the
integrated "max text length" property of the field. But you could
imagine more sophisticated checks of the input, realized via macro)

1.0:
Entering one character calls the listener once. Entering the sixth
character also calls the listener exactly once. Resetting the text
from within the macro does _not_ call the listener.

1.1:
Nearly the same, except that resetting the text from within the macro
_does_ call the listener.


listbox
=======

In the third section, there is a listbox, containing 5 entries, an
"separator entry" (consisting of "-"'s only), and another entry
(5+1+1, alltogether :). A macro is bound to the "item status changed"
event of the list box. It checks if the separator entry has been
chosen by the user, and if so, it resets the selection to the last
valid selection.

1.0:
In 1.0, selecting an entry (either by mouse or by keyboard) triggers
the macro exactly once. Resetting the entry from within the macro does
_not_ trigger the macro.

1.1:
Nearly the same, except that resetting the entry from within the macro
_does_ trigger the macro.


checkbox
========

In the forth section, there is a checkbox, whichs item state changed
method is bound to a macro which simply traces that it has been
called. Additionally, there is a button, which, when clicked, switches
the state of the checkbox.

1.0:
Only the explicit user interactions on the checkbox call the macro

1.1:
When clicking the button, and thus changing the checkbox state from
within Basic, this also results in the checkbox-macro being called.
Comment 9 Frank Schönheit 2003-05-22 16:03:32 UTC
I think all of the 4 scenarios above describe valid situations, where
we can expect macros which use them to exist. Thus, we should restored
the situation from 1.0, even if this means more unlogical or
inconsistent to other APIs or whatever - I think consistence with the
1.0 behaviour counts more here.
Comment 10 Frank Schönheit 2003-05-23 16:23:14 UTC
*** Issue 14565 has been marked as a duplicate of this issue. ***
Comment 11 Frank Schönheit 2003-05-23 16:38:37 UTC
fs->bc: I did a fix in the toolkit project, and built a new
installation set for the CWS dba07. Please adjust your auto pilots,
and remove the hacks you had to do when the original behaviour change
was introduced.
Comment 12 berend.cornelius 2003-05-26 12:09:08 UTC
I adapted the form autopilot and report autopilot accordingly. The
other autopilots (web-, euro autopilot and document converter) work
fine as before.
Comment 13 Frank Schönheit 2003-06-02 12:53:44 UTC
verified in dba07
Comment 14 berend.cornelius 2003-07-25 09:39:47 UTC
BC: verified in the master->bug closed