cancel
Showing results for 
Search instead for 
Did you mean: 

Change labelof Text field dynamically

former_member622551
Participant
0 Kudos

Hello,

Do you know if it is possible to change the label of a Textfield dinamically?

I thougt that it would be possible with javascript with something like :

this.label = "New value";

but it does not work.

Could you help me?

Thank you very much.

View Entire Topic
pavan_prabhu
Active Participant
0 Kudos

Hello Javier,

     Yes it is possible.


Please follow the steps below.

If LABEL is the name of the text field, then you can use Javascript as below.


this.LABEL.rawvalue = "new_value";


But I would suggest you to do this at the Interface level or in the driver program by storing the new value in a standard text in SO10 T code and then read it using READ_TEXT Function Module. Then bind the text field with this fetched value.


former_member622551
Participant
0 Kudos

Maybe I have not explain myself very good.

I have the next:

Price: 2,20

I want to change the text of the label, in this case Price and get the next:

Price: 2,20

or

Preis: 2,20

or

Precio: 2,20

Pavan, I don't have the option to use this.label.rawValue. because label is not in the valid options of this.

Thank you very much!

pavan_prabhu
Active Participant
0 Kudos

Hello Javier,


     Can you tell me how are you filling the label right now? Is it hard coded in the Layout? Or you have binded it with a standard text?

former_member622551
Participant
0 Kudos

I solved it.

I created a new variable in the interface with the data that I wanted and write in the binding of the field.

Thank you very much Pavan.