Trying to create settings.tsx for Experience Builder Widget version 1.10.
Using function syntax:
export default function Setting(props: AllWidgetSettingProps<IMConfig>){
...
However props.useMapWidgetIds, which should contain list of maps on the current page, is null.
In version 1.05 function syntax works, and props.useMapWidgetIds is not null.
Also in 1.10 if use class syntax,
export default class Setting extends React.PureComponent<
AllWidgetSettingProps<IMConfig>,
any
> {
...
then this.props.useMapWidgetIds is not null/undefined.
Solved! Go to Solution.
Worked after changing:
<JimuMapViewSelector
onChange={onMapWidgetSelected}
useMapViewIds={props.useMapWidgetIds?.asMutable()}
/>
to
<MapWidgetSelector
onSelect={onMapWidgetSelected}
useMapWidgetIds={props.useMapWidgetIds}
/>
Actually props.useMapWidgetIds still appeared to be undefined when debugging... but the Select Map widget section of the settings populated with the map(s) on the page with the latter option.
Worked after changing:
<JimuMapViewSelector
onChange={onMapWidgetSelected}
useMapViewIds={props.useMapWidgetIds?.asMutable()}
/>
to
<MapWidgetSelector
onSelect={onMapWidgetSelected}
useMapWidgetIds={props.useMapWidgetIds}
/>
Actually props.useMapWidgetIds still appeared to be undefined when debugging... but the Select Map widget section of the settings populated with the map(s) on the page with the latter option.
Worked after changing:
<JimuMapViewSelector
onChange={onMapWidgetSelected}
useMapViewIds={props.useMapWidgetIds?.asMutable()}
/>
to
<MapWidgetSelector
onSelect={onMapWidgetSelected}
useMapWidgetIds={props.useMapWidgetIds}
/>
Actually props.useMapWidgetIds still appeared to be undefined when debugging... but the Select Map widget section of the settings populated with the map(s) on the page with the latter option.
Worked after changing:
<JimuMapViewSelector
onChange={onMapWidgetSelected}
useMapViewIds={props.useMapWidgetIds?.asMutable()}
/>
to
<MapWidgetSelector
onSelect={onMapWidgetSelected}
useMapWidgetIds={props.useMapWidgetIds}
/>
Actually props.useMapWidgetIds still appeared to be undefined when debugging... but the Select Map widget section of the settings populated with the map(s) on the page with the latter option.