Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, June 30, 2025 
 
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: unusual Message Box behaviour
Andrew Grandin
Posts: 272
 
unusual Message Box behaviourYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 May 10 8:47 AM
hi all, just wondering if this is common behaviour or something im doing wrong....

whenever i use more than 1 dialogservice.showmessage... in a block of code it only displays the final message and skips/doesnt diplay the others.

For example, in the code below message1 is never displayed

if (a=b){
DialogService.showMessage("message1")
//do something here then:
DialogService.showMessage("message2")
}
[Reply][Quote]
Mike LaSpina
Posts: 116
 
Re: unusual Message Box behaviourYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 May 10 3:37 PM
I've seen odd behavior when calling a dialog twice between a page postback. In fact, I've had an open issue with dev since 7.5.2 was released. Apparently, they have addressed it in a hotfix, but I've not had time to verify if all has been fixed.

I would recommend using a JavaScript Alert in your case and a couple of buttons that you can 'click' via the javascript:

string js = "javascript: alert('Starting the process.'); document.getElementById('ctl00_DialogWorkspace_MyDialog_btnAction1').click(); }";
ScriptManager.RegisterStartupScript(Page, GetType(), "Action1", js, true);


btnAction1 Click action:
// Do Something here then:
string js = "javascript: alert('This process finished'); }";
ScriptManager.RegisterStartupScript(Page, GetType(), "Action2", js, true);

Note that btnAction1 has to be visible in order to render on the page. When I use these, I set the height and width to zero so it is effectively invisible, but the client script can still see it. You can do this in the quickformload if you're using a quickform, or just set the button attributes in the ASCX file if you're using a custom form. Also note that you will have to look at the page source to see exactly what string to pass into getElementById.

[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: unusual Message Box behaviourYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 May 10 8:36 AM
Hi,

Seperate out your DialogShowMessage calls into different methods. When you DialogShowMessage you hand back control to the page so you then lose control server side. Unless the DIalog Show Message has changed drastically in a hotfix I do not see how that could behave any differently?

You could also create a little custom smartpart that looks like a dialogshowmessage, pass the message text as a DialogParameter, and even some instructions as to what to do when they click OK. You can also have Yes/No's etc this way which there is no way to do out of the box (you can do it in VBScript/Javascript but they don't look as good as DialogService ShowMessage's).]

Thanks,
Nick
[Reply][Quote]
Andrew Grandin
Posts: 272
 
Re: unusual Message Box behaviourYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 May 10 8:42 AM
Thanks for your replies all, what you suggested Mike could be a possible solution to another little problem ive got. On my OpportunitySalesProcess.ascx page i have a button. In the OpportunitySalesProcess.ascx.cs script i have the click event code:

protected void Button1_Click(object sender, EventArgs e)
{

if (DialogService != null) {
// DialogActionItem
DialogService.SetSpecs(400, 600, "formname", string.Empty );
DialogService.EntityType = typeof(Sage.Entity.Interfaces.IOpportunity);
DialogService.ShowDialog();
}
}

How do i invoke the click of this button in the OpportunitySalesProcess_ClientScript.js script? Specifically at the end of the executeAction javascript function.
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: unusual Message Box behaviourYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 May 10 8:51 AM
In the OpportunitySalesProcess_ClientScript.js just call the click event of the button in question (whenever you require it to be clicked), so something like:

document.getElementById('BUTTONNAME').click();

should do it, off the top of my head so case might be wrong!

Cheers,
Nick.
[Reply][Quote]
Andrew Grandin
Posts: 272
 
Re: unusual Message Box behaviourYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 May 10 9:11 AM
Nick youre a legend! cant believe it was that simple! Cheers.
[Reply][Quote]
Andrew Grandin
Posts: 272
 
Re: unusual Message Box behaviourYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 May 10 3:58 AM
Hi Nick,

When invoking the button press how would you go about passing it a variable?

Cheers
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: unusual Message Box behaviourYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 May 10 5:16 AM
Hi Andrew,

As far as I am aware you cannot pass variables when you call a click(). You have a couple of options. The code that runs on the server can determine the value of whatever you were trying pass in the firstplace (doing a database query, or reference a field on the screen), or you could have a hidden field on the form that the Button1 click method (the server side method) can reference. Just place your variable (the one you need to be a parameter) in the hidden field before the click() is called, then you can pick it up in your server side Button1 click method.

Thanks,

Nick
[Reply][Quote]
Andrew Grandin
Posts: 272
 
Re: unusual Message Box behaviourYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 May 10 5:23 AM
Hi Nick,

Thanks again for another great reply. How exactly would that work if what i needed was the StepID of the sales process step the user just clicked?

In the code its populated in SalesProcessGrid_RowDataBound using:

ISalesProcessAudit spAudit = (ISalesProcessAudit)e.Row.DataItem; --- (the stepID being - spAudit.Id.ToString()

The code im going to execute on my Button Click needs this value.

Thanks again.
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: unusual Message Box behaviourYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 May 10 5:30 AM
No problem...I do not know the sales process screen too well so quite difficult to work this one out.

What I would try to do is:

1) add a hidden field to your form, call it something like "ClickedStep";

2) In the javascript code that calls the click() (which I am assuming you attach also in the RowDataBound event) add a line before the click, something like:

document.getElementById('ClickedStep').value = '" + spAudit.Id.ToString() + "';
document.getElementById('BUTTON').click();

The first line will populate the hidden field, whose value you can now reference in you Button1_Click server side method.

Make sense?
[Reply][Quote]
Andrew Grandin
Posts: 272
 
Re: unusual Message Box behaviourYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 May 10 5:41 AM
Worked fantastic! CHeers for all your help Nick.
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: unusual Message Box behaviourYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 May 10 5:44 AM
Glad it worked! Isn't it great when a plan comes together
[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 © 2025 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): 6/30/2025 10:16:49 AM