Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Values not set on Autoform update #23

Open
neil-s opened this issue Feb 29, 2016 · 0 comments
Open

Values not set on Autoform update #23

neil-s opened this issue Feb 29, 2016 · 0 comments

Comments

@neil-s
Copy link

neil-s commented Feb 29, 2016

I'm having basically the same issue as #8 .

Here's a toy example schema:

var examplesSchema = new SimpleSchema({
   tags: {
       type: [String],
       autoform: {
           type: "selectize",
           afFieldInput: {
               multiple: true,
               //isReactiveOptions: true,
               selectizeOptions: {
                   options: [
                       {value: "AAA"},
                       {value: "BBB"}
                   ],
                   valueField: "value",
                   labelField: "value",
                   searchField: "value"
               }
           }
       }
   }
});

When creating a new record, it correctly shows an empty field with 'AAA' and 'BBB' as suggestions. However, when I go to update an existing record, the previously chosen tags don't show up.

Hitting the update button gives an error that this field is required, meaning that the value hasn't just been obscured by view layer stuff, it really is empty. And inspecting the document using Constellation shows that the tags are still there on the original document, so it is actually a case of the Autoform not showing the current values. Turning isReactiveOptions on makes the suggestions disappear. I'm using the options specification this way because in the real use case, I want to use create: true, allowing users not just to choose from an existing list of tags but create new ones.

Packages and versions being used are in this gist: https://gist.github.com/neil-s/c1577eba092a1fc776b4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant