on 04-11-2005 9:19 AM
Hi,
in my application i have more than one view, but at runtime only one of these views has to be shown. I want to decide this via a parameter that I get from the url.
How can i set the right view to be showing at runtime?
I tried it with a StartView which fires the right Outbound Plug in his wdDoInit-Method. This is working fine, but the problem is, that the method OnPlugDefault() of ComponentInterfaceViewController isn't called already at this time. So in the Init-Method of the StartView I don't have the given URL Parameter, so I can't decide which Plug I want to fire. The method OnPlugDefault() is called only after the init-method of the StartView.
Is there any other possibilty to set the view, which has to be shown, at runtime?
Thanks and Best Regards
Katharina
Hi,
One way is you can pass the parameter in the URL , read the parameter and then fire the outbound plug depending upon that.
You can read the parameters as follows
HttpServletRequest request =Task.getCurrentTask()
.getWebContextAdapter()
.getHttpServletRequest();
String[] param1 = request.getParameterValues("<<PARAMETRNAME");
if(param1.equals("VALUE"))
fire outbound plug1;
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks,
that was the right hint.
But the coding
HttpServletRequest request =Task.getCurrentTask()
.getWebContextAdapter()
.getHttpServletRequest();
wasn't quite correct. The last method isn't available on ContextAdapter.
But I found this one:
String[] param = Task.getCurrentTask()
.getWebContextAdapter()
.getRequestParameterValues(<paramname>);
Thanks and Best Regards
Katharina
Hello all. Anyone can tell me how can i modify the /irj/portalapps/com.sap.portal.pagebuilder/scripts/pagesupport.js file ? Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try the following:
1. In Component Controller create event SelectView with single argument <i>String viewName</i>
2. In Component Controller context create attribute ViewName
3. In wdDoBeforeNavigation of Component Controller fire event SelectView with viewName argument from context attribute. Also you may add check here to invoke this event only ones for component lifecycle.
4. Add Component Controller to "Required Controllers" on "Properties" tab of Interface View Controller.
5. In plug handler of Interface View Controller set ViewName attribute in used Component Controller context.
6. Add Component Controller to "Required Controllers" on "Properties" tab of dispatching View Controller and subscribe to SelectView event
7. Fire necessary plug in SelectView event handler depending on viewName argument
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.