Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lock during async event?
#1
Using Registered Ultimate Intraweb 14.2.7 with Tokyo update 2.

I have a TIWEdit Async keypress event for when enter key is hit.

It takes the input and does some database magic and updates the screen,
and clears the edit box and sets focus back to it. Pretty simple deal.

Well depending on a few things that could be typed in there, the process it may kick off
could be 2-3 seconds maybe..  I'd like to when this condition is hit to lock the screen.

I keep finding things about IWLocker / and LockAsyncEvents ... I can't find much about IWLocker usage
directly, and LockAsyncEvents seems to be for a few specific usages.

So basically, how do I lock and unlock during these certain conditions?
Reply
#2
LockAsyncEvents is available for all async events of some specific IW component. You can enable or disable on a per-event basis. Isn't it exactly what you want?
Reply
#3
(03-26-2018, 10:05 PM)Alexandre Machado Wrote: LockAsyncEvents is available for all async events of some specific IW component. You can enable or disable on a per-event basis. Isn't it exactly what you want?

That is what I ended up using and just changing up some of my code to use the Exit event to do my major work and set the LockAsyncEvents to do this onExit.

I just thought there would be another way to trigger this off and on right in the middle of the code but for now this works I think.
Reply
#4
(03-27-2018, 12:30 AM)cpstevenc Wrote:
(03-26-2018, 10:05 PM)Alexandre Machado Wrote: LockAsyncEvents is available for all async events of some specific IW component. You can enable or disable on a per-event basis. Isn't it exactly what you want?

That is what I ended up using and just changing up some of my code to use the Exit event to do my major work and set the LockAsyncEvents to do this onExit.

I just thought there would be another way to trigger this off and on right in the middle of the code but for now this works I think.
I learn from these kinds of questions, so pardon my butting in but I don't think it can be done in the real world.  When I try to explain it myself I get a more solid picture myself (or I get corrected!).

Remember that the lock occurs on the client.  Your code is executing on the server.  When the client sends an async request the client has no way of knowing what went on in your code until the request returns. 

So, even if you change it off and on inside your code, the client doesn't know anything about it until the response returns.

Someone can correct me if I'm wrong.

Dan
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)