Is it possible to implement any kind of loader in the View of a RM Server Web app?

Christos_Karapapas
Christos_Karapapas New Altair Community Member
edited November 5 in Community Q&A
I would like to implement some kind of loader for a View of a Web app, since my initialization process runs for a dozen of seconds.

I know this is quite a broad question so I will try to narrow it down a bit.

I know that it would probable be quite difficult to implement something that would display a percentage of the process that has run already.

So I'm thinking either something to display when each subprocess of the initialization has finished, or a more generic spinner that would stop when the whole initialization is done.

Answers

  • IngoRM
    IngoRM New Altair Community Member
    Hi, not sure if this is possible but I thought I throw out the idea: can you switch a view at the end of the init process somehow?  Then you could start with a "waiting view" first showing nothing but a spinning gif and at the end of the process switch over to the view you actually want to see. Maybe worth a try...
  • BalazsBaranyRM
    BalazsBaranyRM New Altair Community Member
    Hi,

    both "Visualization" and "User input" have a tab for setting up interactions. These refer to user actions, unfortunately. I see how a process could set a macro (referenced by a variable in the web app) but I don't see how this would submit the user input in order to execute the interaction effect.

    My best guess is using some HTML and JavaScript to display the spinner in a panel, and hiding it when the loading is done (e. g. some table has rows). 

    Regards,
    Balázs
  • Christos_Karapapas
    Christos_Karapapas New Altair Community Member
    edited December 2019
    @IngoRM Hello and sorry for my late response! Thank you that is a nice idea!
    Ok I found how to switch from one view to another, right after initializing a process, but how do I switch back after the process is done?

    @BalazsBarany Thank you, also a nice idea! 
    I can see how to write CSS but I can't see how to write HTML or JS
     
  • BalazsBaranyRM
    BalazsBaranyRM New Altair Community Member
    Hi,

    adding a "Text Component" enables adding arbitrary HTML to your web app. This can also include JavaScript. (You can switch off "Use graphical editor".)

    Regards,
    Balázs
  • Edin_Klapic
    Edin_Klapic New Altair Community Member
    To my knowledge, in order to achieve that you would need to remove the entry for "Initialization process" in the tab General.
    There is no hook or interaction possible there.

    For your problem there also other approaches:
    1. Did you already identify the things which take a long execution time?
    2. Check if you can outsource longer running parts from the init process (e.g. Processes where the result is only needed in later views and thus might be loaded when you switch to that view)
    If this does not help, there is a workaround but that takes some effort.
    As Ingo mentioned you would create a blank view which only displays the intermediate loading statuses and eventually navigates to the first page of your App.

    Let me know if you want to go that road and I will try to prepare something.

    Happy Mining,
    Edin