cristianotestai Posted May 15, 2012 Posted May 15, 2012 Hi, I'm trying to work with ScreenMask using AddJS, but it does not work. procedure fmMain.Doanything; begin .. UniSession.AddJS('fmMain.UniButton1.showMask('Loading'); .. .. end; But hideMask() works correctly. Any idea? Quote
Administrators Farshad Mohajeri Posted May 16, 2012 Administrators Posted May 16, 2012 Mask can not be displayed in a server event. Quote
cristianotestai Posted May 16, 2012 Author Posted May 16, 2012 Farshad, ok.. but.. I have the following situation: I need to enable the screen mask on the client side after running a procedure in server side, as shown below (only to demonstrate the need..), where it should await the return of the procedure to continue execution. Any idea to enable this? // Client Side { s = 'test'; /*just example..*/ if (s != '') { ajaxRequest(fmMain, 'DoValidUser'); if (uservalid == true) { sender.showMask('loading'); /*the DoValidUser procedure should return true/false for showMask to be executed*/ ajaxRequest(fmMain, 'ShowControls'); } } } // Server Side procedure fmMain.DoValidUser; begin //Valid User Server Side.. end; procedure fmMain.ShowControls; begin //Show Controls Server Side.. end; Quote
zilav Posted May 17, 2012 Posted May 17, 2012 Just add a call to ShowControls inside DoValidUser if user is valid, why are they separate? And why do you want to show a mask ONLY when user is valid? Just show it before ajaxRequest() and hide inside server event UniSession.AddJS('blablabla.hideMask();') What you want in your example is possible, but you'll need to craft url and make an ajax call manually which is not good, because Farshad can change url for events in future versions of framework. Quote
cristianotestai Posted May 21, 2012 Author Posted May 21, 2012 Just add a call to ShowControls inside DoValidUser if user is valid, why are they separate? And why do you want to show a mask ONLY when user is valid? Just show it before ajaxRequest() and hide inside server event UniSession.AddJS('blablabla.hideMask();') What you want in your example is possible, but you'll need to craft url and make an ajax call manually which is not good, because Farshad can change url for events in future versions of framework. hi zilav, I want to show the mask only when the user is valid because it is only this time it is loaded all the home screen, just for this. This was the reason to separate the two functions, because if you are in the same function, would not have given mask in server side after the user validation process. But understand, and for now will do the mask before calling the function and put in a single function. Thanks for attention zilav. Quote
Administrators Farshad Mohajeri Posted May 22, 2012 Administrators Posted May 22, 2012 { s = 'test'; /*just example..*/ if (s != '') { ajaxRequest(fmMain, 'DoValidUser'); if (uservalid == true) { [b]sender.showMask('loading');[/b] [i]/*the DoValidUser procedure should return true/false for showMask to be executed*/[/i] ajaxRequest(fmMain, 'ShowControls'); } } } Where uservalid is set to true? Also ajaRequest() works in background. It doesn't block the current thread. Quote
cristianotestai Posted May 22, 2012 Author Posted May 22, 2012 Where uservalid is set to true? Also ajaRequest() works in background. It doesn't block the current thread. Hi Farshad, The uservalid could be set to true or false by AddJS or other form of interaction between client side and server side. But as ajaxRequest works in the background, what i would like to make is not possible. Quote
Administrators Farshad Mohajeri Posted May 22, 2012 Administrators Posted May 22, 2012 Hi Farshad, The uservalid could be set to true or false by AddJS or other form of interaction between client side and server side. But as ajaxRequest works in the background, what i would like to make is not possible. In this case userValid is set after Server side event is executed which means you can't display the mask when user presses the button. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.