cancel
Showing results for 
Search instead for 
Did you mean: 

Screen Personas 3.0 Change Backgroundcolor of a flavor via Scripting

0 Kudos

Hi Experts,

is there a way to change background color of a flavor dynamically with Javascript ?

I want to change backgroundcolor depending of the system-id.

Thanks and regards.

Juergen

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You can indeed. Use the object inspector in the scripting tool to select the object you want to change - the GuiUsrArea I presume? Scroll down to the end of the list of properties for the object to the ones in blue with the {} icon. You'll find backgroundColor among other properties you can change. Click on the {} icon to insert the necessary code to change the property. Specify colours in in hexadecimal RGB - so "#ff0000" is red, for example.

Steve.

0 Kudos

Thanks, Steve, I did as you said, but as below:

I clicked on object inspector and on the background but I couldn't find the {}-icon.

Can you help finding me ? Thanks in advance

Former Member
0 Kudos

Interesting. Are you up to date with the personas client and kernel patches? It is possible this functionality appeared fairly recently.

Steve.

0 Kudos

we got base release 740 SP11. Can you tell what is necessary ?

regards Juergen

Former Member
0 Kudos

I don't know exactly when this functionality appeared. I would update the Personas client note  - 2179045 - to the most recent. Mine is currently version 17. And install the latest kernel - I'm at kernel patch level 226.

Or alternatively, install service pack 02, which requires at least kernel patch 300.

Either of those should get you to a version at least as new as mine. If you don't see this after that, then we might need somebody from SAP to jump in and explain!

Steve.

0 Kudos

Great, it worked due upgrade. Thanks a lot, Steve.

0 Kudos

Hi Steve,

is it also possible that the backgroundcolor

will be remaining when I change the transaction.

My script ist working only for the present trancation.

I am looking for a solution changing the backgroundcolor

for all transaction per system.

Thanks and regards

Jürgen

Former Member
0 Kudos

This change is per-flavour. To make the change globally you'd need to do it in a theme and programatically select a theme to match the system. You could do that in the onLoad event of SMEN so the theme selection happened upon login. That would then persist across all subsequent transactions, unless somebody changed the theme manually.

I can't immediately think of another way to get the result you're looking for.

Steve,

0 Kudos

Thanks, Steve, could you please explain how to call a theme in a script.

I only know to change the flavor.Regards Jürgen

Former Member
0 Kudos

You're right, you can't. Sorry, my mistake. I thought I remembered seeing an appropriate function, but obviously my memory is playing tricks on me.

Although it seems to me you should be able to. session.utils.changeTheme anyone? What do you think or ?

Steve.

0 Kudos

unfortunately there seems to be no entry for flavor when I read the list pressing STRG SPACE after session.utils.

Regards Juergen

clemens_gantert
Active Participant
0 Kudos

Hello Steve, hello Jürgen,

we are currently not planning to introduce a scripting method to set themes. I want to point out that you can assign a particular theme to a set of transactions, even with wildcards, in theme maintenance (accessible through /PERSONAS/ADMIN).

Cheers,

Clemens

0 Kudos

ok, thanks, Clemens.