on 09-22-2014 7:56 AM
Hi All,
I have scenario where I am calling two rfc to display two different smartform. The requirement is that on the click of a link other smartform should be displayed. I have tried linktoaction but it is giving errors. please suggest me what to use and please provide me the code also.
Thanks
Shilpi
Hi all,
thanks for your responses.
please tell me the procedure for the link to action. Do i need to create and action or separate context element?
what is the procedure for that? no document is helping me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You need to create action that time you need to pass the parameter data source node.
currElement is variable for data source node.
public void onActionLinkClicked(..., I<DataSourceNode>Element currElement)
{
/* do whatever with currelement */
}
After you need to add this code in wdDomodifyView.
wdDoModifyView(...)
{
if (firstTime)
{
IWDLinkToAction link = (IWDLinkToAction) view.getElement("here you need to give the UI LinktoAction ID");
link.mappingOfOnAction().addSourceMapping("nodeElement", "//currElement in action what you given same you need to pass here.");
}
}
The above process is applicable to Table level link to action.
Hi Durga,
I tell you what I have done. I have called two RFCs: RFC1 and RFC2 via adaptive model to display two different smartforms, that is working fine. Now i have to display one smartform from RFC2 on a click of a link, for that I have used linktoaction. IS this UI is correct? after data I have set the link tooltip property with PDF1 file. This file needs to created to display smartform and it is string type. After that I used the below mentioned code:
public static void wdDoModifyView(IPrivateZtravel_acc_compView wdThis, IPrivateZtravel_acc_compView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
if (firstTime)
{
IWDLinkToAction link = (IWDLinkToAction)Ztravel_acc_compView.getElement("LinkToAction");
link.mappingOfOnAction().addSourceMapping("nodeElement", "");
}
//@@end
}
It is incomplete because I dont know what will come in nodeElement and after that and I am getting error for getElement for which I have posted screenshot earlier. Here, there is no table for which i need to create another column.Now tell where I am lacking and a solution for that.
Please help me.
Hi,
May be link to action text and tool tip like two Properties having there you can give any name to be display.Other wise dynamically also display.Here you need to create one String type attribute and bind the text and tool tip.You need to set the attribute in before display of view.Means in comp level doinit() method exulting first.There you can set like
wdcontext.currentElement.set---("PDF File");
http://help.sap.com/saphelp_srm40/Helpdata/EN/dd/f7c3f8d5519e41bddbc708594f9479/content.htm
may be this one only way.
this one also not your requirement means.Tell me requirement that time only i can help you.
BR,
Durga.
Hi,
Check this link.
http://help.sap.com/saphelp_nw70/helpdata/en/60/1f1f056f057d4d962375efd3c92ed0/content.htm
Check this code may be helping for you.
wdDoModifyView(...)
{
if (firstTime)
{
IWDLinkToAction link = (IWDLinkToAction) view.getElement("LinkID");
link.mappingOfOnAction().addSourceMapping("nodeElement", "currElement");
}
}
void onActionLinkClicked(..., I<DataSourceNode>Element currElement)
{
/* do whatever with currelement */
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi shilpi ,
here you have done parameter mapping for the link to action , so here
in the action which is binded to the link should have parameter
public void onAction********(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sap.tc.webdynpro.progmodel.api.IWDNodeElement selectedElement )
{
}
and in wd modify view method
IWDLinkToAction link = (IWDLinkToAction) view.getElement("LinkToAction4");
link.mappingOfOnAction().addSourceMapping("nodeElement","selectedElement");
in your case the
iwdlinktoAction link = (iwdlink...) z...view.getElement("Previous Year");
here Previous Year is wrong , becuase no UI element names have space in between thier ids , so make sure that UI element linktoaction name might be Previous_Year or previousyear ...
Regards
Govardan
hi shilpi ,
Please display the error so that we can know what issue you are facing.
Regards
Govardan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
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.