Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL
Expertise: Beginner
Mar 21, 1997

Button no longer closes a form. Is this a bug?

Question:
I have a cancel pushbutton with the IsDismissBtn property set to True. When I first created the form, the push button dismissed the form. I added some code to prompt the user for confirmation that they wanted to really close the form, and now the push button no longer closes the form. Is this a bug?

Answer:
No, this is not a bug. Your problem stems from the object-oriented nature of OPO and a lack of documentation, but hey, that's what I'm here for.

When you set the IsDismissBtn property to true, it makes the base class for the push button call the DismissModal() method for the push button's container in the Click() method. When you add code to the Click() method of your push button, it automatically overrides the inherited functionality of the base class's Click() method. You can fix this by using the code Inherited.Click() at the appropriate place in you code or you could just call the DismissModal() method yourself.

Remember, some of the methods in your OPO objects have inherited functionality, so if you add code to the method of your object instance without calling the inherited method, you will override the default functionality. For instance, if you add code for the InsertRow() method for a container and forget to call the inherited InsertRow() method, you will find that the Insert push button no longer clears all of the bound objects in your form. This action is done by the inherited InsertRow() method.

If you are unsure as to whether it is necessary to call an inherited method, you can always call the inherited method. If there is no method to inherit, you will get a compile error, but this is preferable to scratching your head and wondering where the functionality went.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date