0

I have defined a Param fields for JSS component as below and set its value to "true" on the route file.

But when imported into Sitecore, in the presentation details of the component doesn't show this "greyBackground" checkbox as checked.

params: [
      { name: 'greyBackground', displayName: "Grey Background", type: CommonFieldTypes.Checkbox }
]

route file :-

componentName: MyComponent
        params:
          greyBackground: true

Anyone have faced this issue earlier ?

1

In the sample application templates provided for JSS, there are no Checkbox fields defined for Params for examples components (only string & number fields in example component).

But it contains Checkbox field usage example in a Sample component. In that example, checkbox field is given values true/false

Ex: in route file :-

fields:
  CheckboxField: true

But when this same true/false used in the Params Checkbox field, it was not correctly imported into Sitecore.

But, when you try to use 1/0 (instead of true/false), this was corrected imported to sitecore as well as it worked correctly on disconnected mode also.

componentName: MyComponent
        params:
          greyBackground: 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.