Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding containers to forms and error trapping
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00193129
Message ID:
00193177
Views:
19
>>>I am using the technique of adding containers to pages on pageframes when the user selects the page the first time.
>>>If the container has an error in any control in the container, the conainer is not shown. I want to be able to continue and see the error. I am able to do this if I put my container (with the error) on a form at design time. Adding to to a form at run time fails.
>>>Any Suggestions?
>>BTW, the control with the error is a combo box. I intentionally gave it an array name that does not exist.
>
>Hi John,
> As I understand it, when a composite object instantiates the Init methods of its contained objects fire from the inside out and any one that fails causes the entire object to fail to instantiate. The only out I can think of would be to manually build your object at run time via AddObject(By this I mean that each successive object is added by an AddObject call.) If you create the composite at run time, you can check for successful creation of each object and handle any failures as you wish.
> Its a little complicated, but that's my 2 cents.
>
> P.S. If you are interested in generalizing this approach then look into the Factory design pattern.
>
>HTH,
> Ned Ames


Why does this work for a textbox? I can put a textbox on the container with an invalid controlsource and trap for the error and allow my container to be instanciated.

-John
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform