microsoft / powercat-creator-kit

This toolkit helps create well-designed Power App experiences on the web & mobile. It contains a component library; PCF controls and other utilities that increase developer productivity.
MIT License
296 stars 49 forks source link

[BUG]: Details List Default row not being selected when app loads #461

Open KeithHR opened 1 month ago

KeithHR commented 1 month ago

Describe the bug I have a details list in an embedded canvas app. I have set the RecordSelected property to true and have set input event to "SetSelection"&Text(Rand()) however when the app loads the row is not being selected by default.

To Reproduce Steps to reproduce the behavior:

  1. Add details list in embeded canvas app
  2. Set RecordSelected field to true in 'Records' property in details list
  3. Set input event to "SetSelection"&Text(Rand())
  4. Play your MDA and open the embedded canvas app

Expected behavior Every record that has RecordSelected set to true should be selected when app loads

AB#3081

KeithHR commented 3 weeks ago

Hello, checking in to see if this has been reviewed? Thanks.

denise-msft commented 2 weeks ago

Hi @KeithHR, Is the detailsList prop SelectionType set to multiple?

KeithHR commented 2 weeks ago

Hi @KeithHR, Is the detailsList prop SelectionType set to multiple?

Hi @denise-msft, I have tried to set it to multiple and it does work for either single or multiple. I would like to have one row in the list be selected by default when a user clicks on the tab to open the app(the list is located on the home screen). The problem seems to be that it will only register the default row if I navigate to a different screen and then navigate back to the home screen where the list is located.

denise-msft commented 1 week ago

Just to clarify, what do you mean by an embedded app? is this embedded in SharePoint, a model driven app as a component, as a custom page as part of a model driven app, or something else?

Also, regarding how the behavior works when you navigate back to the screen - where are you updating the collection, Screen.OnVisible? If you were to display the values of RecordSelected, would the correct values populate the table, and the event behavior is the only thing that's not working? Or are the values not getting updated in the collection on the first load? Is there a way you can please confirm the data is correct on first load?

KeithHR commented 4 days ago

Just to clarify, what do you mean by an embedded app? is this embedded in SharePoint, a model driven app as a component, as a custom page as part of a model driven app, or something else?

Also, regarding how the behavior works when you navigate back to the screen - where are you updating the collection, Screen.OnVisible? If you were to display the values of RecordSelected, would the correct values populate the table, and the event behavior is the only thing that's not working? Or are the values not getting updated in the collection on the first load? Is there a way you can please confirm the data is correct on first load?

When I first select the tab that the canvas app is on: image

While using the canvas the app, if I navigate back to the Details List: image