on 10-19-2010 8:27 AM
Hi ,
what is the code to disable a button? I want to write a code in the event of button, in order to disable a button.
Thanks
Hi,
bind the ENABLE property of ur button to a context attribute of type WDY_BOOLEAN . Inside ur method, set the context attribute using SET_ATTRIBUTE METHOD , code wizard(control+f7) to ' '(blank) for disable and 'X' for enable of the button.
regards,
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi..
I am not very clear with your requirement..er...
However, in order to disable the button, at least you have 2 ways:
(1).Use Context Attribute bound to the Button
This attribute has type "Char1" or "abap_boolean", which will be bound to the "Enable" property of button.
Enable the button:
set the attribute = 'X'.
Disable the button:
set the attribute = ' '.
(2).Use the CL_WD_BUTTON runtime class.
At runtime you can disable it. But you should use the "view" parameter..For example in the WDmodifyView method (or you can save the "VIEW" as a virable in WDModifyView):
you can
lo_button = view->get_element( 'BUTTON' ).
lo_button->SET_ENABLED
Best wishes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
it might be a better idea to bind the attribute 'enabled' to a context attribute of type wdy_boolean
and then change the value of the context attribute.
Greetz,
Koen
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.