Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Close UI after download start IAS

Solved339 views29th January 2025interactive automation script LCA
2
Marco Di Blasi200 27th January 2025 0 Comments

Hi all

I have an AS script that expose a URL as result in a UI popup, as the script is executed inside the LCA

UIBuilder uib = new UIBuilder();
UIBlockDefinition link = new UIBlockDefinition();
link.Type = UIBlockType.DownloadButton;
link.ConfigOptions = new AutomationDownloadButtonOptions()
{
Url = "https://url",
StartDownloadImmediately = false,
FileNameToSave = "",
ReturnWhenDownloadIsStarted = true,
};
link.Title = "link";
uib.AppendBlock(link);
UIResults res = new UIResults();
do
{
res = engine.ShowUI(uib);
} while (!res.WasOnDownloadStarted("link"));

I setted the url as Download button so the user is able to click on it and the new webpage will be opened, I also need to add the do block so the popup stay opened so the user can click on it.

But how I can let the popup auto-close when the download start? I tried with WasOnDownloadStarted but it not works

Marco Di Blasi Selected answer as best 29th January 2025

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
2
Peter Vanpoucke [SLC] [DevOps Advocate]1.01K Posted 27th January 2025 0 Comments

Hi Marco

It should be possible to stop the script when the download button was clicked. The script you've added would need a few changes though.

The identifier of a block definition, that you're using in WasOnDownloadStarted, is stored in the DestVar property, instead of Title. Next to that the RequireResponse  property should be set to true, otherwise the script will constantly loop and refresh the UI.

Could you update the script as follows and let me know if this works for you?

UIBuilder uib = new UIBuilder();

uib.RequireResponse = true;

UIBlockDefinition link = new UIBlockDefinition();

link.DestVar = "link";

// …

Small note: the URL will need to remain available after the script was stopped, because the download could still be busy. For instance, for a file located in the Documents module.

Peter Vanpoucke [SLC] [DevOps Advocate] Edited answer 27th January 2025
You are viewing 1 out of 2 answers, click here to view all answers.
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin