on 2006 Jul 17 4:22 PM
Hi there,
I have 2 views in one window, and one application. when this application is called, depending on a value which is calculated based on a url based parameter, the default startup view should change. So, the screen that is displayed to the user should change depending on the calculated value. I can give one view as default and navigate to the next one, in the wdDoInit method. But in the init method, I dont have the variable value, as the view is initialised before the variable receives its value. I have the value available in wdDoModifyView, however, I cannot navigate to any other view from this method bypassing current view.
How can I achieve the functionality required?
Thanks,
LM
The window has a default inbound plug with a corresponding method onPlugDefault(). There you could check the value and navigate correspondingly.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Armin,
The navigational links are built in corresponding window. But the code to navigate is only available from within a view. Not in the interface view controller, where the onPlugDefault code is there. The only navigational code available to me in the interface view controller are the outbound plugs defined for the interface view(exit plug for example).
But what I want is precisely a the code with which I am able to navigate to a view in the window.
Any ideas?
Cheers
LM
Hi,
I meant the fire plug code.
Sorry I haven't tested this scenario, but just try out this code.
In the interface view create two outbound plugs.
one for first view and another for second view.
In the component controller properties tab add the Interface view.
Inside init() method call the iview u wish according to the condition,
wdThis.wdGet<Interface view controller>().wdFirePlug<outbound plug name>();
Hope it helps,
Regards,
Nagarajan.
Message was edited by: Nagarajan Kumarappan
Message was edited by: Nagarajan Kumarappan
Ok.
First, define a parameter "targetView", type "string, for the default inbound plug: method onPlugDefault() will automatically get this parameter and the value at runtime will be the value of the URL parameter.
Define a controller usage from the window controller to the component controller.
Add a method navigate(String targetView) to the component controller.
Add a (controller) event "Navigate" to the component controller and subscribe to this event from the view controller.
The processing sequence is then:
Default inbound plug of window:
onPlugDefault(IWDCustomEvent wdEvent, String targetView)
{
/* call component controller method */
wdThis.wdGet<ComponentController>().navigate(targetView);
}
Component controller:
void navigate(String targetView)
{
/* fire the "Navigate" event */
wdThis.wdFireEventNavigate(targetView);
}
Subscribed view controller:
void onNavigate(IWDCustomEvent wdEvent, String targetView)
{
/* call appropriate outbound plug */
...
}
Armin
Hello,
in the InterfaceView where the onPlugDefault Method is, I cannot select the wdThis.wdGet<Component>() Component-Controller nor the wdThis.wdGet<Component>InterfaceController() InterfaceController - only wdThis.wdGetAPI() is available.
Why?
PS: Access to the parameter through WDWebContextAdapter works fine.
Best regards,
Manuel Schaffner
User | Count |
---|---|
68 | |
10 | |
10 | |
7 | |
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.