CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Show error message from a data module

by sgaravatti » 06 Feb 2015 18:00

Hi everyone,
I am rewriting a VCL application, trying to keep the old business logic but rewriting the interface with IW and CGDT.

The data module part used to be independent by the forms, not linked to, and the communication of info and errors was by exceptions and popup boxes.

I wish to find a way to give messagges (or exception) to the user, this from the data modules, by calling something like IWApplication.ShowMessage
but i also would like to display Cgdevtools controls in it, not display just the simple Alert(),
let's say showing a TIWCGJQDialog from IWServerControllerBaseException, this is to give the idea.

I'm using C++ Builder XE3, IW 14.0.36 cg 2.4.119,

I would wellcome any idea or suggestion.
CG 2.6.0.86
IW 14.0.41
C++ Builder XE3
sgaravatti
 
Posts: 24
Joined: 22 Aug 2014 09:20

by Jorge Sousa » 06 Feb 2015 18:22

Hi

let's say showing a TIWCGJQDialog from IWServerControllerBaseException, this is to give the idea.


Yes, you can use the event ServerController.OnException, just make sure that AApplication parmater is assigned, and return Handled=True if its the case.

There you can show a dialog or show any of message components we have.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by sgaravatti » 09 Feb 2015 14:15

Can I do that without referencing the form?
I have many, and in the server controller the only way i would have to know witch form am I using is creating a custom exception class.
Also, it would be more clean if I could write there a general way to handle exceptions
CG 2.6.0.86
IW 14.0.41
C++ Builder XE3
sgaravatti
 
Posts: 24
Joined: 22 Aug 2014 09:20


Return to General

cron

Who is online

Users browsing this forum: No registered users and 9 guests

Contact Us.