Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions src/controls/dynamicForm/DynamicForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1287,11 +1287,13 @@ export class DynamicFormBase extends React.Component<
}
} else {
if (defaultValue !== "") {
const termId = defaultValue.split("|")[1];
selectedTags.push({
key: defaultValue.split("|")[1],
key: termId,
name: defaultValue.split("|")[0].split("#")[1],
});
value = selectedTags;
const term = await this._taxonomyService.getTermById(Guid.parse(field.TermSetId), Guid.parse(termId));
value = term;//selectedTags;
}
}
if (defaultValue === "") defaultValue = null;
Expand All @@ -1302,12 +1304,12 @@ export class DynamicFormBase extends React.Component<
anchorId = field.AnchorId !== Guid.empty.toString() ? field.AnchorId : null;
if (item && item[field.InternalName]) {
const _selectedTags = await this.getTermsForModernTaxonomyPicker(field.TermSetId,item[field.InternalName]);
item[field.InternalName].forEach((element) => {
selectedTags.push({
key: element.TermGuid,
name: element.Label,
});
});
// item[field.InternalName].forEach((element) => {
// selectedTags.push({
// key: element.TermGuid,
// name: element.Label,
// });
// });

//value = selectedTags; _selectedTags
value = _selectedTags;
Expand All @@ -1321,7 +1323,12 @@ export class DynamicFormBase extends React.Component<
});
});

value = selectedTags;
const _selectedTags = await this.getTermsForModernTaxonomyPicker(field.TermSetId,selectedTags.map(dv => ({
Label: dv.name,
TermGuid: dv.key
})));
//value = selectedTags;
value = _selectedTags;
stringValue = selectedTags?.map(dv => dv.key + ';#' + dv.name).join(';#');
}
}
Expand Down