Scenario: I have a Delphi Intraweb application that has some edit components and buttons on a screen. In the TIWEdit.OnAsyncExit and TIWButton.OnClick a flag is set, and another thread in the application sets the enabled properties of the buttons depending on the flags and some other application data.
By the time the TIWButton.Enabled properties are set, the request has already finished and the next interaction is cancelled as IW finds out that internal representation and HTML form are out of sync. It resynchonizes and you have to click again.
I would like to refresh the screen somehow on demand.
- A timer that finds out whether the two are synchronized and issues a refresh has drawbacks in traffic and timing (I can click a button before a timer run).
- A method that could push data would be great.
- Maybe IW has a possibility to do an non-save sync without cancelling the action I just committed.
As my screens are built model driven (I cannot predict what components will be on the screen and what the interdependencies between components are, that is in the business logic), I cannot add JavaScript to enable or disable a button depending on user actions.
I am not completely sure if your question is the same as mine, yet I think there is a lot in common. See the demo project (v2) I posted in the Intraweb forum.
Based on some comments from Jackson Gomes I enable a TIWTimer before a long running thread starts and disable this after the thread has ended. See: http://forums3.atozed.com/IntraWeb.aspx (atozedsoftware.intraweb.attachments), thread 'IWLabel update via Thread', Oct 15, 2009.
The OnASync timer event is fired every 500 ms and is using some bandwith. Acceptable in my situation (company intranet).
Gert