on 01-15-2008 2:06 PM
Hi!
How can I disable the a button ?
There is a if statement. If it returns a false the button must be disabled.
Regards
sas
Edited by: erdem sas on Jan 15, 2008 3:06 PM
Edited by: erdem sas on Jan 15, 2008 3:16 PM
Do it thru its action:
//Deactivate a button disabling its action
//You can see it but clicking it does nothing
wdGetACTION_NAMEAction().setEnabled(false);
//Get it's funcionality back
wdGetACTION_NAMEAction().setEnabled(true);
Or you could hide it using an attribute of type WDVisibility binded to its visible property.
//Hide it
wdContext.currentContextElement.setATTRIBUTE(WDVisibility.NONE);
//and Show it
wdContext.currentContextElement.setATTRIBUTE(WDVisibility.VISIBLE);
Regards.
Julio Herrera.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Or else you can make use of the predefined UI element data type "Visibility" from the list of data types under the UI element properties.You can disable the button or also you can hide the button totally according to your requirement.create a attribute and selcect the data type as "visibility" from the list of com.sap.uielementpropeties.Bind this to the attribute to the visibile property of the button.If you are making use of boolean then you can make it active or non active if you are making use of the visibilty data type then you can do many things to display or hide or hide with button occupying space occupying on the view.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi erdem,
Bind the "enable" property of button to a boolean context attribute say "enabled".
Now in your if condition if you want to disable it use the following statement
wdContext.currentContextElement.setEnabled(false);
Regards,
Praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Sas
1) Create a boolean value attribute ,say isEnabled
2) Bind that to the enable property of the button
3) Depending upon the condition make the changes
ex: wdContext.currentContextElement.setIsEnabled("true");
or
wdContext.currentContextElement.setIsEnabled("false");
Best Regards
Chaitanya.A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can disable the action assigned to "onAction" or bind the "enabled" property to a context attribute and set its value to false. You can also use a calculated context attribute and implement the condition in the get-method.
Armin
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 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.