Jump to content

Display message based on button click


Prashant S A
Go to solution Solved by Niko Maresco,

Recommended Posts

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!

image.png.1057e34dece2f9b361d8eb3d55e160df.png

Link to comment
Share on other sites

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

  • Solution

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"
)

 

  • Like 2
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...