MobGUI was put on the operating table and the creation of all native iOS controls now happens in the preOpenCard handler (the snippet that MobGUI automatically inserts).
This fixes the problem (detailed below), so no workaround is required any more - BUT - it was quite a big change behind the scenes, so rather than just posting the update and letting the plugin detect it, I thought it would be best to post it here first. I've been testing this version and everything looks fine, but I'll wait until I get some feedback before making it available in the normal way!
If you want to try it out, you can get it here; I've also added the uText property to the native field controls for getting and setting their text. You can now do the following;
Code: Select all
set the uText of group "MyUITextField" to "test123"
put the uText of group "MyUITextField" into tText
The problem
When moving to a new card that has native text controls and populating those controls with data in the preOpenCard handler, the data doesn't appear - only the first time!
The first time the card is visited, the native text fields don't exist as they haven't been created yet, so the data doesn't show.
When the controls are created (in the openControl message - which comes after the preOpenCard and openCard messages) they are set to their default values. If you enter default values for the controls in MobGUI, you'll see those values appearing.
Any subsequent visits to the card work fine, as the text fields now exist.
The workaround
To make it work, the following was added to the preOpenCard handler and the script to populate the fields was in the 'populate' handler
Code: Select all
send "populate" to me in 1 tick
Any feedback for V0.17 will be greatly appreciated!