This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS320F28069M: Cannot Add an onclick event to the Button Widget in the online GUI Composer

Part Number: TMS320F28069M

Tool/software: Code Composer Studio

Hi,

I'm using the online GUI Composer, and I'm trying to add an onclick event for the Button widget but I can't seem to find the 'Events' section in its properties. Is there some other way to resolve this? Can I code it in JavaScript? If so, how?

  • Yes, this cannot be set through the widget Properties but would need to be coded in Javascript. Here are a couple of related forum threads that should hopefully point you in the right direction:

    https://e2e.ti.com/support/tools/ccs/f/81/p/753765/2784476

    https://e2e.ti.com/support/tools/ccs/f/81/t/443949

  • Hi,

    Thank you for your help. I went to the suggested links, but they only say how to bind a DSS script to the onclick event of the button. I am using the online GUI Composer, so the button widget does not have an onclick event.

    What I am trying to do is have a "save" button in my GUI, which when clicked will save data from a graph to a file. When the GUI is running, the user will write the name of the file in a text box and then click the "save" button to save the data in the file. I would greatly appreciate any help on this.

    Thank You.

  • There are several examples on our GUI Composer Gallery that could be a good reference and serve as a starting point for you to build upon: https://dev.ti.com/gallery/

    If you type "save" in the Search box, it will narrow down the matches. The XDS_SaveVariablesToFile might be the closest we have to what you are looking for.
  • Hi,

    Thank you very much for your help. The XDS_SaveVariablesToFile project makes use of the "onclick" event to tie a JavaScript function to the button widget, which is where the issue is. Like I mentioned before, the button widget of the online version of GUI Composer does not have an "onclick" event. So is there any other way to tie a JavaSciript function to the button widget or a way to save data to a file when a button is clicked? Any help would be greatly appreciated.

    Thank You.

  • How can I tie a button widget to a JavaScript function?
  • You can edit the index.gui file in the GUI Composer project directly to add the "onclick" event to the button widget and tie it to a function. Then create a separate javascript file to define the function, similar to how it is done in the XDS_SaveVariablesToFile example.