-
|
Hi, I have a isFileApproved = c.boolColumn();And I've used it as: <CheckboxField field="isFileApproved" label="File Approved Flag" />However, as the screenshot shows, I have a blue interface with I want to get rid of this intermediate field and only display the What I've tried so far?
<FormCheckbox
field={field}
isNonbearing={isNonbearing}
defaultValue={defaultValue ?? false}
>
<SlotInput
ref={it => {
(ref as any).current = checkboxRef
setCheckboxRef(it)
}}
type="checkbox"
checked={!!accessor.value}
data-state={value ? 'checked' : 'unchecked'}
data-invalid={dataAttribute(hasErrors)}
data-dirty={dataAttribute(dirty)}
id={id ? `${id}-input` : undefined}
onFocus={onFocus}
onBlur={onBlur}
onChange={useCallback<ChangeEventHandler<HTMLInputElement>>(e => {
accessorGetter().updateValue(e.target.checked)
}, [accessorGetter])}
{...props}
/> useEffect(() => {
if (!checkboxRef) {
return
}
checkboxRef.indeterminate = false
}, [checkboxRef, ref, value]) const resolvedDefaultValue = defaultValue !== undefined ? defaultValue : (node.field.defaultValue ?? false))However, it seems not to be working at all.
Is the problem from the above or from export const CheckboxInput = uic('input', {
baseClass: 'w-4 h-4',
defaultProps: {
type: 'checkbox',
},
})Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Hi! The behavior you're seeing (the blue checkbox with a There are a couple of ways to fix this depending on whether you want to keep Option 1: Update the database column to be non-nullableIf isFileApproved = c.boolColumn().notNull().default(false)This will ensure the field is never Option 2: Keep the column nullable, but handle
|
Beta Was this translation helpful? Give feedback.
-
|
Hi, I have a question. <HasRoles roles={[""......]}
<CheckboxField
field="isFileApproved"
defaultValue={false}
label="Schváleno"
/>
</HasRoles>
</>
);
},
(_, env) => {
return (
<>
/// Prviously
<Field
field="isFileApproved"
defaultValue={false}
label="Schváleno"
/>
/// Amended to
<CheckboxField
field="isFileApproved"
defaultValue={false}
label="Schváleno"
/>
</>
);
}In the static render, I had Thank you! |
Beta Was this translation helpful? Give feedback.

Hi! Sorry, I got caught up with things and didn't realize that I hadn't mentioned the crucial detail.
I tried changing other things because
didn't workout.
I realize that at some place in codebase these fields are not set. It's in the
galleryview for the documents.I'll look into it and let you know with the updates.
Thank you!