cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling,Disabling UI Eements

Former Member
0 Kudos

Hi Experts,

When my screen my loads, input field should be disabled by default.

After selecting button , the input field should be enabled. I created context attribute of type boolean and mapped it to the input field.

Please suggest me the code which i need to write.

Thanks a lot.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Srini,

You can set the enabled property for the input field to 'false' initially.

On click of button, the associated click event for the button onAction.. is called. There you need to set this property to 'true', code is like wdContext.currentContextElement.setEnabled(true);.

Kind Regards,

Nitin

Former Member
0 Kudos

Hi Nitin,

Thanks a lot. It worked.

One more question. If the action is getting triggered from Radio button by index, then also this code is working.

But while passing action do i need to create two separate pairs of radio buttons with independent actions so that i can navigate back to any radio buttons and the actions will be triggered accordingly.

Please suggest.

former_member197348
Active Contributor
0 Kudos

Hi Srini,

You can try like this:

In onSelect action, get the value of the radiobutton value and then process it.

//compare the value of the radiobutton

if( wdContext.current<RBnode>Element().get<keyattribute>().equalsIgnoreCase("RBcode1"))

{

//do whatever you want

}

else if( wdContext.current<RBnode>Element().get<keyattribute>().equalsIgnoreCase("RBcode2"))

{

//do whatever you want

}

Remember this event is triggered only if you select the radiobutton manually

Regards,

Siva

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Srini,

In general, you can refer to UI Element Guide on SAP NetWeaver Library

http://help.sap.com/saphelp_nw70/helpdata/EN/9f/656442a1c4de54e10000000a155106/frameset.htm (7.0 release)

Kind Regards,

Nitin

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b06c8c9a-19a4-2b10-d985-9ae7a438... (CE 7.11 release pdf)

Edited by: Nitin Jain on Mar 13, 2009 7:47 AM

ravindra_bollapalli2
Active Contributor
0 Kudos

hi

check this tutorial

bvr

Former Member
0 Kudos

Hi...

if you want to disable and enable UI element at time page load..so you have to

create conext atrribute as datatype should be Boolean...

thant attribute binding to your inputfield....

set input property like enabled as boolean attribute like InputField.....

Wdinit(){

//load time----input field Disable

wdContext.currentContextElement().setInputFieldEnable(false);

}

then supose you action onActionSet(){

.

...........

//input field enable

wdContext.currentContextElement().setInputFieldEnable(true);

thanks

sjati

}

Former Member
0 Kudos

on the onAction of the button method change the value of the context attribute

e.g. - wdContext.currentContextElement.setInputFieldEnabled(true);

Former Member
0 Kudos

Thanks a lot. It worked.

One more question. If the action is getting triggered from Radio button by index, then also this code is working.

But while passing action do i need to create two separate pairs of radio buttons with independent actions so that i can navigate back to any radio buttons and the actions will be triggered accordingly.

Please suggest.