Within onExecute, and you inspect event.selectedRows.getValueByName("ID"), the first time you execute the command for a selected item this is correct, but if you highlight another row, and execute the command, the value returned by the getValueByName doesn't update.
If you change the row selection using the checkbox on the left column this gets the correct value.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Code being used (Adapted from scaffolded code from Yeoman generator for a ListView Extension):
@override
public onExecute(event: IListViewCommandSetExecuteEventParameters): void {
switch (event.itemId) {
case 'COMMAND_1':
Dialog.alert(`SELECTED ITEM: ${event.selectedRows[0].getValueByName("ID")}`); // This is the modified line from the scaffolded code
break;
case 'COMMAND_2':
Dialog.alert(`${this.properties.sampleTextTwo}`);
break;
default:
throw new Error('Unknown command');
}
}
I seem to be having the same issue for list extension, the first item is fine but for the next item it receives the same rowid as the first. As soon as I right click on an item it remembers the selected id, if I then click out of the list and right click on another item, same thing happens. Been happening since yesterday.
I seem to be having the same issue for list extension, the first item is fine but for the next item it receives the same rowid as the first. As soon as I right click on an item it remembers the selected id, if I then click out of the list and right click on another item, same thing happens. Been happening since yesterday.
Does the rowid come through correctly if you use the checkbox/selector in the first column on the view?
:O yes it does.
@zaiby That's the issue I'm seeing. The Row ID only updates correctly when selecting the row using the row selector. Do what any normal user does and just click somewhere else in the row to select it, and the rowid doesn't change.
yes, same issue
Thanks for submitting this, but as you said in the other issue submitted previously, this is identical to the #4769. As such, let's keep things consolidated...
@andrewconnell Up to you which ticket to nix, mine has the docs metadata :)
All that's used for is to keep the issue tied to the page where the comment was left. It doesn't impact the issue.
I know there is work being done on the list codebase around events... unclear exactly what's being done of if this is related so I have to research...
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues