on 12-06-2006 1:17 PM
Hi All,
How can we pass parameter from one view to another through fire plugs,
In view1 I created a out bound plug with a parameter, and I am firing it as
wdThis.wdFirePlugTo_View2("XXX");
How can I receive this value in the view2.
Thanks in advance,
Regards,
Sai Krishna.
Hi,
At the time of declaring your plug in method u need to declare param and you capture the second View.
When you create the param the method will automatically diplays the param .
thanks,
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lohi,
My Action method is like this,
public void onActionClick(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionClick(ServerEvent)
wdThis.wdGetEHS_WSOCustController().Getfileds("XYZ");
wdThis.wdFirePlugTo_View2("ZZZ"); //here the parameter name is FormType.
//@@end
}
How/where to catch this FormType Variable in view two.
Regards,
Sai Krishna.
hi
in the second view
public void onPlugin(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String param )
{
//@@begin onPlugin(ServerEvent)
//@@end
}
param is the value u pass
regards,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arun,
I added a Public variable in the view, I added the method as you have shown, Assigned the param value to this public variable.
when I save the meta data the method is present, when I rebuild the project the method and the variable are removed, and all the dependent code gives an error.
Regards,
Sai Krishna.
Hi Arun,
I already added the parameter to the out bound plug as you specified,
this is the code I have in the view2.
public String inboundparam =" ";
public void onPlugin(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String param )
{
// @@begin onPlugin(ServerEvent)
inboundparam = param;
// @@end
}
When I save the meta data the code is present, but when I rebuild the project the added code is vanished.
Regards,
Sai.k.k
Hi,
Previously I had it out side the "others" block, but Now I placed in this block.
The code resists there, but the code in this method is not executed or I dont know wether the code in this method is being executed or not,
Here is the code.
//@@begin others
public String FormType =" ";
public void onPlugin(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String param )
{
// @@begin onPlugin(ServerEvent)
IWDMessageManager mgr = wdThis.wdGetAPI().getComponent().getMessageManager();
FormType = param;
wdContext.currentContextElement().setFormHeader(param);
mgr.reportSuccess(param);
mgr.reportSuccess(wdContext.currentContextElement().getFormHeader());
// @@end
}
//@@end
Regards,
Sai.k.k
Hi,
public void onPlugin(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String param )
{
// @@begin onPlugin(ServerEvent)
IWDMessageManager mgr = wdThis.wdGetAPI().getComponent().getMessageManager();
wdContext.currentContextElement().setFormHeader(param);
mgr.reportSuccess(param);
mgr.reportSuccess(wdContext.currentContextElement().getFormHeader());
// @@end
}
it will work like this no need to declare once again param .
Thanks,
Lohi.
Hi,
Switch to the view from which you are firing O/B plug.
Select Plugs tab.
Select the desired O/B plug from the list.
See whether you get the parameter in the Parameters list.
If not, add the desired parameter.
Also repeat the same excercise for I/b plug of the other view.
Let me know the results.
Ashutosh
hi
Dont place the Onplugin code in others
1)only place FormType in others
//@@begin others
public String FormType =" ";
//@@end
2)The eventhandler onPlugin is Automatically generated
The Onplugin Eventhandler will reside seperately like doinit(),doexit()
public void onPlugin(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String param )
{
// @@begin onPlugin(ServerEvent)
IWDMessageManager mgr = wdThis.wdGetAPI().getComponent().getMessageManager();
FormType = param;
wdContext.currentContextElement().setFormHeader(param);
mgr.reportSuccess(param);
mgr.reportSuccess(wdContext.currentContextElement().getFormHeader());
// @@end
}
Regards,
Arun S
hi
In the Second View u check whether u having the inbound plug
1)click the plug tab in view 2 and check for inbounf plug
2)click the implementation tab and check whether u having eventhandler for that.U can also check by selecting the implementation Tab and switch over to OUTLINE View.There u check for ur event handler onplugin
Regards,
Arun S
Hi Arun,
yes I could get that inbount plug event handler,
but the value assigned from the inbound plug paramater to the FormType variable which declared in the others block, is not getting. so now I created a value attribute in the custom controller and assigning the value to this attribute, and fetching this value in the view2.
Actually my requirement is, there is a menu with three Linktoaction (employee, vendor, contractor) when the user clicks a link from the three, view2 is to be triggered and a parameter is to be passed, with this parameter I would decide which details to be shown on the view2.
The problem I am facing is :
If for the first time a user clicks employee, employee details are shown in the view2.
and if he clicks vendor later, it triggers to view2 but shows employee details only.
and similarly for vendor.
i.e, which ever the link the user clicks for the first time, it remains for the entire application.
Regards,
Sai.k.k
Hi Arun,
In my application, I used a frame set, there will be Header view on top, there will be a menu view on left, and there would be a welcome message on right.
when the user clicks the link from left menu, the respective form is to be displayed on the right side.
as you said, I am writing this code in the Exit() of view2, but the value everything remain same as I said in the previous post.
wdContext.nodeF4Output().invalidate();
wdContext.currentContextElement().setTransaction(" ");
wdContext.nodeFieldsList().invalidate();
Is this what you want me to do ...
Regards,
Sai.k.k
Hi Arun,
Your solution is perfectly right, I am un aware of the OnINBoundPlug() method, and I thought We need to create a new method to catch the in bound plug.
But there is a small problem with the variables declared by us, and using them in the oninboundplug() method, how ever I created a new value attribute in the custom controller and binded it to the respective views. And this helped me in the application.
And Arun, I have 2 more small doubts, please help me ...
1) I Installed Sneak Preview in my local system, It is not displaying the detailed error list, it is just saying "Failed to process request. Please contact your system administrator." where and how to configure for this.
2) In view1 there is a button, on click of this, I am calling a method in custom controller, In the custom controller the code is like this
IWDMessageManager msg = wdThis.wdGetAPI().getComponent().getMessageManager();
msg.reportSuccess("yes");
IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("Witness_Window");
IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo,true);
window.setWindowPosition(150,150);
window.open();
wdContext.currentWindowElement().setWindowInstance(window);
When I am trying to open a new window on click of a button, there is a error message like this
com.sap.tc.webdynpro.services.exceptions.InvalidUrlRuntimeException: Invalid URL=../../../resources/local/EHS_WSO/Components/com.sap.tc.projects.ehswso.EHS_WSOComp/<>
Regards,
Sai.k.k
User | Count |
---|---|
93 | |
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.