on 10-29-2007 1:15 PM
Hi,
There is an interface IF_WD_VIEW_ELEMENT inside the class CL_WD_BUTTON whi has two methods: GET_ID and GET_VIEW.
My problem is i have to get the ID of a button at runtime inorder to get the text associated with it. can anybody pls let me know how to get that?
Points will be rewarded
Regards
raghav
Hi,
if you need the id when clicking it,
you should only add ID type string to the importing parameters of the action handler,
from there you can work via view->get_element(id).
grtz,
Koen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
when you create an action to your button, in the on action parameter, you put a name for the action.
the system creates in the view an action handler with name onaction<name>
there in the signature of the method, you find parameters, the wdevent is always
there, add a parameter with name ID type string.
data: lo_button type ref to cl_wd_button,
lv_text type string.
lo_button = wd_this->m_view->get_element( ID ).
lv_text = lo_button->get_text().
grtz,
Koen
Dear Koen,
Thanks a lot!!
Finally I am able to resolve the issue with your help!!
But why I tried your last posting still i was getting error!!
"lo_button = wd_this->m_view->get_element( ID )."
i did a minor correction to the above statement as follows:
lo_button <b>?</b>= wd_this->m_view->get_element( ID ).
-
But to my surprise what is the purpose of the method <b>IF_WD_VIEW_ELEMENT~GET_ID</b>? When can we use this?
This is just for my information.
If you have time, please let me know
Thanks & Regards
Raghav
Hi,
that is more eg:
lo_inputfield = cl_wd_input_field=>new_input_field( ).
lv_id = lo_inputfield->get_id( ).
lo_label = cl_wd_label=>new_label( for = id ).
if you generate your ui-elements and you don't bother about the id's,
but like in the example you have to add a label to the inputfield,
you can get the id of the just created inputfield like this
grtz,
Koen
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.