cancel
Showing results for 
Search instead for 
Did you mean: 

Make Input field readonly at run time.

Former Member
0 Kudos

Hi,

I have a input field on a view , i want to make it <b>readonly</b> during run time depending on some value.

plz help. reward point is sure.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Create a boolean attribute and bind it to the input field's readOnly property .And you can change the property at run time.

Kind Regards

Mukesh

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks to all of you . my problem has been solved.

Former Member
0 Kudos

Hello Manoj

You can also make the input field readOnly dynamically during run time. For this you need to write a simple code in wdDoModifyView of your view controller. Code is as follows

IWDInputField inputField = (IWDInputField)view.getElement("<id of inputfield>");

if(<reqd condition>)

{

inputField.setEnabled(false);

}

else

{

inputField.setEnabled(false);

}

Try this, if things donot get much complicated on doing this. I hope it helps u and makes thing simple.

Regards

Kapil

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Create an attribute with type boolean.

Then bind this to readonly property of the inputfield.

then check the condition and set that attribute to true.

wdContext.CurrentContextElement.setReadOnlyAtt(true);

Regards,

Vijayakhanna Raman