Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 2024 
 
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!
 Web Forums - SalesLogix Web Platform & Application Architect
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.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Message Boxes
Jeff Crawford
Posts: 52
 
Message BoxesYour last visit to this thread was on 1/1/1970 12:00:00 AM
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?
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Message BoxesYour last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
Jack Stockton
Posts: 13
 
Re: Message BoxesYour last visit to this thread was on 1/1/1970 12:00:00 AM
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");
[Reply][Quote]
Jeff Crawford
Posts: 52
 
Re: Message BoxesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Oct 07 10:41 AM
Thanks Nick. That makes more sense to what it's doing.
[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/22/2024 11:40:16 PM