on 07-09-2007 10:44 AM
Hi Experts,
On click of a table row, I need to pass a parameter to another view in the same component. I have created an outbound plug with the parameter in the first view and inbound plug with parameter in the second view.. ut stil the value exchange is not happening...
Request your inputs on this....
Please note that I am very much new to WD....
Regards
Hi,
in view1 create a outbound plug (toview2)give the parameters , String str, int i for example
in view2 create a inbound plug (fromview1)give the parameters , String str, int i
in view1, create action for on table select. let ur table node structure
context
|-table
|-no(int)
|-name(String)
write the code in
onActionTableSelect()
{
int no=wdContext.currentTableElement().getNo();
String name=wdContext.currentTableElement().getName();
wdThis.wddoFirePlugToView2(no,name);
}
in view2
you will get these parameters
in
wdDoFirePlugfromView1(String str, int i)
{
wdComponentAPI.getMessageManager.reportSuccess(i+" "+str);
}
here you can get the selected table values
Regards,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
In the inbound plug method similar to this method below
public void onPlugin_bound(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, String val )
{
//@@begin onPlugin_bound(ServerEvent)
//@@end
}
If you are not getting value for val. Check whether you are passing it in table view.
Thanks and 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 ,
On a click of table row , capture and event and in the implementation of the code, populate the data and fire the plug Kindly check that before firing the plug your parameter is properly populated . Ideally there should not be any problem passing the parameter in this manner .
Another and a better way to achieve this is via context , create an attribute in context populate it from one of the view, navigate to another and read the same attribute from second view ( you have to map the same context attribure to both the view controller context ) . This way you get a flexibility to add/ remove / change the attribute.
regards
Dhawal
Message was edited by:
Dhawal Joshi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The <b>parameter name in both the OutBound Plug and Inbound Plug should be same</b>.
I tried as below but did not work
In view1create a outbound plug with parameter "param" of type "string"
In view2 create a inbound plug with parameter "paramIn" of type "string"
Try compiling it throws error
the below worked
In view1create a outbound plug with parameter "param" of type "string"
In view2 create a inbound plug with parameter "param" of type "string"
In view2
wdComponentAPI.getMessageManager.reportSuccess(param);
this displayed the value
One possible solution:
- Create attribute A in component controller (CC)
- Add CC as used controller for both view controllers
- In both view contexts, create attribute A and map it to A from CC
Before navigating away from view 1, set attribute A. In view 2, read attribute A, it will contain the value set in view 1.
Armin
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.