Help with listview selection

Hi everyone! New to MIT app inventor and I have a quick question
I want to make an app where there's two layouts: One contains a search bar and a list view. The other (bottom half) has layouts that are invisible, each with the name of a student. The point is someone can search a name in the search bar, and then the listview will show all the people with that name, and then when you select something from the listview, that student's layout will become visible in the bottom half of the screen.
I know how to do a custom search bar and a listview but where I'm lost is: how do i open the corresponding layout of the selection in the listview?


ListView already has a search don't need to create a new one...regarding to show/hide the specific information, place whatever you want to display (labels, buttons...) in an Arrangement and you can set visible property to true/false.

You don't need a different layout for each student (I'm assuming all students will have a similar layout). You can have only one and place on it the data corresponding to the selected one. The question is, where do you have the student's data?

I'm planning on inputting the info manually. I want for each student a picture, a name, and a grade (for now. I plan on adding a feature where the teachers can add "reviews" or personal notes on the student but that's a project for later). So if say someone searches "Bob" and selects his name from the list, I know that I can then set the label in the student info field to Bob. How can I also set the picture in the student field to his picture?
Thanks for the help!

You can place an Image component and set the Picture property to the student photo.

You can have a list of students where each student is a list of "Name", "Grade" and "Photo". In the ListView you place a list with only the names and, after picking an element in the ListView, you can use the ListView.Selection (which will contain the name of the chosen student) to search in the list the data of that student.

You can even set ListView with MainText, Detail and Image, and display the three parameters in the ListView.

1 Like