Workflow Soluiton

 View Only
  • 1.  Using Ajax output to leverage panel visibility on a form

    Posted Nov 07, 2014 03:02 PM
      |   view attached

    All,

    On a form, I am trying to leverage panel visibility (or any variable for that matter), using the current state of an Ajax component. Trouble is, there doesn't seem to be any output variable for the Ajax component. The Ajax model will currently state Not Started", "Started" or "Completed" states. I would like to change the current view for the end customer based on this output. Please advise if this would be possible, or if there are other similar approaches that may satisfy. Ajax model screenshot attached.

    capture.JPG

    Thanks!!



  • 2.  RE: Using Ajax output to leverage panel visibility on a form
    Best Answer

    Posted Nov 07, 2014 04:02 PM

    You may be better served with iframes and additional webform projects than with trying to use ajax components for this.  Could you provide more information on how you want your user experience to be affected by the results of the data being processed by the ajax component?  Here's an example of a form I did a while back for Patch Management, in which the "staged" task status is displayed in an iframe.  It is not currently configured, however, to affect the parent page in any way.

    http://atmaworkflow.files.wordpress.com/2014/11/patchmgmtiframe.gif

    I tried several methods of getting the ajax data as you originally intended, and was unable to do so.  You may be able to attach a new javascript listener to do so, but again, using iframes may be easier depending on what exactly you're trying to do with your UX.

    EDIT: I just ran a few tests, and it turns out that adjusting the parent form with iframe form javascript is as simple as using, for example:

    parent.document.getElementById('ElementControlIdHere').dosomething

    instead of the usual:

    document.getElementById('ElementControlIdHere').dosomething

    So that being said, using iframes should be a good solution for what you're trying to do.  You can control visibility on the parent page, while still keeping functionality and page reloads sequestered from the parent form.

    Demo:

    http://atmaworkflow.files.wordpress.com/2014/11/iframecontrolsparent.gif



  • 3.  RE: Using Ajax output to leverage panel visibility on a form

    Posted Nov 07, 2014 10:00 PM

    Hi upioneer - your question inspired me to rework some of my old projects with some of the info I posted in the last reply.  I did a write-up that may further help you flesh out your project the way you've described.

    http://atmaworkflow.com/2014/11/07/sending-a-javascript-event-from-an-iframe-to-its-parent/

    Let me know if you need any more info.



  • 4.  RE: Using Ajax output to leverage panel visibility on a form

    Posted Nov 11, 2014 05:37 PM

    Those are very good suggestions Andrew. Much appreciation for spreading knowledge. I've just recently been assigned to Workflow just weeks ago, so I am trying to get my bearings here.

    The project is about 99% complete, just looking for a way to display actual/real time or incremental progress of the Quick Delivery task. Unfortunately, the GetTaskStatus only appears to display 0 or 100%, which I am then able to translate to "Downloading" or "Completed" to the end user. Unfortunately, this isn't sufficient for the business as there are many factors that may affect the task completion time such as wifi, vpn, file size etc. So I am being asked to work this into accurate progress bar/percentage/other visual representation of the task.

    Something else I am noticing, seems when I have multiple Ajax Labels on a form, only one will process correctly while the other(s) don't. Because of this, I am forced to a max of one Ajax Label per form.

     

    Sorry for the late response, have been churning away in my bubble of trial and error here.



  • 5.  RE: Using Ajax output to leverage panel visibility on a form

    Posted Nov 11, 2014 06:46 PM

    I tried once (for an embarassingly great amount of time) to translate what you see in the Altiris console when running a task into something usable in Workflow.  Eventually I gave up on reproducing the progress bar. If you're able to translate it into something usable, I'd love to hear how you do it.

    If you go to Patch Remediation for example, and right-click and download a patch package, you can then right-click on the progress bar and view source.  Past that, reverse-engineering got way too tedious for me.

    Or maybe we'll get off easy and someone else can post a revelation for us.



  • 6.  RE: Using Ajax output to leverage panel visibility on a form

    Posted Nov 12, 2014 12:40 PM

    What I did was use a starts with or text contains multiple component followed by replace text components to swap out the started, completed, failed etc return from GetTaskStatus nested in an Ajax label. Like I said, only a few weeks into Workflow. I'm sure a year from now I will look back and laugh at my attempts. Model below changes almost hourly, but I hope this helps.

     

    delete2.JPG