How do I get selected Items from ListItemPicker react control?

%3CLINGO-SUB%20id%3D%22lingo-sub-976772%22%20slang%3D%22en-US%22%3EHow%20do%20I%20get%20selected%20Items%20from%20ListItemPicker%20react%20control%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-976772%22%20slang%3D%22en-US%22%3E%3CDIV%3E%3CLISTITEMPICKER%20listid%3D%22%7Bthis.state.selectedList%7D%26lt%3BBR%22%3E%3C%2FLISTITEMPICKER%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BcolumnInternalName%3D%22Title%22%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BitemLimit%3D%7B5%7D%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Bcontext%3D%7Bthis.props.context%7D%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BonSelectedItem%3D%7Bthis.%3CSPAN%3EonSelectedItem%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PAN%3E%3CSPAN%3E%60%3C%2FSPAN%3E%3CSPAN%3E)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E
Senior Member
<ListItemPicker listId={this.state.selectedList}
                  columnInternalName="Title"
                  itemLimit={5}
                  context={this.props.context}
                  onSelectedItem={this.onSelectedItem} />
 
private onSelectedItem(carNumbers: { key: stringname: string }[]) {
  this.state.ListItemPickerItems.length = 0;
  for (const carNumber of carNumbers) {
    this.state.ListItemPickerItems.push(carNumber.name);
    alert(`Item value: ${carNumber.name}`);
  }
}
0 Replies