Jump to content

showMask by AddJS


cristianotestai

Recommended Posts

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;

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Administrators
{
  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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Administrators

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.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...