cancel
Showing results for 
Search instead for 
Did you mean: 

call an action after user click on fileDownload element

Former Member
0 Kudos

Hi,

I use the FileDownload element to download a file.

After the user click on the link a second method sould be called to store some information.

How can I react after the customer click?

The filedownload element has no (Custom)event.

Is it possible to find out the name of the Web Dynpro intern event?

Thanks

Gunter

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

Please do find the following WD tutorial for FileUploading and File Downloading :

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a...

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b0e10426-77ca-2910-7eb5-d7d8982c...

Blogs :

/people/rekha.malavathu2/blog/2006/12/12/handling-fileupload-and-filedownload-in-netweaver-developer-studionwds-2004s

Hope this links will be helpful.

Thanks

Ritushree

Edited by: Ritushree Saha on Jun 20, 2009 11:07 AM

Former Member
0 Kudos

Hi Gunter,

Rather than a FileDownload UI element you can have a linkToAction.

With the action you can write the necessary code. But, the disadvantage is you will have to write the code to download the file.

Regards,

Kartikaye

Former Member
0 Kudos

Hi,

Try Using Calculated property of the context attribute binded na..

http://help.sap.com/erp2005_ehp_04/helpdata/EN/7f/a0384162316532e10000000a1550b0/content.htm

Best Wishes

Idhaya R

Former Member
0 Kudos

Hi,

The below is just my suggestion/ openion:

Please Note: Here I am not answering your question.

Actually in the FileUpload UI element the browse button is only to browse the file on your desktop.

Exactly to point the location of the file on your desktop.

Here why do you want an action?

Becuase this file location which we select using browse button is useless unless you upload that file.

So finally user has to click on another custom button like "Upload" to store the file.

So why dont you write your code in that custom button "Upload"??

Pease Ignore this post..I think you are asking about FileDownload...

Regards,

Charan

Former Member
0 Kudos

Hi,

I am not really sure if it works this way but here is one suggestion to which you can give a try:

Create a method to perform the actions of storing information or whatever you require to do on click of file download. Call this method in the wdDoModify view method, inside an 'if' condition. You can apply a check in this if condition whether a particular context attribute (bound to a property of dowmload UI element) has been set which would imply that the UI element was clicked on. You may in the end reset that attribute so that this method is not called again.

Probably others can suggest better ideas to implement your requirement.

Regards,

Anagha

Former Member
0 Kudos

Hi Jawalekar,

thank your for your replay.

But the problem is there the download is a column of a table. If a user clicks on the download link the lead selection of the record will not set to the row of the selected link. It will stay on the lead before.

Regards

Gunter

Former Member
0 Kudos

As I understand, one of your table comlumns has File download UIs. The click of the FileDownload UI of any row should be updating some context attribute right?

What exactly you want to do on click of any fileDownload UI embedded in your table?

Former Member
0 Kudos

Hi,

See this thread.

Regards,

Charan

Former Member
0 Kudos

Hi Anagha,

if the user click on the download link I want to store some statistic information. For that i will call an other method after the user click.

The link is in a column of an table. The row or better the lead selection is not set to the row in which the user is clicked. So I can not use the supplyFunction and also not the calculated value.

The best way will be to get the fileDownlod action. But that ..... hm.. is not possible ... get or?

regards

Gunter

Former Member
0 Kudos

Hi,

Why dont you use LinkToAction and in the onAction of this UI element you can open the URL in the external window and you can do other processing also if anything requried.

And you can get the selected element of the node wihout leadSelect if you uses LinkToAction using the source mapping in wdDoModifyView() method.


IWDLinkToAction linkToAction =  (IWDLinkToAction) view.getElement("LinkToAction");
linkToAction.mappingOfOnAction().addSourceMapping("nodeElement", "element");

For example if you have binded the "TableNode" to the table then create an action as "OpenLink" and add IWDTableNodeElement as parameter with exact name "element" as below.


public void onActionOpenLink(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.harman.cimt.reports.wdp.IPrivateTestView.ITableNodeElement element )
{
//How to get the selected row element values
element.getValue1();
element.getValue2();

//How to open the URL in external window
IWDWindow win;
win =wdComponentAPI.getWindowManager().createNonModalExternalWindow((
element.getUrl(),"Link");
win.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
win.show();
}

Regards,

Charan

Former Member
0 Kudos

Hi SRI KRISHNA,

I have your solution implemented before I post my problem.

The problem is, some users which use IE6 got a "cross-site scripting" error.

This is the reason why I search for an other solution.

regards

Gunter