cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Screen Personas

manukapur
Active Participant
0 Kudos

Hello Experts,

Is there  a way in which we can modify the properties of the on screen controls with the script? I mean making a control visible /invisible on the basis of a condition?

Regards,

Manu

Accepted Solutions (1)

Accepted Solutions (1)

manukapur
Active Participant
0 Kudos

Thanks Steve. At the moment I have taken the Icon off and I am clearing the text of the button and also disabling the button depending on the flag.

I feel, somethings are very simple to do Personas, but others really not.

Regards,

Manu

TobiasQueck
Advisor
Advisor
0 Kudos

Steve, Manu,

You are both right: Steve hiding a button/control is not supported in Personas, yet. As usual, I cannot promise a feature for the future but I can promise you that we are watching SCN quite closely and take your feedback into consideration for future versions.

So, now, since you know it is not supported, yet, I show you how you can work around this with a trick

  1. Create a label with no text
  2. Position the label to the left of your button
  3. Make sure it has a higher z-index then the button
  4. Change the background color to the same background as the background of the area behind the button (Note: by default the label background is transparent)
  5. Very important: make sure that the width of the label is NaN.
  6. Now, you can create a script button that enters "        " into the label to hide the button and another script button that enters "" to show the button

So, why is this working? If the label width is NaN then the label will adjust its width based on the input text. Filling the label with spaces will extend it over your button and because of the solid background color your button is invisble and unclickable.

Cheers,
Tobias.

steverumsby
Active Contributor
0 Kudos

Now that is sneaky. I like it

Steve.

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

This is awesome

Former Member
0 Kudos

This is gooood!

former_member228830
Discoverer
0 Kudos

Haha ugly, but I like it! Thx

Former Member
0 Kudos

Awesome. Magic!

Thx

Former Member
0 Kudos

Hi Tobias,

This works ok with SAP Persona index.html URL, however this work around does not work with SAP Persona nwbc.html URL Short link.

Any work around for nwbc.html to hide text /controls?

Regards,

Rakesh Mourya.

Answers (1)

Answers (1)

steverumsby
Active Contributor
0 Kudos

No, there is no Personas script action that can change screen object properties. What are you trying to achieve? There might be a way to do it using a different technique?

Steve.

manukapur
Active Participant
0 Kudos

Hi Steve,

I want to hide a button on the screen depending upon a value (flag).

I have my approve /cancel PO button on Print Preview screen. Now if the user wants to see the preview of the PO then he is accessing the same flavour with the buttons on it.

I tried calling the other flavour using the Javascript, but there are limitations with it. I am not able to switch to the right PO and any script written after the javascript call is not called.

I wish to modify the visible property of the button to collapsed.

Are there any ways to do it?

Regards,

Manu

steverumsby
Active Contributor
0 Kudos

No, there's no way to hide the button. You may be able to re-purpose it, though. You can user "Enter Value" to change the label (but not the icon) and make the script look at your flag and behave differently depending on its value.

I can't think of any other way of doing what you are looking for.

Steve.