cancel
Showing results for 
Search instead for 
Did you mean: 

making input filed readonly

Former Member
0 Kudos

i have one input field and one button

when i press on the button, i need the input field must become read only

can any body help me in this regard.

Thanks

Shaik Shadulla.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

closed

Former Member
0 Kudos

hi,

follow the steps:

1. Make a Context Attribute named ca_a1 under ur Context.

2. Change the type of this Attribute ca_a1 from String to Boolean.

3. Bind this to the Input field.

4.In the OnAction of Button write wdContext.currentcontextElement.setca_a1(false).

This would Change the input field to Read only.

I hope this would help you.

Thanx.

Former Member
0 Kudos

Hi,

1. Create a new context value attribute, for example IsReadOnly of type boolean.

2. Bind the readOnly property of the Inputfield to this context attribute.

3. In the onClick event handler method of the button write the following code:


wdContext.currentContextElement().setIsReadOnly(true);

Regards,

Satyajit.

Former Member
0 Kudos

Thanks satya,

but when i am using

wdContext.currentContextElement().setIsReadOnly(true);

i am getting error plz help me out....

Thanks,

Shaik Shadulla.

Former Member
0 Kudos

Hi, whats the error?

Former Member
0 Kudos

method:

method ONACTIONCLICK .

wdContext.currentContextElement().setIsReadOnly(true);

endmethod.

Error:

Method ONACTIONCLICK

The statement "WDCONTEXT" is not expected. A correct similar statement

is "CONTEXTS" . . . .

Former Member
0 Kudos

Your method should be :-

public void onActionClick(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionClick(ServerEvent)

wdContext.currentContextElement().setIsReadOnly(true);

//@@end

}

Former Member
0 Kudos

Hi,

Are you working with WebDynpro Java or WebDynpro ABAP?

Regards,

Murtuza

Former Member
0 Kudos

Hello Murtuza,

i am working with abap, i got solution now.

Thanks,

Shaik.

Former Member
0 Kudos

>

> i am working with abap, i got solution now.

>

> Thanks,

> Shaik.

Hi Shaik,

Could you please close this thread, Since this is webdynpro Java Forum and you have already found solution reg the above WDA problem?

Regards,

Anagha

Former Member
0 Kudos

Hi,

Create an attribute of type boolean and bind this attribute to the enabled property of the input field. Set its value to true initially in wdDoInit() and on click of the button's action set this boolean attribute to false.

Regards,

Murtuza