Prashant S A Posted August 12 Share Posted August 12 Hi, Can we display a message based on button click, also otherwise the message should be hidden. For example, in screenshot attached, when user click on Save button, "Saved successfully" should show, if not message should be hidden. Thank you! Link to comment Share on other sites More sharing options...
Olivier Keugue Tadaa Posted August 12 Share Posted August 12 Hi Prashant, is this a custom form you want to create or an existing one for which you need to change the behavior? In both cases, depending on what you are supposed to do there, you can use our custom extensions API to add tools, including forms with buttons. Our client API reference https://docs.tibco.com/pub/doc_remote/sfire-analyst/14.4.0/doc/api/TIB_sfire-analyst_api/Index.aspx If you download the Spotfire developer package you can find some examples there. Link to comment Share on other sites More sharing options...
Solution Niko Maresco Posted August 12 Solution Share Posted August 12 hi Prashant, i'm assuming you have an IronPython script attached to this button. one option you have is to use the Spotfire notifications area to provide feedback to users. below is a small example, and you can find the full details for the notification service at https://docs.tibco.com/pub/doc_remote/sfire-analyst/14.4.0/doc/api/TIB_sfire-analyst_api/html/T_Spotfire_Dxp_Framework_ApplicationModel_NotificationService.htm from Spotfire.Dxp.Framework.ApplicationModel import NotificationService # get an instance of the notification service notify = Application.GetService[NotificationService]() # create an "info" notification notify.AddInformationNotification( "Notification Title", "Message to display in the notification bubble", "Message to display in the notification window when a user clicks the notification" ) 2 Link to comment Share on other sites More sharing options...
Prashant S A Posted August 13 Author Share Posted August 13 Hi Nico,Olivier Thanks for the inputs. Link to comment Share on other sites More sharing options...
Prashant S A Posted August 21 Author Share Posted August 21 @Niko Maresco do we have code to catch errors using notification service? The concern here is, even if the save comment fails the notification message remains same. Thank you! Link to comment Share on other sites More sharing options...
Niko Maresco Posted August 21 Share Posted August 21 hi Prashant, can you please provide more details? i don't understand the nature of your question. what error are you looking to catch? what do you mean by "the notification message remains the same"? within IronPython you can use a try/catch block to attempt to catch exceptions, or validation logic to make sure values are within acceptable bounds. and of course you can use variables in the strings that you provide to the NotificationService to change the message that appears in the notification. but i'm not sure that this is what you're asking. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now