[vwnc] valueChangeSelector: and requestValueChangeSelector: events from column sort

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] valueChangeSelector: and requestValueChangeSelector: events from column sort

Paul Baumann
This seems like a VW bug, but I'd like to know what others think...
 
A DataSet contains column definitions that can be configured to handle the events #valueChangeSelector: and #requestValueChangeSelector:. Application code would commonly declare a handler to detect when data values are changed. We use #requestValueChangeSelector: to determine if edited values are valid. We use #valueChangeSelector: to apply and record history for the change. It turned out, those handlers were related to some curious behavior that we'd experienced for years.
 
In short, those handlers are invoked not just for changes to domain objects through the column editor, but also when pressing the column header button to sort the column. Changes were being announced at an application level when there were none. Over the years there were probably a dozen variations of side effects from these problems--most were avoided with nil checks when selections had no reason to be nil. A workaround to the root problem is to type-check the controller that is passed, but it seems like this just might be a VW bug (at least from an application perspective).
 
It seems that if the column is sort enabled then clicking on the column header button should not announce a value change.
 
The parcel in the attached file demonstrates the problem. Just load it and execute " PlbDemoSortChangeEventView open".
 
Thanks,
 
Paul Baumann 
 


This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

PlbDemoSortChangeEventProblem.zip (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: valueChangeSelector: and requestValueChangeSelector: events from column sort

Paul Baumann

Here is a change to VisualWorks code to fix the problem.

 

DataSetColumn>>labelAsButton

                "Returns a cached button widget that is capable of displaying the label for the column"

 

                ^labelAsButton isNil

                                ifTrue:

                                                [| button |

                                                button := (self realize: labelAsButtonSpec) widget.         

                                                "<ICE Modification>"

                                                                "This avoids having a column sort get announced through column callbacks

                                                                (requestFocusInSelector: requestValueChangeSelector: valueChangeSelector:)

                                                                as a #value change. This is very important. plb 2011.07.19 "

                                                                self allowSorting ifTrue: [

                                                                                button container component controller

                                                                                                setDispatcher: UIDispatcher vacuousDispatcher.

                                                                ].

                                                "<\ICE Modification>"

                                                "The following will force the button to redisplay via invalidation when it is pressed"

                                                button widgetState isOccluded: true.

                                                labelAsButton := BoundedWrapper on: button]

                                ifFalse: [labelAsButton]

 

 

Paul Baumann

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Paul Baumann
Sent: Wednesday, March 04, 2009 15:20
To: VWNC
Subject: [vwnc] valueChangeSelector: and requestValueChangeSelector: events from column sort

 

This seems like a VW bug, but I'd like to know what others think...

 

A DataSet contains column definitions that can be configured to handle the events #valueChangeSelector: and #requestValueChangeSelector:. Application code would commonly declare a handler to detect when data values are changed. We use #requestValueChangeSelector: to determine if edited values are valid. We use #valueChangeSelector: to apply and record history for the change. It turned out, those handlers were related to some curious behavior that we'd experienced for years.

 

In short, those handlers are invoked not just for changes to domain objects through the column editor, but also when pressing the column header button to sort the column. Changes were being announced at an application level when there were none. Over the years there were probably a dozen variations of side effects from these problems--most were avoided with nil checks when selections had no reason to be nil. A workaround to the root problem is to type-check the controller that is passed, but it seems like this just might be a VW bug (at least from an application perspective).

 

It seems that if the column is sort enabled then clicking on the column header button should not announce a value change.

 

The parcel in the attached file demonstrates the problem. Just load it and execute " PlbDemoSortChangeEventView open".

 

Thanks,

 

Paul Baumann 

 

 


This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.



This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc