Raise Event (Magic xpa 4.x)
Usually, Magic xpa can tell where a Raise Event will be handled. For instance, in this example, the event is handled in this task. The handler for F12 is Neutral, and has the Propagate property set to No, so the Raise Event is also Neutral.
However, if the handler for F12 is server-side, then the Raise Event will also be server-side. That forces our F11 handler to also be server-side.
In this example, however, there is no handler for the F12 event in this task. If the Studio cannot determine where the Raise Event will be handled at Runtime, it is marked Unknown. This happens when:
-
The event's handler is in a different task. It is not possible during the development stage to know which task will handle the event during runtime. It depends largely on the runtime tree.
-
The handler of the event in the current task has a Propagate property of Yes. Once again, it is not possible during the development stage to know which task will handle the event during runtime. This also depends largely on the runtime tree.
|
-
If a Raise Event operation with Wait = No is part of a sequence of server-side operations, it will be performed after all of the events, so it is considered to be Neutral (because it does not cause immediate access to either side).
-
When a server operation sequence contains a Raise Event that is unknown, an error may occur in runtime.
|
Task Prefix is always executed on the server.
If you enter a client-side operation in the Task Prefix, this will generate an error:
Server-side handler cannot contain client-side operations. You can set the Wait property to No to execute this operation after the Task Prefix operations.
The only way you can have a client-side operation is to set to Wait=No. Then, after all the rest of the Task Prefix operations have been executed, the operation will be executed, when control returns to the client.
If an Unknown-side operation is in Task Prefix, you will get a warning:
Note that if an Unknown-side operation is defined on the server handler and is evaluated to a client-sideat runtime, an error will occur.
At that point it is up to you to ensure that the Unknown-side operation is really server-side.
However, if you set the Raise Events to Wait=No, then the issues go away. The client-side events will be raised on the client, after the server-side events have been raised on the server.