cancel
Showing results for 
Search instead for 
Did you mean: 

Screen Personas 3, Script Events in gray

Former Member
0 Kudos

Hello,

I want to create an Onclick event when I press in a image. but after insert an image an click on it, the Script Events button is in gray.

It's a bug?

Best regards.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Asier,

The current script functionality has very clear guidelines that are outlined in this thread Available Events for Scripting - SAP Imagineering - SCN Wiki

Here is the part I found useful when I encountered your problem:

GuiPicture:

Property: "onClick"

Defined in: GuiPicture

Event: "onClick"

Description: "JavaScript that is executed when someone clicks on GuiPicture. Only custom GuiPicture controls can have an onClick handler script."

Handler Signature: onClick(GuiPicture source)

So basically, if it isn't int he form of a 'GuiPicture' element you cannot bind a script to it. I tried using the script editor both manually and using the recording and I could no bind to this element, it simply did not detect it.

Poential workarounds...

The advice does list 'GuiPicture' so I suppose you could use the normal ABAP way of putting a picture into a screen and then bind a script to it. I found this with a quick google search Explore...ABAP: How to display a picture in a SAP screen

In addition, I found this link Scripting API - SAP Imagineering - SCN Wiki

Perhaps there is a way of using javascript to detect a click on a certain part of the screen, I found this extract from the SCN wiki link I posted

'

clickControlArea(int x, int y)voidSingle click in the control at a given position within the control area (unit: pixel).
clickPictureArea(int x, int y)voidSingle click in the displayed picture at a given position in the picture coordinate system (depending on display mode this doesn't necessarily have to be the same as pixel coordinates). The coordinates always refer to the position within the original unscaled image.

However, this is way beyond my knowledge of Personas and javascript, but it might push you in the right direction.

Let me know if it helps you,

Cheers,

Angus