Facility Control

 View Only
  • 1.  Runtaskonload - On a button? On an abs? When the DashBoard loads?

    Posted 05-11-2018 08:49
    This is a two part question, and the answer to the topic would also solve my other part (though that might have an even better sollution...).

    1: I know of the runtasksonload="true" and that you can attach this to a param in order for it to run at the start. I suppose this is all good and well...

    • But what if I want the tasks on a button to run when the DashBoard is loaded?
    • And if I have a set of tasks I want the DashBoard to run when it's loaded. Is there anywhere I can specify a certain task/set of tasks to run when the DashBoard loads?
    2: While this could be solved by simply running a task to hide a canvas ID when loaded (by solving the above), how do I set a canvas to be hidden to start with?


  • 2.  RE: Runtaskonload - On a button? On an abs? When the DashBoard loads?

    Posted 05-11-2018 11:50
    Right now I've "solved" this by adding a simple integer parameter I call "runOnLoad" and put it in the top right corner as a "label" parameter, and run the tasks on load...
    I do feel there must be a cleaner and prettier version to achieve this though?
    #DashBoard


  • 3.  RE: Runtaskonload - On a button? On an abs? When the DashBoard loads?

    Posted 05-11-2018 13:25
    1. We added the runtasksonload to params as a shorthand for parameters as those tasks have extra information about the parameter they're connected to. Your best bet? Put all of the things you want your buttons and your "onload" to do into functions and call them from #1 the button and #2 from an tag.

    2. We don't have it exposed in the UI (yet) but just add visible="false" to the tag for the element you want to start hidden.
    #DashBoard


  • 4.  RE: Runtaskonload - On a button? On an abs? When the DashBoard loads?

    Posted 05-14-2018 13:25
    ...
    Put all of the things you want your buttons and your "onload" to do into functions and call them from #1 the button and #2 from an tag.
    ...


    I am trying to do this part.

    Under a tag I have an part with custom functions, now followed with a where I try to call a function I defined in the previously. However when trying to call a simple test() function that ALL it does is write "test" in the debug window, it just tells me that test() is not defined?
    #DashBoard


  • 5.  RE: Runtaskonload - On a button? On an abs? When the DashBoard loads?

    Posted 05-14-2018 13:40
    In your tag, there is a checkbox that says "Execute Immediately" - you'll want that checked.

    By default, tags are evaluated onload, so any functions defined inside are not available until the panel has fully-loaded. This checkbox tells DashBoard to evaluate the script in the as soon as it gets to that tag in the document - the functions defined will be available before any onloads get run.

    James
    #DashBoard


  • 6.  RE: Runtaskonload - On a button? On an abs? When the DashBoard loads?

    Posted 05-14-2018 19:39
    Well there ya go!

    Comming from a javascript enviroment I was thinking from top-down perspective.
    But just another small trick into learning more about DashBoard! Thanks again!
    #DashBoard