cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable and disable the buttons in web dynpro?

Former Member
0 Kudos

Hello all,

Please help me on

How to enable and disable the buttons in web dynpro?

Thanks in advance,

CSP

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hey,

Define Variable in context of Type Visibility from ur WD dictionary.

And bind this variable to ur button UI Element property Visible.

Goto your Initmethod of your program add the following code.

require to hide add this.

Wdcontext.CurrentContextElement().setVarname(WDVISIBILITY.NONE);

Require to display

Wdcontext.CurrentContextElement().setVarname(WDVISIBILITY.VISIBLE);

This might helps u.

Thanks,

Lohi.

Former Member
0 Kudos

Hi

Create a context attribute of type "Boolean".

In the button properties there is an property called "Enabled".

Bind that created context attribute with that property.

So whenever the context attribute is made as "false" it gets "disabled" and if "true" na it get "enabled".

Regards

Chandran S

Former Member
0 Kudos

Hi Pradeep, In wdDoModifyView() you can get the Button by specifying the name of the button



Gets the button with id Button1 and the second line makes it editable false

IWDButton btn1 = (IWDButton)view.getElement( "Button1");
btn1.setEnabled( false);


Gets the button with id Button2 and the second line makes it editable true


IWDButton btn2 = (IWDButton)view.getElement( "Button2");
btn2.setEnabled( false);

Regards - Vinod *

Edited by: Vinod V on Mar 4, 2008 10:08 AM

Former Member
0 Kudos

That's the way not to do it.

Armin

Former Member
0 Kudos

Either bind the "enabled" property to a context attribute or just change the enabling of the assigned action.

Armin

Former Member
0 Kudos

Hi,

You create an attribute of boolean type and map it to enabled property of the button.

Now for enabling it use:

wdContext.currentContextElement().setEnableButton(true);

for disabling it use:

wdContext.currentContextElement().setEnableButton(false);

thanks & regards,

Manoj

Former Member
0 Kudos

hi,

Create an attribute of type boolean bind this to the enabled property of your button

based on your condition set the value of the context attribute to true/false

Ex: Lets say Enabled is the attribute of type boolean

wdContext.currentContextElement().setEnabled(true);

Regards

Ayyapparaj