Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OnAsync Events Help!
#1
Howdy All!

I have been making pretty good progress on V3 of my new web reservations app using Bootstrap. I have run into a few issues I would like to get other's advice / help on:

1) I am using CSS for styling my required input controls. As soon as user does an equivalent of a 'submit' in one of my async events, I check for errors. 

If there is an any errors, I display the formatted errors in a Boostrap Card and I would like to 'add to' the CSS Input styles to show errors more forcefully.

The only way I know to update CSS is by forcing a full submit (and it works well).

Is there away to update a form's extra header from an OnAsync event or is a full page submit the best way?

2) Showing a custom image file when a form get's locked. In my CGDevTools, this was easy with one of their components. Is there an easy equivalency in the standard IW?

Thanks in advance,

Shane
Reply
#2
Hi Shane.
1.you can change via javascript in async. Something like this:

Code:
WebApplication.CallBackResponse.AddJavaScriptToExecute( '$("#yourID").css("color", "red");' );


2.Yes, IW have a lot of GIFs for you. If you create your personalized gif, put it in wwwroot and in your delphi - ServerController, property: CustomLockerAnimationFile := 'YourGifFileNameInwwwroot.gif';
Reply
#3
(01-28-2019, 08:11 PM)Howdy Jose!First, thanks for the response!Jose Nilton Pace Wrote: Hi Shane.
1.you can change via javascript in async. Something like this:

Code:
WebApplication.CallBackResponse.AddJavaScriptToExecute( '$("#yourID").css("color", "red");' );

How would I add the following:

input:required:invalid, input:focus:invalid
{
   background-color: #ffcccc;
   border-color: red;
}


2.Yes, IW have a lot of GIFs for you. If you create your personalized gif, put it in wwwroot and in your delphi - ServerController, property: CustomLockerAnimationFile := 'YourGifFileNameInwwwroot.gif';

Thanks - I wasn't aware of this property!

Ok - I just tried the ServerController property and it works well (here comes the but)! It would be nice if the image could be set session based instead of globally for the following reasons:

1) Desktop vs mobile (sizing).
2) Branding - that is, in my web application currently, I let each of customer's customers have a unique splash screen image (ie. Texas A&M, AARP, etc).

All the best,

Shane
Reply
#4
Shane, i don't know what JS you are using, but you can try things like:
Code:
$(".yourinput").addClass("invalid");
Reply
#5
(01-28-2019, 10:50 PM)Jose Nilton Pace Wrote: Shane, i don't know what JS you are using, but you can try things like:
Code:
$(".yourinput").addClass("invalid");
Howdy Jose!

Since I have N # of controls created at run-time, I already have the CSS classes attached and I want to 'extend' the CSS classes... a full submit works. I just was wondering if there is away to do this from an OnAsync event.

Thanks,

Shane
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)