on 03-09-2009 1:08 PM
Hi,
I need to activate/deactivate buttons at runtime in method WDDOMODIFYVIEW.
I have tried the following:
DATA:
lr_button TYPE REF TO cl_wd_button.
lr_button ?= view->get_element( id = 'APPROVE' ).
lr_button->set_enabled( value = abap_false ).
I get the following error message: "Dynamic type conflict when assigning references"
Thanks,
Morten
Hi Morten,
Can you check in debug mode the exact line of code causing error ? to me it seems that its happening not in the line of code you pasted above.
Greetings
Prashant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First I strongly recommend that you not use coding in the WDDOMODIFYVIEW to control the enabled flag of such a UI element. Instead just data bind the enabled property to a context attibute and change the value of the context attribute to control the button state. This is the suggested way. WDDOMODIFYVIEW should only be used as a last resort to manipulate totally dynamically generated UIs. Otherwise design time binding should always be used.
Your specific error would seem to be coming becuase the UI element with the ID APPROVE isn't being returned as a button, I would guess. That would explain the type conflict. Make sure that APPROVE really is the button's ID and that you haven't accidentally chosen a different UI element. In order to debug you could declare lr_button as type ref to CL_WD_UIELEMENT. This is the generic super class and should avoid the type conflict. From the debugger you can see the sepecif class type that was passed back by GET_ELEMENT.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
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.