on 07-23-2007 8:58 AM
Hello,
I defined an even onUpdate in the component controller. A custom controller subscribed to this event. For that I have a method handleOnUpdate in the custom controller. Now I want to raise this event in a view after pressing a submit button of this view.
How can I raise the event?
So data flow would be:
1. Button pressed in view
2. Raise event in component controller
3. Handle raised event in custom controller
Regards
Rene
I solved it now.
I added the following method in comp. ctrl:
public void fireOnUpdate( )
{
//@@begin fireOnUpdate()
wdThis.wdFireEventOnUpdate();
//@@end
}
This method is called by the view controller after a button action.
The custom controller subscribed to the comp. ctrl. event and is executed. I got some code in the custom controller and the custom controller raises an event by itself. To this event another view subscribed. The other view has to be active (default = true) else it wont handle the raised event.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rene,
Your scenario is like:
<b>View: OnSubmit -> Component Controller: OnUpdate -> Custom Controller:</b> <b>handleOnUpdate.</b>
For this, in the code for <u>OnSubmit</u> in your view, you need to add code as
wdThis.wdGet<ComponentControllerName>().onUpdate();
and in the <u>OnUpdate</u> method in Component Controller:
wdThis.wdGet<CustomContControllerName>().handleOnUpdate();
Also, you need to <b>add the Component Controller to your View</b>, using Properties Tab
<b>and Custom Controller in Component Controller</b>, using its properties tab.
Hope it helps.
Regards,
Alka.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I cant call wdThis.wdGet<ComponentControllerName>().onUpdate(), because this method does not exist.
I do really need to define the event handler in the component controller? Cant I define the event handler in the custom controller?
With your coding example I could solve the problem without using events. But I d prefer using events if possible.
Regards
Rene
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.