Ticket #1200 (closed defect: fixed)

Opened 3 years ago

Last modified 1 year ago

Incorrect event handling in ui.dPageFrameMixin.__onPageChanging

Reported by: JacekK Assigned to: somebody
Priority: major Milestone: 0.9.2
Component: ui Version: 0.9.1
Keywords: pageframe events Cc:

Description

I observed incorrect event handling in sample application created with the wizard.
On form where bizobj held no records (before requery), activation of subsequent pages should be disabled in result of PageFrame.beforePageChange code.
This doesn't happen and additionally changing page, e.g. from 2 to 1, always activates page 0 instead.
I think the problem is in ui.dPageFrameMixin.__onPageChanging event handler:
1) evt.GetSelection() method call always return current page, not the forthcoming page
2) when oldPageNum=oldPageNum=0, instead of page 0 remain active, forthcoming page is activated.

Attachments

dabodnpgf.swf (106.4 kB) - added by JacekK on 03/16/09 08:21:48.
Sample flash animation ilustrating essence of problem.

Change History

(follow-up: ↓ 2 ) 02/22/09 10:20:04 changed by ed

I'm not sure what the issue is here. If I'm on page 2 and then run a query that results in no records, and then try to click on any other page, I should be taken to page 0.

If there are no records and I'm on page 0, clicking on the other page tabs does nothing.

This is the expected behavior. What exactly are you seeing that is not consistent with this?

03/16/09 08:21:48 changed by JacekK

  • attachment dabodnpgf.swf added.

Sample flash animation ilustrating essence of problem.

(in reply to: ↑ 1 ) 03/16/09 08:41:06 changed by JacekK

  • milestone changed from 0.9 to 0.9.2.

Replying to ed:

If there are no records and I'm on page 0, clicking on the other page tabs does nothing.

As you see in animation, clicking on onther page than 0 with empty dataset activates clicked page instead. It's not a problem to me. Problem is that I can activate other pages with empty dataset and additionaly pages are always activated in sequence 0-1-0-2-0-1. In other words, I should be able to activate any page regardles of dataset state in sequence 0-1-2 or as you said, clicking shouldn't do nothing if dataset is empty.

07/19/09 06:46:25 changed by JacekK

Finally, in wx documentation I found the reason it doesn't work.
Excerpt from GetSelection? method documentation:
under Windows, GetSelection?() will return the same value as GetOldSelection?() when called from EVT_NOTEBOOK_PAGE_CHANGING handler and not the page which is going to be selected...

So, to provide real cross platform functionality you can't rely on this function and provide his own I think.

07/28/09 02:54:36 changed by JacekK

Although it didn't solve all problems, eg. New/Cancel user actions,
I think it will be better than current event handling, you may change
datanav.PageFrame?.PageFrameMixin?.beforePageChange method line from

if toPage != 0:

to

if fromPage == 0:

02/03/11 10:19:57 changed by paul

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in r6379.