Output: Deprecated: The FuseJS/UserEvents `Raise` function is deprecated. Use the `object.raise` on a named event instead. in Fuse.Scripting.V8.Context</usr/local/share/uno/Packages/FuseJS/0.32.8/$.uno:661>
We have to be defining them in this new way:
UX:
<UserEvent ux:Name="NumberBack"/>
JavaScript:
NumberBack.raise();
Isn’t this limiting us? In my case I have bundled backend.js file which contains my app utility functions. For example my makeHttpRequest function is in this .js file and whenever an error returns or occurs in this function I want to show the error in a dialog. Since bundled .js file doesn’t know anything about the UX, the only thing that came to my mind was to raise an event that will be handled by the listening UX code. But since I can’t use events by “name” with Event.raise, I don’t know how to notify UX without knowing anything about UX.
Should I be using another mechanism to communicate from bundled JS to UX? How can this be achieved?
Anders, I understand your solution and I might use it but to be honest, I wouldn’t think of passing UX elements to a bundled JS module
edA-qa, I understand what you mean but I can’t figure out how to create and raise a pure JS event in my JS module. All the events I’ve used in JS were related to DOM elements and I tried to look up a little bit more and couldn’t find a solution. Can you give me a small example?