cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the URL for a Personas custom HTML control

Former Member
0 Kudos

Is there a way to change the URL displayed by an HTML control from a Personas script? I can't see a way from the standard actions - Paste/Enter value of the new URL doesn't do it - but maybe from JavaScript?

Thanks,

Steve.

Accepted Solutions (1)

Accepted Solutions (1)

TobiasQueck
Advisor
Advisor
0 Kudos

Hi Steve,

You can bind the url to an input field and then use a script to update this field. There should also be a script action to refresh the html viewer after you updated the field.

Cheers,

Tobias.

PS: using my mobile right now, so I cannot provide an example.

Former Member
0 Kudos

Perfect. Thanks Tobias 🙂

Former Member
0 Kudos

What am I missing when you say bind the URL to an input field?

Thanks

TobiasQueck
Advisor
Advisor
0 Kudos

Hi Richard,

When you open the HTML Viewereditor you can click on the button on the left, this will collapse popup and you can select an input field on your screen. This input field is then assigned to an index. To use the content of the input field, just create an url like http://www.bing.com?q={1}.

Next you create a script button that has just one script action "refresh HTML Viewer" and points to the ID of your HTML Viewer. If you click this button the url view will refresh using the content of your input field.

To also remove the click and trigger the update on pressing enter in your input field, you select you input field, and click on the little chain icon on the far right side of your edit bar. This allows to link the action of a button to the OnEnter handler of the input field.

Hope this helps,

Tobias.

Former Member
0 Kudos

Got it! Thanks alot!

Former Member
0 Kudos

Hi Tobias,

did exactly like you described, but somehow why HTML control doesn't get filled up.

My HTML control is defined as follows :

The control ID is the Input Field linked to my script button (who has only the refresh HTML viewer step).

Neither if I press Enter on the input field, or push the script button, nothing is shown in my HTML Control.

What is missing ?!

Regards

Bart

0 Kudos

Hi Bart,


Are you able to view any web site at all in your html viewer? Just create a html viewer, and add eg. www.sap.com

And which personas version you are on? In personas, after you have connected to any system, click on the "question mark" button on bottom right. You will see the version number.

Also, your query string should be something like this:

http://www.bing.com?q={1}

Regards,

Sushant


Former Member
0 Kudos

Hi Sushant,

if I just create a HTML Viewer and add for example http://www.sap.com, it shows perfectly in the HTML viewer on the page.

We are currently running version 1.2.016.

About the query string :  I saw the typo yesterday , but somehow even after changing that, to http://www.sap.com?=q{1} and adding that key in the HTML Viewer, it doesn't seem to work.

The script button to trigger the change :

And this button is triggered on enter a new URL in an input field on the screen :

Also, both URL I'm using are in the whitelist.

The SAP URL is showing when I test it, but after entering a new URL, the HTML viewer doesn't change.

Regards

Bart

0 Kudos

Hi Bart,

Double click on your html viewer and can you share what you have there?

And how are you triggering the script button?

Regards,

Sushant

Former Member
0 Kudos

Hi Sushant,

ok, the following I have on my screen :

- a script button that sets the value of a website into an input field :
 

- my inputfield (which get the value from the above script)

- my HTML viewer :

 

- a script button that is linked to my inputfield which does (or should do) the refresh of the HTML Viewer

So when I push the button 'Change HTML control', the value of the input field is changed correctly, but the HTML control keeps showing www.sap.com ...  instead of changing it to www.bing.com .

Regards

Bart

0 Kudos

hi Bart,

you are not triggering the script button which actually refreshes the HTML viewer.

Could you please add an action "refresh html viewer" in your script button "Change HTML Control" as a 3rd action

OR

as a 3rd action you can also add a PUSH action to call your another script button which in your case refreshes the html viewer.

For simplicity, you can just have a textbox where user can type in any URL and then add the script button which refreshes your html viewer as "pushonenter" property for the textbox. So, when user type in any URL and hit enter, your script button will be trigered which in turn will refresh the html viewer.

Let me know if that helps or you need more examples.

Regards,

Sushant

Former Member
0 Kudos

Hi Sushant,

tried the different possibilities you gave me, but not one succeeded to refresh the HTML.

If I simply try the input field with the script button for refresh and the Pushonenter propertie, I see a fast 'refresh' of the page but the HTML Viewer stays on the initial page.

Could you paste some screenshot to compare them with what I have ?!  Thanks in advance.

Regards

Bart

Former Member
0 Kudos

Hi Tobias,

apparently after installing some additional notes and recently the SP01 for 2.0, I got to see some changes.

But, I want to be sure that it's now correct in the way how it's supposed to work :

- created an input field were I can enter a URL and added a script button to refresh the HTML viewer

- created a HTML viewer with url :  http://www.bing.com?q={1} and binded the value of the input field

Result :  starting the page I get to see the Bing site with no value in the search field.

Entering an URL in the input field and push the script button, I now get the search result for my URL I enter.

So in fact it's some kind of automated search functionality ...

(although I thought that the URL in the HTML viewer would have changed into the new URL).

Regards

Bart

TobiasQueck
Advisor
Advisor
0 Kudos

Hi Bart,

The url field defines what is shown in the html viewer. If you bind it to static string, then always the same should be shown. If you want to change the url (and therefore the content) of the html viewer you can use these bindings {1} {2} ... to replace parts of the url with content taken from your screen. If you want to exchange the full url, try http://{1} and bind one to your input field. Then enter www.bing.com or www.sap.com or ...

Cheers,
Tobias.

Former Member
0 Kudos

Hi Tobias,

thanks a lot !  This is exactly the behaviour I wanted.  That solved my issue .

Regards

Bart

Former Member
0 Kudos

Hi Tobias,

One question here.

I am in MM02, and I want to display MMBE as part of the screen. I am using HTML viewer and the url I am using is

http://server:port/sap/bc/bsp/persos/mainapp/index.html?~transaction=MMBE%20MS_MATNR-LOW%3D1100292%3...


I have added following to whitelist


server:port/sap/bc/bsp/persos/*

server:port/sap/*


My HTML viewer control has url http://{1}. Key 1 is linked to an input field containing url. PushOnEnter event of the input field triggers a script that refreshes HTML control. I am getting following error.

SAP HTML Control
An error occured during SAPR3 page downloading: http://server:port/sap/bc/bsp/persos/mainapp/index.html?%7etransaction=MMBE%2520MS_MATNR-LOW%253D1100292%253BDYNP_OKCODE%2520ONLI
The scecified url is not in the white list.
Please, contact yout system administrator.


Can you please help me with this?


Regards

Abhi

Former Member
0 Kudos

Hi Richard

It seems you have managed to use this in your scenario successfully.

Can you please share the same, since I am having an issue with the

dynamic url for the HTML Viewer.
The button does not trigger a change of URL as suggested by Tobias.

Regards

Answers (0)