Hello,


I've been trying to do the ToDo chore, except I've modified it to a Patient App, which does virtually the same thing. I've created a Screen called PatientList, which houses my patient list. I then have an on click action that takes me to another screen, the Patient Profile screen, which always shows up the same information. I think what may be wrong is my information is getting lost in-between screens. Can someone help me out?


Note - I am using a Core where I import my Dependencies from



Solution

Hello!

When you want to go from List to Detail, you need to pass the Id of the entity that you want to use, and then your Detail screen can query specifically for that data.  Currently, you are just linking to the Detail screen and querying for all entities, so you will always only display the first one.

Try this:

  1. The Detail screen (PatientProfile) must taken an input parameter of what you want to load, in this case a PatientId
  2. Your aggregate on the Detail screen should have a filter on it that uses the input parameter (so Patient.Id = PatientId)
  3. Your link from the List screen (PatientList) must then send the current PatientId to the PatientProfile screen (you would pass GetPatientsByUserId.List.Current.Patient.Id)

Does that make sense?  Do you understand why it works that way?

Thank you

Solution

Craig St.Jean wrote:

Hello!

When you want to go from List to Detail, you need to pass the Id of the entity that you want to use, and then your Detail screen can query specifically for that data.  Currently, you are just linking to the Detail screen and querying for all entities, so you will always only display the first one.

Try this:

  1. The Detail screen (PatientProfile) must taken an input parameter of what you want to load, in this case a PatientId
  2. Your aggregate on the Detail screen should have a filter on it that uses the input parameter (so Patient.Id = PatientId)
  3. Your link from the List screen (PatientList) must then send the current PatientId to the PatientProfile screen (you would pass GetPatientsByUserId.List.Current.Patient.Id)

Does that make sense?  Do you understand why it works that way?

Thank you

Hey Craig! That does make a LOT of sense! I was trying to figure out where I should put the input, but now that you've said it, it was rather obvious.... I was playing around with the filters as well, the one thing I Don't think I'd have been able to figure out without you helping me would be the 3rd step. 


I hope you find money on the street or something the next few days, I'm super grateful!