on 08-22-2007 10:20 AM
Hi all,
I understood the concept of action,it is if we create action and assign it to any UI element ,then in "onactionmethod",we will write the required code.....,
but I am not able to understand the concept of event.
what is event?how does it work?how to handle it?
wdThis.wdFireEvent<eventname>;
if we write this piece of code ,where the control goes and what happens?
Thanks in advance.
Hi,
the Events are neccessary for example calling a method of a View from the Component Controller.
You can do that by creating an Event on the Controller, and creating an Event Handler
int the Method Tab of the view. In the Eventhandler you can select the Event that should
be listened to.
Now if you fire th event on the controller like this: wdThis.wdFireEvent<eventname>;
The according eventhandler will be executed in the view.
Hope this helps,
Regards,
Dennis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dennis,
Thanks for the info but i am not totally clear,still I have some doubts...,
If we created one event in any controller,How can we know that how many eventhandler methods in different views subscribed to this event?Is there any option for that?
And also what is the difference between onactionmethod and this fireeventmethod?
The onAction Eventhandler only take care of Buttons or other UI Elements.
You can't know how many are suscribed as far as I think.
But normally it doesn't matter. the Eventhandler are only waiting for that Event if they are active.
But I also would say that it is the best to create for each action you want to map from the controller to the view, you should create an own event. It only make sense to have one event for more views if you know that they will not be displayed togehter and it will do similar things.
Events are also really helpful when you have more than one DC and what to trigger an action from the child component to the master component.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.