PDA

View Full Version : Add Button Error



bloodylemming
January 2nd, 2022, 00:36
I set up an 'add' button on one of my inventory lists, and it does add a blank item, however it also throws an error:
[ERROR] Script execution error: [string "common/scripts/list_text.lua"]:46: attempt to index field '?' (a nil value)

This seems to be an issue with where focus is established, but I can't, for the life of me figure out where the actual problem lies...
It does add the item just fine, so I'm not sure what the problem is or where to look...

superteddy57
January 2nd, 2022, 00:41
I believe it wants to add focus with that lua script for a 'name' control. You might need to setup a new template to use and change the code to the proper focus.

Moon Wizard
January 2nd, 2022, 01:17
You can also set a newfocus tag on the button definition to specify the alternate control name to accept focus. (Ex: <newfocus>label</newfocus>)

Regards,
JPG

damned
January 2nd, 2022, 01:33
Under General >> Custom Properties and a new one
Property Name newfocus
Property Value name of control that you want focus on

bloodylemming
January 2nd, 2022, 01:40
Under General >> Custom Properties and a new one
Property Name newfocus
Property Value name of control that you want focus on

Is that placed on the button or the item to receive focus?

bloodylemming
January 2nd, 2022, 01:45
Under General >> Custom Properties and a new one
Property Name newfocus
Property Value name of control that you want focus on

Ah, I had done that on the windowlist, but I misspelled focus...