cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable a disabled text edit UI element, based on dropdown operation?

Former Member
0 Kudos

How to enable a disabled text edit UI element, that is default the text edit UI element should be disabled, and if the user selects some value from the dropdown, the text edit UI should be enabled.

If the user doesn't do any operation with dropdown the text edit element should be in the disabled state itself.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

check the following thread

regards

ambicasony

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Thanks Prabhakar

Former Member
0 Kudos

Thanks Prabhakar,

Could you help me with giving a sample code.

Regards,

Suresh

Former Member
0 Kudos

Here is the code...

In doInit() place this code...

public void wdDoInit()
  {
    //@@begin wdDoInit()
    
	wdContext.currentContextElement().setTxtenable(false);
	    //@@end
  }

In onAction method of DropDown UI Element, place this code..

public void onActioncompanyselect(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin onActioncompanyselect(ServerEvent)
    		wdContext.currentContextElement().setTxtenable(true);
        //@@end
  }

Where,

->'Txtenable' is a boolean attribute which is bound to the 'enabled' property of TextEdit UI Element.

regards,

Prabhakar.

Former Member
0 Kudos

hi soniya,

How to enable the disabled Text edit UI dynamically, if the user selects the value from the dropdown?

regards,

Suresh

Former Member
0 Kudos

Hi,

Have an attribute of Boolean type in the context, and bind it to the 'enabled' property of the TextEdit UI Element.

In the onSelect action of dropdown, write code to change the boolean attribute's value to 'true' or 'false' as required.

regards,

Prabhakar.