cancel
Showing results for 
Search instead for 
Did you mean: 

Enable/Disable Caption on event in Webdynpro

Former Member
0 Kudos

I have created a view in which user enters his/her logon credentials . I want that if he enters wrong data the caption saying "Wrong ID/Password" gets enabled. How can i do that by writing code in Webdynpro event. Kindly Help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Varun,

Caption UI element has 'ENABLED' property with which you can play as you wish.

1. Create an attribute of type WDY_BOOLEAN

2. Bind this to the ENABLED property of caption

3. Write code to enable/disable the attribute

But for your scenario reporting an error message should be better than enabling a caption.

Answers (2)

Answers (2)

Former Member
0 Kudos

And how to change the text  of caption via coding. I tried it by binding the text to a context attribute of type string but it isn't changing.

Former Member
0 Kudos

The way you are doing it is Correct.

'Text' is a bindable property. And hence it should work.

Just try activating the app and put a break point to check if the code is executing.

chengalarayulu
Active Contributor
0 Kudos

Varun,

there is no other way to validate entered credentials except onEnter of usrid input / password input or Login/Submit button.

am not sure is there any onKeyPress or any other events exists for this criteria.

For caption, just create a Group and you bind the context attribute to text property of Caption of group, then you can change text according to your requirement.

else, you can directly report error message.