11/22/2024 10:51:44 PM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
|
|
|
|
Message Boxes
Posted: 08 Oct 07 12:04 PM
|
Hello all,
I am trying to come up with a simple message box that I can use anywhere within the 7.2 web client, especially business rules. Now I am aware of the...
this.DialogService.ShowMessage("Hello World");
that Sage provided us, but it has a number of limitations on where it can be used. So I did a little research and came up with this...
System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); stringBuilder.Append(@"<script language='javascript'>"); stringBuilder.Append(@"alert( """ + ex.ToString() + @""" );"); stringBuilder.Append(@"</script>");
if (this.Page.IsStartupScriptRegistered("myDebugMsg") != true) { this.Page.RegisterStartupScript("myDebugMsg", stringBuilder.ToString()); }
Now I'm a complete newb to web development, so I don't understand why this works, but just that using the Page.RegisterStartupScript seems to work. My question is, should I be doing it this way, is their a better way, or is using this going to cause me any trouble down the line?
|
|
|
|
Re: Message Boxes
Posted: 09 Oct 07 2:09 AM
|
Hi Jeff,
It depends what you want the script to do - if you need it to run on every load of the page, or every repaint of the page (a repaint is different to a load). The above is the best way to register javascript with the page using AA - but will only run when the page is first loaded, but if you click save for example that will cause a repaint event, and the above will not run (not in my experience anyway), you would have to literally refresh the page. Whenever I need to show a message box etc. I use the dialogservice route and put it in a loadaction (ensuring onrepaintevent is set to true). This is not ideal though as it needs a post back and is not as instant as a javascript message. This is one of my main beefs with developing quickforms in AA, its quite difficult to get your own javascript into the page and firing reliably...
Cheers, Nick |
|
|
|
Re: Message Boxes
Posted: 09 Oct 07 10:08 AM
|
There is a property for message boxes built in to the dialog service in quick forms. Try this code snippet:
this.DialogService.ShowMessage("Hello World"); |
|
|
|
Re: Message Boxes
Posted: 09 Oct 07 10:41 AM
|
Thanks Nick. That makes more sense to what it's doing. |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|