Hi,
I wanted to use a dataset with three columns (first column is a read only one to show index number ). Is it possible to register an event like #rowSelectionChangeAllowed so that i can retain the selection of the row according to some conditions? I mean, something like that is already available? I have registered focusOut events for second and third column of the dataset, but the read only column does not trigger any events (when the row selection is changed using the first column, no events can be triggered). I tried using the change event of the selectionIndexHolder, to check when condition fails,setting the selection back to the previous selection. But the DataSetView considered it as a deselection because the old selection and the new selection being the same and in effect, there is no selection on the dataset. Can anyone suggest some work arounds? Thanks in advance, Mani _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Mani,
You can get the dataset to conditionally retain a row selection by wrapping the selectionIndexHolder with a PluggableAdaptor like this: vh := (PluggableAdaptor on: sil selectionIndexHolder) getBlock: [:m | m value ] putBlock: [:m :v | (Dialog confirm: 'Allow?') ifTrue: [m value: v] ] updateBlock: [:m :a :p | true ]. sil selectionIndexHolder: vh. When you use wrapping techniques it is sometimes important to know which layer you are dealing with and where dependencies get registered. I tested as shown and it worked right away for me, but you may need to vary it a little. For example, if you want the original value holder to have the application model as a dependent then you'd implement and use a method like this: SelectionInList>>_selectionIndexHolder: aValueModel selectionIndexHolder := aValueModel. Paul Baumann -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of mani kartha Sent: Thursday, August 08, 2013 01:17 To: [hidden email] Subject: [vwnc] DataSetView [VW 7.1] Hi, I wanted to use a dataset with three columns (first column is a read only one to show index number ). Is it possible to register an event like #rowSelectionChangeAllowed so that i can retain the selection of the row according to some conditions? I mean, something like that is already available? I have registered focusOut events for second and third column of the dataset, but the read only column does not trigger any events (when the row selection is changed using the first column, no events can be triggered). I tried using the change event of the selectionIndexHolder, to check when condition fails,setting the selection back to the previous selection. But the DataSetView considered it as a deselection because the old selection and the new selection being the same and in effect, there is no selection on the dataset. Can anyone suggest some work arounds? Thanks in advance, Mani _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc 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 |
Free forum by Nabble | Edit this page |