Not able to open complete HTML content as a page

Hi,

Please help me understanding, how to open complete HTML script in a page using OutSytems web. The scenario is as follows :

Through an API I am directly getting complete HTML script & I just want to open that HTML content in a page using OutSystems. If I create a file using the same HTML script & save it as .html file it works well, but while I am trying to do the same in OutSystems, unable to make it work.

I checked doing inspect element in chrome, I got following error :

Cannot read property 'submit' of undefined at onload

Steps I am taking is as follows :

Created a new page named Demo & added one expression into it. On preparation assigning value of HTML in the same expression with attribute value 'No' to escapeContent property of expression.


Please find the HTML script in attached file.

Dishant Deep wrote:

Hi,

Please help me understanding, how to open complete HTML script in a page using OutSytems web. The scenario is as follows :

Through an API I am directly getting complete HTML script & I just want to open that HTML content in a page using OutSystems. If I create a file using the same HTML script & save it as .html file it works well, but while I am trying to do the same in OutSystems, unable to make it work.

I checked doing inspect element in chrome, I got following error :

Cannot read property 'submit' of undefined at onload

Steps I am taking is as follows :

Created a new page named Demo & added one expression into it. On preparation assigning value of HTML in the same expression with attribute value 'No' to escapeContent property of expression.


Please find the HTML script in attached file.

I would suggest iframe to be used for rendering the whole HTML page.


Regards,

Pankaj Pant


Hey Dishant,


Looking at your html, it seems it is encapsulated with <html> and <body> tags. (you can't load a <html> page into a <html> page, doesn't make sense)
Though it seems you are only loading a form with some data in it, if you were to remove the <html> and <body> tags you will be able to load your data. Though you will need a container to be able to size it.

As Pankaj suggested, you could use an iframe (or object etc.) to load your entire page within the Outsystems page, but then you will not be able to interact with it using code (the user can interact with it just fine, but if you need to notify data back to Outsystems, this will prove nearly impossible).

Dishant Deep wrote:

Hi,

Please help me understanding, how to open complete HTML script in a page using OutSytems web. The scenario is as follows :

Through an API I am directly getting complete HTML script & I just want to open that HTML content in a page using OutSystems. If I create a file using the same HTML script & save it as .html file it works well, but while I am trying to do the same in OutSystems, unable to make it work.

I checked doing inspect element in chrome, I got following error :

Cannot read property 'submit' of undefined at onload

Steps I am taking is as follows :

Created a new page named Demo & added one expression into it. On preparation assigning value of HTML in the same expression with attribute value 'No' to escapeContent property of expression.


Please find the HTML script in attached file.

Hi Dishant,


Just replace all double code with single codes and the rest process is same.


Thanks.


Hi Dishant Deep,

I have to ask... why do you need to place this inside an OutSystems screen in the first place?

Jorge Martins wrote:

Hi Dishant Deep,

I have to ask... why do you need to place this inside an OutSystems screen in the first place?

Hi Jorge,

This is a requirement where I have to redirect user to some url . The redirection happens on load of html page which is being returned as a response from API .

Please find sample API Response for your reference :

{
    "Head": {
        "Code": "XXXXXXXXX",
        "Status": 0,
        "Description": "Success"
    },
    "Body": {
        "PayloadHTML": "<html><body onload='document.autoform.submit();'><form name='autoform' method='post' action='https://google.com'><apiVersion>2.0</apiVersion><employmentType>SelfEmployed</employmentType><vendorId>Digital</vendorId><txnId>35</txnId></form></body></html>"
    }
}


JitendraYadav wrote:

Dishant Deep wrote:

Hi,

Please help me understanding, how to open complete HTML script in a page using OutSytems web. The scenario is as follows :

Through an API I am directly getting complete HTML script & I just want to open that HTML content in a page using OutSystems. If I create a file using the same HTML script & save it as .html file it works well, but while I am trying to do the same in OutSystems, unable to make it work.

I checked doing inspect element in chrome, I got following error :

Cannot read property 'submit' of undefined at onload

Steps I am taking is as follows :

Created a new page named Demo & added one expression into it. On preparation assigning value of HTML in the same expression with attribute value 'No' to escapeContent property of expression.


Please find the HTML script in attached file.

Hi Dishant,


Just replace all double code with single codes and the rest process is same.


Thanks.


Hi Jitendra,

There is no double code as such , do you mean to replace all single quotes to double quotes ? Even I tried replacing all single quotes to double quotes & vice versa too,nothing works.


Pankaj pant wrote:

Dishant Deep wrote:

Hi,

Please help me understanding, how to open complete HTML script in a page using OutSytems web. The scenario is as follows :

Through an API I am directly getting complete HTML script & I just want to open that HTML content in a page using OutSystems. If I create a file using the same HTML script & save it as .html file it works well, but while I am trying to do the same in OutSystems, unable to make it work.

I checked doing inspect element in chrome, I got following error :

Cannot read property 'submit' of undefined at onload

Steps I am taking is as follows :

Created a new page named Demo & added one expression into it. On preparation assigning value of HTML in the same expression with attribute value 'No' to escapeContent property of expression.


Please find the HTML script in attached file.

I would suggest iframe to be used for rendering the whole HTML page.


Regards,

Pankaj Pant


Hi Pankaj,

I have to pass multiple parameters to set values in HTML page , so this solution won't work for me.


Thanks for your valuable time


Solution

Hello Dishant,

Write a Jquery/JavaScript that bind your html content to body and submit your form using Jquery/JavaScript.

Solution

Suhas Jamdade wrote:

Hello Dishant,

Write a Jquery/JavaScript that bind your html content to body and submit your form using Jquery/JavaScript.

Hi Suhas,

Thanks for your valuable feedback . I was trying the same & finally got the resolution.