Unable to use a Timed Delay action in a Control structure

Actions Editor ›› Timed Delay ››

PROBLEM

If you attempt to put a Timed Delay action inside of a Control structure (IF, STEP, LOOP, FOR EACH) the delay will be ignored when played back in the DHTML environment (although it works fine when run natively).


DETAILS

The inability to use a Timed Delay inside of a Control structure is a known limitation of the Actions Editor (when played back in DHTML). The Web Export Log will alert you to the fact that you have used a Timed Delay in this situation so that you can modify your programming logic.


WORKAROUNDS

Depending on how complex your code is, you may be able to re-write your code so that the Timed Delay can function, by moving the Delay action outside of the Control structure.


Below are two ideas which may work for you, in rewriting your logic so that the Timed Delay is not within a Control structure.

IDEA #1


For example if your logic is similar to this:


     On Load Page

     if x = 5

        set visible of field "abc" to true

        delay 5000

        set visible of field "abc" to false

     end if


You could rewrite this (in order to get the Delay out of the IF statement) to read:


     On Load Page

     if x <> 5

        break out of action sequence

     end if

     set visible of field "abc" to true

     delay 5000

     set visible of field "abc" to false

IDEA #2


For example if your logic is similar to this:


    On Load Page

      if x = 5

         set visible of field "abc" to true

         delay 5000

         set visible of field "abc" to false

      end if

      if x = 6

         set visible of field "xyz" to true

         delay 5000

         set visible of field "xyz" to false

      end if


You could rewrite this to use Action Methods instead.


    Action Method logic for "FlashABC"

        set visible of field "abc" to true

        delay 5000

        set visible of field "abc" to false

 

    Action Method logic for "FlashXYZ"

        set visible of field "xyz" to true

        delay 5000

        set visible of field "xyz" to false


     On Load Page

      if x = 5

         Execute Action Method "FlashABC" of self; discard return value

      end if

      if x = 6

         Execute Action Method "FlashXYZ" of self; discard return value

      end if



KEYWORDS: 20523 P788




Created with the Personal Edition of HelpNDoc: Generate Kindle eBooks with ease