Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
By BlairPereira
#21735
hi,
i am able to show image in iframe in dynaform , i have done this by passing the url directly in src="" of iframe.
what i want is to dynamically generate the src by passing it through a hiddenVariable.

Any Help on how i can go about this,I have added the IFrame in HTML of the dynaform.


regards,
blair pereira
User avatar
By amosbatto
#21747
An iframe needs an address for its src, and you can't generate files using just JavaScript (although you can do it with AJAX). The easiest way around this problem is to create an HTML page which has an empty body which will be the src for your iframe. Then use JavaScript to add the frame to a DynaForm title field and fill the content of that frame.
For example, create an empty HTML document at <INSTALL-DIRECTORY>/workflow/public_html/blankpage.html with the content:
Code: Select all
<html>
<body bgcolor="white">
</body>
</html>
Then, create a hidden field named "myhidden" and fire a trigger beforehand to set the value of @@myhidden. Then add a title field to your dynaform named "mytitle" and add the following javascript code to insert an iframe in that title and populate it:
Code: Select all
getField("mytitle").innerHTML = '<iframe id="myframe" width="100%" src="http://myaddress/blankpage.html">';

if (document.getElementById("myframe").contentDocument) //if FireFox or Chrome
  var doc = document.getElementById("myframe").contentDocument;
else                                                    //if Internet Explorer
  var doc = document.getElementById("myframe").contentWindow.document;

doc.open();
doc.write(getField("myhidden").value);
doc.close();
By ingleonidas
#44460
Hola, segui tu tutorial..la verdad que muy bueno.
He podido insertar el iframe, pero no puedo ver la pagina...
¿Que estoy haciendo mal?

Esto fue lo que hice:
1) cree el campo oculto "myhidden"
2) en la actividad que lo ejecuta, active: Variable for Case priority @@myhidden
3) cree el titulo "mytitle"
4) puse el javascript "myframe"

getField("mytitle").innerHTML = '<iframe id="myframe" width="100%" src="https://www.google.com/">';

if (document.getElementById("myframe").contentDocument) //if FireFox or Chrome
var doc = document.getElementById("myframe").contentDocument;
else //if Internet Explorer
var doc = document.getElementById("myframe").contentWindow.document;

doc.open();
doc.write(getField("myhidden").value);
doc.close();


Muchas gracias,
leonidas

In the rapidly evolving world of online sports be[…]

STEPN integrates social networking and games that […]

Cenforce 150 is a medication used to cope with a c[…]

What's SAP FICO?

Trustworthy and skill-building, each of these actu[…]