Hi,
I need to use a scenario like this:
I don't want to constantly send entered data to the screen, using Input's OnChange event. Let's assume that these data are not validated - using OnChange would produce unnecessary net traffic. Therefore I need to be able to explicitly ask the webblock for the user's data.
It was easy in OS 10:
It works perfectly and synchronously (refresh webblock -> get its data -> refresh another webblock -> get its data -> store all to the database; all this as a sequence in a single button's handler).
Now the Notify action is deprecated so I don't want to use it. I should use Events instead of Notify. But - I can't use Event in Preparation: I'm not allowed, I can't drop an Event on Preparation.
I've found a hint. how to invoke a webblock's event from a screen:
OK, it works. But with some difference: it is asynchronous. I mean that the handler of the screen button must end before the webbloks button is clicked. And this makes this technique in my scenario useless.
Any idea?
Regards
Tomasz
I think I don't like this approach, but it works...See the attached OML.
Cheers.
Thanks but it is still asynchronous. The "Ask data" handler must end before the screen gets the webblock's data. So the problem remains unsolved.
Tomasz.
Hi,Why not store that data on a session variable? It would sort of work the same way the notify works, you would be storing a single string into a variable. I'm not sure its ideal, but it might be better then using js and an hidden button to do the trick.Regards,Jose
Thomasz,
You can move the logic required to process the data from the web block to the Event Handler.
So, what is the problem of being asynchronous? Could you provide some light on this requirement?
@Jose: when using session variables I would have to create many variables. Maintaining them would be painful. And look at use case when I have a dynamic set of WebBlocks on my screen... some nightmare.
@Eduardo: consider a button on the screen that is to store all the data to the database. Previously it was simple: get data from webblock1 -> get data from webblock2 -> store all to the database. All in a single screen action - a handler of this button's click. Now this handler can only fire requests to webblocks. And what about storing data? At the end of the last webblocks' event? Who can guarantee which would be the last one? Another nightmare.