01-13-2020 14:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-13-2020 14:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm working on an app that has several textinput fields in the setttings.jsx file and uses scrollview to display the text in index.gui. My problem is I can't start by entering a random field, say the fourth textinput field, as it will not display on watch, unless I enter items from the first textinput and onward to the fourth. The only solution I have found is to go to each and every textinput field and tap "save". That seems to initiate each field and I can then enter something in any random field and it displays fine. Is there anyway I can somehow avoid the need to tap save on every field?
Thanks from a newbie.
Answered! Go to the Best Answer.

Accepted Solutions
01-16-2020 11:31
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-16-2020 11:31
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
solved the problem. It wasn't in the settings or svg files, but in the main index file. The JSONstringify function was failing when the object was null, and exiting the apply settings function. I solved it by testing if the settings object was not equal to null.

01-14-2020 10:41
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


01-14-2020 10:41
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Can you provide an example of your settings JSX file, thanks

01-14-2020 13:05
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-14-2020 13:05
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
OK here is part of it:
function mySettings(props) {
return (
<Page>
<Section
title={<Text bold align="center">Personal ID:</Text>}>
<TextInput
label="Name:"
settingsKey="myname"
/>
<TextInput
label="Birth Date:"
settingsKey="bdate"
/>
<TextInput
label="Insurance No./Provider:"
settingsKey="insurance"
placeholder="PHN# or provider"
/>
</Section>
<Section
title={<Text bold align="center">Emergency Contacts:</Text>}>
<TextInput
label="Emergency Contact 1:"
settingsKey="emerg1"
placeholder="enter name here"
/> <TextInput
label="Contact 2 Phone No.:"
settingsKey="phone2"
placeholder="enter phone number here"
/>
</Section>
<Section
title={<Text bold align="center">Doctors:</Text>}>
<TextInput
label="Doctor1:"
settingsKey="doc1"
placeholder="enter name and city"
/>
<TextInput
label="Doctor2:"
settingsKey="doc2"
placeholder="enter name and city"
/>
</Section>
</Page>
);
}
registerSettingsPage(mySettings);

01-15-2020 10:59
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-15-2020 10:59
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I think I found the problem. When I use scrollview in the index.gui, like someone on this forum suggested, using only two scrollview items with one being high enough to contain all the text elements, it displays the way I want, by not inserting blank lines if no text is present. It make a neat looking interface. But, if I don't initialize each textinput from the beginning on in settings jsx, it won't update and display a textinput further down the list.
If I use scrollview as suggested in the guides, by using one scrollview item for each text input, they will update correctly even if a textinput further down the list is entered, but the display shows blank lines for every item, and that makes a messy display with lots of blanks if there are many blank textinputs. I cant seem to find a solution.

01-16-2020 11:31
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-16-2020 11:31
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
solved the problem. It wasn't in the settings or svg files, but in the main index file. The JSONstringify function was failing when the object was null, and exiting the apply settings function. I solved it by testing if the settings object was not equal to null.

08-17-2021 18:17
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-17-2021 18:17
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
How did you do it? Can you give me some help, as using JSON.parse(thing.name) doesn't work for TextInput
Currently TextInput (JSX) is still bugged (the name field appears if the USER changes it in the settingsKey). However if the code uses settingStorage.setItem, the name field disappears and the output is as neat as it should have

