Vision - mousePressed Event on (Inherited) Template

I have a popup window defined in an inherited project, but in the child project I'm not able to get the popup to open in preview mode. Am I missing something?

Even after overriding, saving, and changing the script to open the new window, it doesn't want to open. No output in the designer console.

I would only expect that to work in the actual client.

I'd only expect it not to work if your popup is set to un-overridable in the parent project :thinking:

1 Like

I ended up creating a template for the popup that is the popup and just adding that to a popup window in the child project and passing the parameters through. However, I still can't get the mouse-clicked script to run.

If I copy/paste the script from the editor into the script console it works, and opens the popup in the designer as expected.

Doing the same copy/paste for an inherited popup, it also opens the popup in the designer as expected. Maybe the issue is not with the popup but something else, preventing the script from running.

I'm trying to use a mouse-clicked (or mouse-pressed) event on an (inherited) template. If I use the same script on a button object instead, it works. Am I not able to use mouse-clicked events on components that are not buttons in 8.0?

You can, the template is consuming the mouse actions though. You need to pass them through to the sub components. Let me find the script...

This script is at the instance-level, not at the component level inside the template. No scripts inside the template. I've added the script to the template instance itself inside the root container of the window.

image

Applying this script to the mousePressed event inside the template did not change anything.

On a somewhat unrelated note, I'm pretty sure that I applied an instance-level mouseClicked event in 8.1 and it was able to handle it appropriately. Was this a feature update for 8.1?

Found the issue to be that I had a mouseover text property assigned to a component within the template. If the mouseover text is instead assigned at the template instance level, the mousePressed event works as expected. I am told it is a limitation with swing's event propagation.