NetTalk Central

Author Topic: Suggestion: allow hooking for busy.  (Read 5264 times)

random69

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
Suggestion: allow hooking for busy.
« on: January 28, 2009, 01:41:31 PM »
Hi,

I have a few browses that take a few seconds to "refresh" when using the buttons (first/last/next) and some other reset controls (from a form). The busy indicator does show, however, it's in the lower right - IMO, bad place since the user doesn't know what's going on and isn't paying attention there. Plus they can do other things.

I need to hook in my own busy handling that disables the form and shows a more pronounced "please wait". I noticed the js call for showbusy, and where it gets hidden (in the GreenAll function). I've done this in my own forms, just now ones that are nt template driven.

I can probably hook in my own function for showbusy, but not really for GreenAll unless I replace the function.

Please consider taking the code within GreenAll() to hide the busy graphic to a separate function. Perhaps hidebusy?

I will booger up the nettalk code for now, but hate to do that.

I'm on 4.31 pr28.

Thanks.




Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Suggestion: allow hooking for busy.
« Reply #1 on: January 28, 2009, 11:19:10 PM »
Hi,

I've moved that code into it's own function for PR30 as you suggest.

Incidentally the location of the graphic is governed by CSS, so you can change it if you like.

cheers
Bruce

random69

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
Re: Suggestion: allow hooking for busy.
« Reply #2 on: January 30, 2009, 09:38:40 AM »
Hi Bruce, thanks for the changes! Help quite a bit...

Ok. Now this works great when I use the sort header on the browse. Calls browseTable.sort, which calls browseTable.sv and calls browseTable.showbusy. Then hidebusy gets called when the response is returned.

HOWEVER, I'm using a form with fields that reset the browse below it (filtering mechanism). The problem here is that each field's onchange event calls sv - which of course does not call showbusy. OK, so I add javascript code in the template for that field's onchange to show the busy manually. Now the sv call gets overwritten with my own onchange code plus nextfocus() call. Now this does not call sv, which of course, doesn't do a ajax request, thereby just not working.

I'm also wondering why you have showbusy within an object, whereas hidebusy outside it. There should only be one element for busy, regardless of the number of browses on a page.

Perhaps this can be moved out of the object. And then the call to showbusy within the public sv call. You could also delay showbusy with a timer - no response after .5 to 1 second - call showbusy. For those really quick requests, don't show it.

Another option is to prepend the template set onchange code for the field to the existing code you generate instead of replacing it.

For now, I'm going to try a few things - all of which require changes to nettalk source at some point.

Thanks!

Hi,

I've moved that code into it's own function for PR30 as you suggest.

Incidentally the location of the graphic is governed by CSS, so you can change it if you like.

cheers
Bruce

random69

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
Re: Suggestion: allow hooking for busy.
« Reply #3 on: January 30, 2009, 11:08:39 AM »
I just moved showbusy out of the object, added a call to it within browseTable, and within the global sv function (all.js).

Works like a champ for what I need. Added some free modal dialog scripts, and now I have a "Please Wait..." show up along with disabling the page. I've got some filters that could take many seconds to process (specialized sort orders too) - that's why the need (a busy indicator image just didn't work for me).

Whatever later on that will work similarly and easy to implement - that would be cool. (Probably the prepending the template-entered javascript).

Thanks for whatever you can - appreciate all the hard work into this product.

Cheers!