Hello,
I would like to control when the cursor should be in the text field by setting the text field visibility condition.
Is that possible ? somehow fails, however when I put the script for a button event (onActionPerfomed) it works fine.
Thanks,
Misi
Show us your script. See blow how to post code on this forum.
Would it not be better to enable the text field rather than set its visibility?
The texfield visible depends on the transcationTypeId .
I also tried the sleep function```
if self.custom.station_data.transactionTypeId == 200:
self.getChild("root").getChild("TextField_0").focus()
One way to do it is like this:
- On the text field add a CUSTOM property. For example,
custom.transactionTypeId : 0
- Create a binding on that property to whereever the "200" value is supposed to come from.
- Right-click on the custom property, select Edit Change Script and enter the code below:
def valueChanged(self, previousValue, currentValue, origin, missedEvents):
if currentValue.value == 200:
self.focus()
As mentioned previously, I would bind the enabled property rather than the visible property in most cases.
Thank you very much!!
can i disable the focus?
Have found here : self.blur()
but for it i have an error message:' object has no attribute 'blur'
I don't know, but I suspect that the focus has to be set on something rather than nothing. Try putting it back on the button, or something else.