Ticket #350 (closed defect: fixed)

Opened 18 months ago

Last modified 17 months ago

WFSFilterBuilder - filter blur problem on tab switching

Reported by: cdeschenes Owned by: cdeschenes
Priority: minor Milestone: 1.2.0
Component: widgets Version:
Keywords: tab, filters, focus Cc: adube, belug

Description

When user define a filter and click directly to result tab, the value of filter textfield having focus is'nt updated until he loose focus. The result of this defect is that result list ignore last change in filters when result list is triguered by tabs change.

Attachments

patch-wfsfilterbuilder-filterfocus-350-r1177-A0.diff Download (0.9 KB) - added by cdeschenes 18 months ago.
a fix that give focus to submit button just before switch tab
wfsfilterbuilder-IEBUG-350-r1258-A1.diff Download (0.7 KB) - added by belug 17 months ago.

Change History

Changed 18 months ago by cdeschenes

a fix that give focus to submit button just before switch tab

Changed 18 months ago by adube

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

Fixed in r1199.

Changed 18 months ago by cdeschenes

  • status changed from closed to reopened
  • resolution fixed deleted

Need another fix because current fix don't work with Internet Explorer

Changed 18 months ago by adube

cdeschenes, can you provide a new fix for 1.2 ?

Changed 18 months ago by cdeschenes

The "beforeTabChange" event don't seem to be executed before in Internet explorer. This issue explain the problem with my fix (in other browser, the focus is removed just before sending the request on tab change, in IE the focus is removed just after sending request and this is the reason because we have this issue in IE)

I thought to change the field onChange event listener for onKeyUp ... but I'm not sure that is the best way to fix the problem.

Changed 18 months ago by cdeschenes

I also thought to directly fire the change event of the field when tabChange but, I'm not sure that this will fix the probleme because this event seem to have an issue in IE.

I'm not sure I can do fix for now...

Changed 17 months ago by belug

  • cc belug added

I have a proposition it's not user friendly but it would work. In IE, since it's the only one where it's broken, we could force the use of the apply filter button by deactivating the tab.

The deactivation of the tab has to be set too when selecting back the first tab, this could also be done on the first change of a filter option.

It would be working normaly in any browsers except IE where the events are broken.

What do you think?

Changed 17 months ago by adube

I don't really like the idea of having a different behavior for IE.

Here's something else : how about we use the "beforeTabChange" event, check whatever has focus and force it to loose it first.

How about it ?

Changed 17 months ago by belug

After looking more into it, it's not that the event is not fired, it's that a lot of events are fired in the same time and in IE the request start before the change event has finished.

I added an alert in beforeTabChange and with the delay this add, everything is ok.

The problem is, once again, the javascript asynchrone way of doing things.. but for this time it's only in IE. I'll check if a can add a litte delay somewhere...

Changed 17 months ago by belug

Here i have a small not intrusive solution that keep he same behavior in each browsers. But it's not something I like to do, but sometimes it has to be used.

In WFSFilterBuilderButton.js line 286 i have changed this :

activate: {
   fn: function() {
       if(this.wfsFilterBuilderButton.autoFilter)
           this.doFilter()
   },
   scope: this.filterBuilderSelector
}

For this :

activate: {
   fn: function() {
       if(this.wfsFilterBuilderButton.autoFilter)
           Ext.defer(this.doFilter, 50, this);
   },
   scope: this.filterBuilderSelector
}

The little delay that is added allow the filter to be stored correctly before being applied.

So is it ok like that?

Changed 17 months ago by adube

I agree with the proposed solution. I won't say I like it very much either, but sometimes "The Dark Side is more quick, more attractive".

You can send a patch and I'll apply it. Thanks a lot.

Changed 17 months ago by belug

Changed 17 months ago by belug

Here's the patch file of the code described previusly.

Changed 17 months ago by adube

  • status changed from reopened to closed
  • resolution set to fixed

Fixed in r1260.

Note: See TracTickets for help on using tickets.