#19199: DATAVIEW_ITEM_EDITING_DONE DataViewEvent.GetValue() returns None/empty string

17 views
Skip to first unread message

wxTrac

unread,
Jun 13, 2021, 8:56:15 PM6/13/21
to wx-...@googlegroups.com
#19199: DATAVIEW_ITEM_EDITING_DONE DataViewEvent.GetValue() returns None/empty
string
-----------------------+--------------------
Reporter: chrisi-wx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxOSX | Version: 3.1.5
Keywords: | Blocked By:
Blocking: | Patch: 0
-----------------------+--------------------
Calling GetValue() on a DATAVIEW_ITEM_EDITING_DONE DataViewEvent returns
an empty string on OSX 10.11. This can be reproduced in the dataview
sample, second tab. Activate any row, second column and edit the string.
The log shows

wxDATAVIEW_ITEM_EDITING_DONE, new value

After "new value" the new value should have appeared.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19199>

wxTrac

unread,
Jun 14, 2021, 11:35:17 AM6/14/21
to wx-...@googlegroups.com
#19199: DATAVIEW_ITEM_EDITING_DONE DataViewEvent.GetValue() returns None/empty
string
------------------------+-------------------
Reporter: chrisi-wx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxOSX | Version: 3.1.5
Resolution: | Keywords:
Blocked By: | Blocking:
Patch: 0 |
------------------------+-------------------

Comment (by vadz):

We don't get the new value directly in `sendEditingDoneEvent:`
notification, and I don't know if it already can be retrieved from the
control itself or not. I.e. what do you get if you try to get the text of
the `item` (which is set in the event) from the control? If it's already
the new value, then we could provide it in the event itself, but if it's
still the old one, I'm afraid the only thing to do is to document that
this doesn't work (in this case getting the new value should still work if
done slightly later, i.e. using `CallAfter()`).

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19199#comment:1>

wxTrac

unread,
Jun 14, 2021, 3:16:54 PM6/14/21
to wx-...@googlegroups.com
#19199: DATAVIEW_ITEM_EDITING_DONE DataViewEvent.GetValue() returns None/empty
string
------------------------+-------------------
Reporter: chrisi-wx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxOSX | Version: 3.1.5
Resolution: | Keywords:
Blocked By: | Blocking:
Patch: 0 |
------------------------+-------------------
Changes (by chrisi-wx):

* cc: ckkart@… (added)


Comment:

The model associated with the control is not changed until the event
handler returns, so there is no way to check and possibly veto the new
value.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19199#comment:2>

wxTrac

unread,
Jun 14, 2021, 5:47:20 PM6/14/21
to wx-...@googlegroups.com
#19199: DATAVIEW_ITEM_EDITING_DONE DataViewEvent.GetValue() returns None/empty
string
------------------------+---------------------------------------
Reporter: chrisi-wx | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxOSX | Version: 3.1.5
Resolution: | Keywords: wxDataViewCtrl event veto
Blocked By: | Blocking:
Patch: 0 |
------------------------+---------------------------------------
Changes (by vadz):

* keywords: => wxDataViewCtrl event veto


Comment:

I have no idea how is vetoing changes supposed to work at Cocoa level, it
looks like `sendEditingDoneEvent:` doesn't allow this, but I don't know
what does. Maybe we need to postpone sending this event inside wx itself
until the control is updated and then undo the change if the event is
vetoed -- this is going to look ugly, but still better than not supporting
this at all, I think.

--
Ticket URL: <https://trac.wxwidgets.org/ticket/19199#comment:3>
Reply all
Reply to author
Forward
0 new messages