cancel
Showing results for 
Search instead for 
Did you mean: 

Script PERSONAS : How to get ID of input field?

alexandreourth
Active Participant
0 Kudos

Hi script experts,

I have several customer buttons on my screen. I want to bind the same script to all my buttons and inside this script, i will check the Id of the input field which has been pushed and do something according to the button.

How can i get the ID?

Regards,

Alexandre

Accepted Solutions (1)

Accepted Solutions (1)

alexandreourth
Active Participant
0 Kudos

Answer :

alert(source.id)

Why this element doesn't show when we do Ctr+space? This editor is quite disturbing...

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

I'm not sure I understand what is the problem here... any control's ID is available either via the Object Picker in the script editor or by selecting the control and displaying its properties in the Advanced Property window.

alexandreourth
Active Participant
0 Kudos

Maybe my english is not perfect that's why you didn't understand 🙂

What i was trying to achieve :

Button 1 => script "JUMP_TCODE"

Button 2 => script "JUMP_TCODE"

Button 3 => script "JUMP_TCODE"

Script "JUMP_TCODE"

var button1   = session.findById("wnd[0]/usr/txtPersonas_152112903982052");
var button2   = session.findById("wnd[0]/usr/txtPersonas_152112903982053");
var button3   = session.findById("wnd[0]/usr/txtPersonas_152112903982054");

switch (source.id) {
    case button1.id:
      .....
      break;

    case button2.id:
      .....
      break;

    case button3.id:
      .....
      break;
}

"source.id" was the command i was looking for. And i was pointing out the fact that the command "source" was not available with Ctr+space.

Answers (0)