{"action":"created","issue":{"url":"https://api.github.com/repos/Albert-Gao/veasy/issues/27","repository_url":"https://api.github.com/repos/Albert-Gao/veasy","labels_url":"https://api.github.com/repos/Albert-Gao/veasy/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/Albert-Gao/veasy/issues/27/comments","events_url":"https://api.github.com/repos/Albert-Gao/veasy/issues/27/events","html_url":"https://github.com/Albert-Gao/veasy/issues/27","id":312843925,"number":27,"title":"Does Veasy support an array or collection of objects that can be added to the form?","user":{"login":"JeremyColton","id":2919478,"avatar_url":"https://avatars2.githubusercontent.com/u/2919478?v=4","gravatar_id":"","url":"https://api.github.com/users/JeremyColton","html_url":"https://github.com/JeremyColton","followers_url":"https://api.github.com/users/JeremyColton/followers","following_url":"https://api.github.com/users/JeremyColton/following{/other_user}","gists_url":"https://api.github.com/users/JeremyColton/gists{/gist_id}","starred_url":"https://api.github.com/users/JeremyColton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeremyColton/subscriptions","organizations_url":"https://api.github.com/users/JeremyColton/orgs","repos_url":"https://api.github.com/users/JeremyColton/repos","events_url":"https://api.github.com/users/JeremyColton/events{/privacy}","received_events_url":"https://api.github.com/users/JeremyColton/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-10T09:32:55Z","updated_at":"2018-04-14T18:10:58Z","closed_at":"2018-04-14T18:10:58Z","author_association":"NONE","body":"My form has:\r\n\r\n1. Name\r\n2. Set of Domain objects. Each object consists of:\r\nDomain Name, Domain Type\r\n\r\nA valid form must have at least 1 Domain object.\r\n\r\n1. Does Veasy support a collection of objects where there must be at least 1 object added to the form?\r\n\r\nFor example\r\n\r\n```\r\nthis.mainFormSchema = {\r\n   name: {minLength: [2, 'min length 2']},\r\n   domainSet: {\r\n      minSize: 1,\r\n      elementContent: {\r\n          domainName: {isUrl: true},\r\n          domainRule: {enum: ['Full', 'None', 'Half']}\r\n      }\r\n   }\r\n}\r\n```\r\n2. Or should the Set be a second Veasy form and if so how do I initialise this 2nd form?\r\neg\r\n```\r\nthis.mainFormSchema = {\r\n   name: {minLength: [2, 'min length 2']},\r\n}\r\n\r\nthis.domainFormSchema = {\r\n  domainSet: {\r\n      minSize: 1,\r\n      elementContent: {\r\n          domainName: {isUrl: true},\r\n          domainRule: {enum: ['Full', 'None', 'Half']}\r\n      }\r\n   }\r\n}\r\n\r\n\r\nthis.state = createInitialState(this.mainFormSchema, this.myState);\r\nthis.domainFormState = createInitialState(this.domainFormSchema, this.myState);\r\n\r\n// I bind this in the constructor  \r\nupdateDomainFormState(state) {\r\n     console.log(\"updating domain form state...\");\r\n\r\n     // the form's state is overrided completely each time! Better way to do this so Veasy knows about changes in the state?\r\n     this.domainFormState = state;\r\n}\r\n\r\n\r\n<VeasyForm schema={this.mainFormSchema} allState={this.state} update={this.updateState}>\r\n.\r\n.\r\n</VeasyForm>\r\n\r\n<VeasyForm schema={this.domainFormSchema} allState={this.domainFormState} update={this.domainFormUpdateState}>\r\n.\r\n.\r\n</VeasyForm>\r\n\r\n```\r\nUsing the above code, the 2nd Veasy domainForm does not report error messages until onBlur is called on the 1st Veasy mainForm...\r\n\r\n3. If I seperate the 2nd form into its own component then can it have the same <VeasyForm> param values as the 1st form? Or will its state then be considered part of the state of the 1st form even though it's in a separate React component?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Albert-Gao/veasy/issues/comments/381348736","html_url":"https://github.com/Albert-Gao/veasy/issues/27#issuecomment-381348736","issue_url":"https://api.github.com/repos/Albert-Gao/veasy/issues/27","id":381348736,"user":{"login":"JeremyColton","id":2919478,"avatar_url":"https://avatars2.githubusercontent.com/u/2919478?v=4","gravatar_id":"","url":"https://api.github.com/users/JeremyColton","html_url":"https://github.com/JeremyColton","followers_url":"https://api.github.com/users/JeremyColton/followers","following_url":"https://api.github.com/users/JeremyColton/following{/other_user}","gists_url":"https://api.github.com/users/JeremyColton/gists{/gist_id}","starred_url":"https://api.github.com/users/JeremyColton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeremyColton/subscriptions","organizations_url":"https://api.github.com/users/JeremyColton/orgs","repos_url":"https://api.github.com/users/JeremyColton/repos","events_url":"https://api.github.com/users/JeremyColton/events{/privacy}","received_events_url":"https://api.github.com/users/JeremyColton/received_events","type":"User","site_admin":false},"created_at":"2018-04-14T18:10:58Z","updated_at":"2018-04-14T18:10:58Z","author_association":"NONE","body":"I have a form with inputs for a web domain's url and type. But I agree with you - use 2 forms and pass the valid value of one form to the other to send to the server."}}
{"actor":{"display_login":"JeremyColton"}}