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

Custom Builder with Resource - How to set Data as resource for a form #1113

Closed
ssrini opened this issue Mar 27, 2019 · 3 comments
Closed

Custom Builder with Resource - How to set Data as resource for a form #1113

ssrini opened this issue Mar 27, 2019 · 3 comments

Comments

@ssrini
Copy link

ssrini commented Mar 27, 2019

This is related to the question answered in #1103

Based on the above answer we are able to display the custom builder with the correct resources also for adding to form.

However while adding a Select list and setting the Data to Resource, the list of resources is not getting populated. Please note that we are not using a URL to load the form, but all the data for the form builder is being provided as JSON. When the data type is selected as Resource, the Resource drop down list is not populated with any entries and remains empty.

Please provide some guidance on how this can be achieved.

@ssrini
Copy link
Author

ssrini commented Mar 27, 2019

Please note that we are trying with the JS builder with the data embedded (not the Angular plugin)

Formio.builder(document.getElementById('builder'), {components:[
  {
    type: 'textfield',
    label: 'First Name',
    key: 'firstName',
    input: true
  }
]}, {
  builder: {
  basic: {},
  advanced: { components:{
  	form: false
  }},
  data: {},
  resources: {
  	title:"Resource Fields",
    weight: 10000,
    groups: {
      equipment: {
        key: "equipment",
        title: "Equipment",
        weight: 10,
        components: [
          {
            key: "equipmentName",
            title: "Equipment Name",
            icon: "defaultInfo.icon",
            group: "equipment",
            schema: {
              autofocus: false,
              input: true,
              tableView: true,
              inputType: "text",
              inputMask: "",
              label: "Equipment Name",
              key: "equipmentName",
              placeholder: "",
              prefix: "",
              suffix: "",
              multiple: false,
              defaultValue: "",
              protected: false,
              unique: false,
              persistent: true,
              hidden: false,
              clearOnHide: true,
              spellcheck: true,
              validate: {
                required: false,
                minLength: "",
                maxLength: "",
                pattern: "",
                custom: "",
                customPrivate: false
              },
              conditional: {
                show: "",
                when: null,
                eq: ""
              },
              type: "textfield",
              labelPosition: "top",
              tags: [],
              properties: {}
            }
          },
          {
            key: "equipmentNumber",
            title: "Equipment Number",
            icon: "defaultInfo.icon",
            group: "equipment",
            schema: {
              autofocus: false,
              input: true,
              tableView: true,
              inputType: "number",
              label: "Equipment Number",
              key: "equipmentNumber",
              placeholder: "",
              prefix: "",
              suffix: "",
              defaultValue: "",
              protected: false,
              persistent: true,
              hidden: false,
              clearOnHide: true,
              validate: {
                required: false,
                min: "",
                max: "",
                step: "any",
                integer: "",
                multiple: "",
                custom: ""
              },
              type: "number",
              labelPosition: "top",
              tags: [],
              conditional: {
                show: "",
                when: null,
                eq: ""
              },
              properties: {}
            }
          }
        ]
      }
    }
  },
  layout: {
    components: {}
  }
}});

@ssrini
Copy link
Author

ssrini commented Apr 1, 2019

Any help?

@formio formio deleted a comment from denisekay Sep 29, 2022
@heather-formio
Copy link
Contributor

Closing this issue as it is stale. Please reopen a new issue if needed. Thank you!

@heather-formio heather-formio closed this as not planned Won't fix, can't repro, duplicate, stale Sep 29, 2022
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

2 participants