Write value to text field on button click

Hi I am opening a window on button click. (visible = true)

On that window I want to set a value to a text field.

Can anyone please help?

Welcome to the forum. Please edit your question title and select Vision or Perspective from the tag dropdown. You've said "window" which implies Vision. (Perspective uses "views".)

Tip: the FAQ "Keep it tidy" section asks that we don't add signatures to posts. Your user name is applied automatically.

Thanks.

Please share more information about your application:

  • Where does the string come from? A constant? A tag value? Some expression?

  • Is the text field connected to something? Or unbound (for scripted custom handling)?

  • Does the source of the field depend on the button that opens it? Where multiple buttons might open this window with different sources?

The string comes from the button that opens it.

That string is used to filter the data on window.

Current button script:

That's not a window. You have a container pretending to be a window/template. You'd use system.nav.openWindow() to open a window.

Since it isn't a window, and therefore everything is in the same actual window, you can use layers of .getComponent() methods to reach that text field, and assign to its .text property.

Within your button script, you can use the property tool (on the right) to help you construct that set of methods.

You are a legend!

I got it.

I am an end user and learning the scripting in ignition.

@pturmel Thank you so much.

1 Like