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

adding multiple checkboxes #338

Open
0XONE opened this issue Jul 1, 2022 · 2 comments
Open

adding multiple checkboxes #338

0XONE opened this issue Jul 1, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@0XONE
Copy link

0XONE commented Jul 1, 2022

Hi, I'm trying to add multiple checkboxes option just in radio input type, here is my code:

file: /src/formBuilder/defaults/defaultInputs.js
code:

  checkbox: {
    displayName: 'Checkbox',
    matchIf: [
      {
        types: ['string','array', 'boolean'],
        enum:true,
      },
    ],
    defaultDataSchema: {enum:[]},
    defaultUiSchema: {
    'ui:widget' : 'checkboxes' 
    },
    type: 'string',
    cardBody: MultipleChoice,
    modalBody: CardDefaultParameterInputs,
  },

it returns Duplicate Hash error message, what is the valid solution to this problem?

@raymond-lam raymond-lam added the bug Something isn't working label Jul 2, 2022
@teranailee
Copy link

teranailee commented Jul 4, 2022

try to add property "widget" to matchIf

I just add custom input type to property "mods". this solution work. you can try one

checkbox: {
    displayName: 'Checkbox',
    matchIf: [
      {
        types: ['string','array', 'boolean'],
        widget: "checkboxes",  //<<<< add it here
        enum:true,
      },
    ],
    defaultDataSchema: {enum:[]},
    defaultUiSchema: {
    'ui:widget' : 'checkboxes' 
    },
    type: 'string',
    cardBody: MultipleChoice,
    modalBody: CardDefaultParameterInputs,
  },

this is my custom input type

"myNewInputType": {
        displayName: 'MyNewInputType',
        matchIf: [{
          types: ['boolean'],
          widget: "myNewWidget"
        }],
        defaultDataSchema: {},
        defaultUiSchema: {
            "ui:widget": "myNewWidget"
        },
        type: 'boolean',
      },

@0XONE
Copy link
Author

0XONE commented Jul 4, 2022

I am not using custom inputs here, i'm editing original source code of this library since it has MultipleChoice function that saves the time. @teranailee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants