We would like to not use any DataManager Adapter because we have a legacy BackendAdparter for all API calls. The issue is that in this way the Multiselect never is populated. I let you a piece of example code. Thanks in advance.
import { listGroupsBackendAdapter} from 'services/backendAdapter';
interface UsersState {
groups: { [key: string]: Object }[];
permissions: { [key: string]: Object }[];
}
class User extends React.Component<UserPorps, UsersState> {
constructor(props: UserPorps) {
super(props);
this.state = {
groups: [],
permissions: []
};
}
componentWillMount() {
listGroupsBackendAdapter
.startCallNoRedux('get')
.then(response => {
this.setState({ groups: response });
});
}
public render() {
return (
<form id="inviteUserForm" ref={(ref) => this.formRef = ref} >
<div className="form-row">
<div className="col">
<label htmlFor="GroupsMultiSelect">Groups</label>
<MultiSelectComponent
id="GroupsMultiSelect"
placeholder="Groups"
mode="Box"
dataSource={this.state.groups}
fields={{ text: 'name', value: 'id' }}
change={this.setGroups}
/>
</div>
</div>
</form>
);
}
}