Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can I create an Additive List in Settings that allows a name and a description?

ANSWERED

Hi.

Can I create an Additive List in Settings that allows a name and a description? So instead of a user adding a bunch of single line items, I want each new item added to have a name AND a description.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Did you try the conditional <Page> trick shown here?

Peter McLennan
Gondwana Software

View best answer in original post

Best Answer
0 Votes
5 REPLIES 5

I guess that might sound confusing... To clarify the additive list's addAction would have two TextInput instead of one... if its possible... (For each item I want the user to add both a Name and a Description, two inputs for one item.) Gosh, I hope that makes sense!

Best Answer
0 Votes

I think I finally figured out a way to explain myself clearer!

 

I have the same problem as below, the need to create an AdditiveList with a secondary page that (could show anything, really) needs to show two TextInput. All I need is the new page functionality.

https://community.fitbit.com/t5/SDK-Development/Handling-complex-object-with-AdditiveList/m-p/429255... 

 

I did my best to replicate just the new page functionality in Fitbit Studio in the Settings > index.jsx file but it throws all kinds of wild errors. Now while my husband is a bit of a programmer, I come from the front-end (html, css, graphics) world, so I have no clue what's wrong with my code.

 

The beginning of my file starts like this, and throws an error "Property assignment expected" for the <Page>

function mySettings(props) {
  
  if (props.settings.addPage === "true")
    return {
      // SECOND PAGE
      <Page>
          ...

 

Thank you so much to anyone who replies. I really have enjoyed playing with app development on the FitBit!

Best Answer
0 Votes

I've never used AdditiveList so my thoughts may not be relevant.

Short answer: I don't think you can create multiple Settings pages.

Longer answer #1: ...but you CAN hide and show bits of a single page. In the extreme, you can completely swap the content from one set of components to another set. Have a look at the 'hiddenToggle' example here. I haven't found an elegant way of doing this on a large scale, but I have used it inelegantly to create the equivalent of a multi-level menu system within Settings. If you want a link to an app that does this, let me know. It might give ideas.

Longer answer #2: This isn't mine and I've never used it, but it sounds a bit relevant, maybe.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Did you try the conditional <Page> trick shown here?

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Actually my husband and I are really close to getting this to work! I will post what I did when it's finished so others can see what I did! Thank you for the replies!

Best Answer
0 Votes