1
0
-1

Hi,

I'm using iFrame component in Maestro and the URL for the iFrame need to have couple of URL parameters.

The parameter values are present in data fields but how do I update the URL value of the iFrame? I'm hoping to put Page Load rule on the page containing this iFrame so before the iFrame loads the URL has parameter values appended to it.

 

cheers,

parth

 

 

 

    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      You can change the iframe URL via JavaScript.

       

      In this case I will use a data field. The logic to update the iframe will be in the calculation rule.

       

      1. Drag on a data field and an iframe component. I also dragged on a text field to use as a URL changer.

       

          2. In the calculation rule of the data field (searchKey in this case), write the following code.

          The iframe variable will contain the iframe element in line 1.

          assigning the data field value to the src of the iframe is done on line 4.

          line 6 returns the value back into the data field. Required for a calculation rule.

        3. For testing, create a "blur" rule on the text field (URL on blur) that sets the data field to its value

      Now when the text field is blurred out, the URL of the iframe will update.

      NOTE: you may need to change the X-Frame-Options in your portal settings to accommodate external URLs.

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Thanks heaps David.. It works

          CommentAdd your comment...