03-29-2018, 07:24 PM
(03-29-2018, 04:14 AM)davenovo Wrote: The other feature I am looking for is how to make the modal dialog blocking. For example, in a VCL application I can write
result:=InputQuery(a,b,c)
or better yet I can have my own form with an .Execute method, and the Execute method calls showModal and does not return until the modalResult is set.
and the code wont continue until the user presses ok or cancel on dialog.
The examples I have seen launch the modal dialog in some button click, but then continues processing in the OnClose of the modal window. However, it is annoying to have to code that way, i.e. have to continue processing in another method from the one that generated the dialog.
Is there a way to mimic the standard modal dialog approach of the VCL with intraweb? Especially when I have custom search dialogs etc where I want to do something like
if SeachParamsForm.Execute then
begin
// get the search criteria from the form
//execute the search
end
Like calling a modal query (a la "Abort, Retry, Cancel") then return and continue the original code with the response. I've been calling that "code modal" myself (I don't know why but it seemed to fit).
Unfortunately, that's not going to happen in a web environment like this anytime soon. The trouble is that you'd have to save the session state, run off and do the modal code, then come back (many independent threads later) and return session state. On a client application, you just push that stuff on a stack and pop it off again.
In a web environment like this, the mechanisms just aren't built in (or easy to reproduce). It's not technically impossible, but it's very difficult to do without breaking a lot of stuff. Worse, once you put that in then you've made future enhancements a minefield as well.
That said, we have our own application scripting language and did reproduce that kind of behavior in our script. It was a real PITA, but when you write the scripting engine you can manage what it does. Did I mention that it was a PITA?
Dan

