Skip to main content
1-Visitor
July 6, 2015
Question

downloadLink on button click

  • July 6, 2015
  • 3 replies
  • 1739 views

I have created a service to create a file in repository.

I want to call the service on Button click to download the file, like DataExport widget does.

Is there any way to do that?

    3 replies

    1-Visitor
    July 6, 2015

    Use the Service GetFileListingWithLinks for this functionality.

    This will give you a hyperlink to allow the file to be downloaded.

    If it has to look like a button (vs. the Link widget) you can always overlay the Link widget over the top of the Button.

    mak11-VisitorAuthor
    1-Visitor
    July 7, 2015

    I have already used GetFileListingWithLinks in the Service and it returns downloadLink of the file, the downloadLink is set as SourceURL in the Link Widget, that scenario works perfectly.

    But I want to call the Service when user clicks on a Button.

    Situation: in my Mashup user sees charts and there is TimeSelector on the chart, I have to call the Service whenever user changes the TimeSelector. In this way a lot of unnecessary files are created. That's why I want to call the Service when user clicks on a Button.

    1-Visitor
    July 7, 2015

    Great! Like I mentioned, you can use the Link Widget overlayed on a Button widget.

    Use the TimeSelector Updated event to retrieve the proper link.