cancel
Showing results for 
Search instead for 
Did you mean: 

Disable a field.

Former Member
0 Kudos

I want a infut field to be disabled based on some condition.I know if i bind the read only property of the field to context and set value in that i can do that. But i want to do it programmitically. Any one have any idea about this.

Points will be rewarded.

Thanks,

Prosun

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182372
Active Contributor
0 Kudos

in wddomodifyview (and only there as recommended) you can get reference to ui element object and call set_enabled method. I don`t really iunderstand why do you need it because binding and context manipulation is recommended and more flexible way to implement this.

Former Member
0 Kudos

I have a table input field on clicking the checkbox i have to disable a cell. I am populating this table through a service call so it is not allowing me to add a field for enable/disable in the same context. If i create another context and bind with table then gettting corresponding value will be hecitc job. It is better if i can enable /disable it though code.

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi Prosun

Disabling the cell in all rows is easy, however disabling only one particular cell is not that easy..

Better you create the context node and copy all the values, i am sure it is easier than dynamically disabling the cell.

Nyways!!

You have to use Cell Variants if you want enable/disable dynamically, but for that also you need an extra attribute in the context node to store the cell variant.

So I suggest you to create a new context node and copy.

Regards

Abhimanyu L

Former Member
0 Kudos

Hi Prosun.

As already suggested you can solve this by using cell variants and I would prefer this instead of copying context nodes.

Read the last post of this thread:

https://forums.sdn.sap.com/click.jspa?searchID=4650262&messageID=3679178

on how to solve it.

Also have a look at component <b>WDR_TEST_TABLE</b>. In view <b>VARIANTS_STANDARD</b> is an example how to use cell variants.

If you have more questions pls come back.

Cheers,

Sascha

Message was edited by:

Sascha Dingeldey