cancel
Showing results for 
Search instead for 
Did you mean: 

Personas 3: HtmlViewer adding html content

kammaje_cis
Active Contributor
0 Kudos

Hi all,

I am on Personas 3.

In SMEN transaction, I hid everything, created a button and a HtmlViewer control. I created a script with below code.


  debugger;

  var html = "<p>Sample Text.</p>";

  session.findById("wnd[0]/usr/htmlViewerPersonas_1447913779232").content = html;

I call this script whenever a button is pressed and expected htmlviewer to show "Sample Text". Somehow it is not working. Can anyone help?

->In F12, I see that iframe's body is empty as well.

->I ensured that my code gets executed by putting a "debugger"

Thanks

Krishna

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I would expect that to work. This works for me:

session.findById("wnd[0]/usr/htmlViewerPersonas_1447866610072").content
  = "<p>Hello world</p>";

Steve.

kammaje_cis
Active Contributor
0 Kudos

Thanks Steve. May be you are on Personas 2.0?

SAP has replied that they too see this issue with Personas 3.0 with both Kernel(742) PL300 and PL311 and promised to come back with a solution. I will update this thread once I get a solution.

Regards

Krishna

Former Member
0 Kudos

No, I'm running Personas 3, but with an older kernel (224). I guess I'll wait until this is fixed before doing my next kernel upgrade

Steve.

0 Kudos

Hey Steve,

Do you know if this issue got solved, since I'm having a similiar issue ?

Buliding a smal HTML string which I assign to HTML.content However nothing happens.

Brgds

Henrik

clemens_gantert
Active Participant
0 Kudos

Have you created a URL whitelist entry "/.*"   ?

Regards,

Clemens

0 Kudos

Hey Clemens,

Yes I did put in /.* in my whitelist. However I figured out SP03 could be an option, if not I'm back 2 start

Brgds

Henrik

Former Member
0 Kudos

Yes, this now works fine for me, in both SP02 and SP03, and has done for a while. I do keep pretty up to date with kernel patches, though - maybe try a kernel update and see if that helps. If not, I'd suggest creating an OSS incident and get SAP to look at it. It is *supposed* to work!

Steve.

former_member202682
Participant
0 Kudos

Hello Steve,

For me it says the content cannot be displayed in a frame. Not sure how to check which site will play in HTML viewer. I tried SAP.COM and Youtube. I do have added the /.* entries in my URL Whitelist. Anything else I should be checking? I am on SP03 Kernel level 742 Sup.Pkg lvl 401.

Thanks,

AShwini

Former Member
0 Kudos

If you are displaying external sites via their URLs, then you need to add matching URL patterns to the whitelist. This pattern will match *everything*: (http|https):\/\/.*

The point of the whitelist, though, is to restrict what can be displayed, so you may want to not use that pattern, but something more specific. I might use (http|https):\/\/www\.warwick\.ac\.uk\/.* to restrict just to my company websites, for example.

Steve.

Answers (0)