on 03-04-2016 10:34 AM
Hey,
I just want to change the text property of a label or a textview at runtime.
Sadly I couldn't apply the solutions I found on my problem somehow.
I got a button which triggers an "onAction"-Event. There I want to change the text of my label.
A promising option was this post
When I used the code:
data lr_lbl type ref to cl_wd_label.
lr_lbl ?= view->get_element( 'LABEL1' ). "label1 is the ID of the label UI element
LR_LBL->SET_TEXT( 'New Text' ).
I got the error that "REF TO" could only be followed by "a class", "a interface" or "DATA".
"cl_wd_label" is a class and there's nothing else following what can cause an error I think.
Does anybody got an idea or just knows how to simply change the text-property of a label at runtime?
Thank you!
Hi,
Instead create one attribute and bind it to text property of that label & set the attribute value as per your requirement.
Thanks
KH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok it works now
I figured out how to change the context attribtue with the help of these three pages.
-> Daten in vorhandene Context-Elemente schreiben - Web Dynpro für ABAP - SAP Library
-> Attribut-Wert eines Context-Elements lesen - Web Dynpro für ABAP - SAP Library
-> SET_ATTRIBUTE method of interface IF_WD_CONTEXT_NODE - Web dynpro ABAP - SAP
Thanks for the help Katrice
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.