Text Box Clear Issue

Since upgrading to 7.6.4 I have noticed a problem with trying to clear a text box.

I have a screen that looks at the property change event of a text box with defer update disabled. when the text box reaches 5 characters in length the text box clears itself. after the upgrade the text box no longer will clear.

For curiosity I also setup two other scenarios. rather than the text box clearing itself i made a button and when the length of the text in the text box is reached it clicks the button. This does not work either, but if i click the button manually it works. the third scenario is the same as the second except I click the button inside a invoke later function.

any ideas why the text box is no longer clearing? attached is a window with the three scenarios.

Thank you,

I called into tech support. On the text box there is a property called “Reject Updates During Edit”. Either this property was not there or was not working correctly before I upgraded to 7.6.4. Once we set the property to false the text box will now clear itself.

2 Likes

Thanks for coming back to update this thread.

In version 8.0.7 the Text Field component property ‘Reject Updates During Edit’ has a scrollover caption that says "If True, this field will not accept updates from external sources (like DB bindings) while the user is editing the field. I found that while True it won’t accept updates from itself either (which I don’t think is an external source). I have the following code on the components property change event. Notice the comment detailing which line won’t work.

serial = event.source.text

if event.propertyName == 'text':
	eventLength = len(serial)
	if eventLength < 8:
		pass
	elif eventLength > 8:
		event.source.text = '' #THIS LINE WON'T EXECUTE IF PROPERTY MARKED TRUE
    else:
		system.gui.getParentWindow(event).getComponentForPath('Root Container.txt_Model').requestFocusInWindow()
elif event.propertyName == 'enabled':
	system.gui.getParentWindow(event).getComponentForPath('Root Container.txt_Model').requestFocusInWindow()

Scripts are very much an external source. External to the operator keyboard/mouse.

1 Like

I learn something new everyday. I always assumed if I right click on the component that I was still “internal” to the component. I didn’t realize I was going external.

Snark aside, the component has no clue that the script trying to write to it was triggered by an operator right-click.