If you find this site useful and you want to support, buy me a coffee to keep this site alive and without ads.
Alert, Popup, MessageBox
import clr clr.AddReference("System.Windows.Forms") from System.Windows.Forms import MessageBox MessageBox.Show("Foo")
6 comments:
Anonymous
said...
I have implemented MessageBox.Show in my visualization. However when I publish it to web Player, it is giving following error. Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
Can anybody help me with the alternatives to do this which shows message, alert to user for specific validation before submitting?
Yes, it only works in webplayer. You could use a simple javascript to alert('Foo'). Checkout this post to see a javascript example that shows a calendar in both, client and webplayer: http://spotfired.blogspot.com/2014/05/popup-calendar-webplayer-compatible.html
Thanks Levaguirre. As I am having Spotfire 5.0 version so I can't apply Javascript on my visualization. However thank you very much for your kind help.
a simple 'if' conditional should do the work: if(rowscount>100):MessageBox.Show("Foo")
I recommend using the javascript version to alert the user so it can be webplayer and client compatible, but you need additional tweaks. The logic remains the same.
6 comments:
I have implemented MessageBox.Show in my visualization. However when I publish it to web Player, it is giving following error.
Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
Can anybody help me with the alternatives to do this which shows message, alert to user for specific validation before submitting?
Yes, it only works in webplayer. You could use a simple javascript to alert('Foo'). Checkout this post to see a javascript example that shows a calendar in both, client and webplayer: http://spotfired.blogspot.com/2014/05/popup-calendar-webplayer-compatible.html
Thanks Levaguirre. As I am having Spotfire 5.0 version so I can't apply Javascript on my visualization. However thank you very much for your kind help.
Hi Leviaguirre,
How can I tweak the Javascript to display the message only if the rowcount is greater than 100?
a simple 'if' conditional should do the work: if(rowscount>100):MessageBox.Show("Foo")
I recommend using the javascript version to alert the user so it can be webplayer and client compatible, but you need additional tweaks. The logic remains the same.
If you want a title in the message box,
MessageBox.Show("Foo", "Title")
Post a Comment