cancel
Showing results for 
Search instead for 
Did you mean: 

How to modify an individual field property, in webdynpro, at runtime

former_member201275
Active Contributor
0 Kudos

I am new to webdynpro so I apologise in advance for my stupid question.

In the webdynpro I have a view called VSELECT with 2 buttons i.e. CREATE and CHANGE which when clicked goes to the view VCHANGE_CREATE.

I want to change the property of 1 of the fields depending on whether CREATE or CHANGE has been clicked.

So, for example, I have field ZCONTACT and when CREATE is clicked it goes to the view VCHANGE_CREATE and all the fields, including ZCONTACT are cleared out and the user may enter new data on the screen.

When I click CHANGE it goes through to the same view VCHANGE_CREATE with all the data (it doesn't clear down) and then the user can amend the fields they want.

What I want to achieve is to have the ZCONTACT (which is an InputField) is to have the readOnly checkbox ticked if the CHANGE button is selected, but readOnly to be unticked if CREATE is selected.

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

create a context attribute isReadOnly of type 'wdy_boolean' and bind that to the readOnly property of ZCONTACT.

And change the value of isReadOnly based on which button is clicked whether CHANGE or CREATE.

if CHANGE is clicked, in the event handler, change the value of isReadOnly to abap_true/abap_false. Do the same thing in the event handler of CREATE button.

Hope this helps!

Regards,

Srilatha

Edited by: Srilatha M on Jun 24, 2010 9:59 AM

Answers (2)

Answers (2)

former_member201275
Active Contributor
0 Kudos

Thank you both!

Works perfectly.

Former Member
0 Kudos

You can bind the checked property of checkbox to a context attribute of type wdy_boolean, and then manipluate this attribute values with your views actions.