0
    def view(self,page,params):
        db = Database.ConnecttoDatabase()
        main_colum = ft.Column()
        for konto in Database.readKonto(db):
            para = konto[0]
            main_colum.controls.append(
                ft.Card(
                    content=ft.Container(
                        content=ft.Column(
                            [
                                ft.ListTile(
                                    leading=ft.Icon(ft.icons.ALBUM),
                                    title=ft.Text(konto[1]),
                                    subtitle=ft.Text(konto[3]),
                                    on_click=lambda _: page.go(f"/next_view/{konto[0]}")
                                ),
                            ]
                        ),
                        width=400,
                        padding=10,
                    ),
                ),
            )

on_click=lambda _: page.go(f"/next_view/{konto[0]}") the konto[0] parameter is for all entrys the last id from database read loop

how to correctly assign the parameters to the lambda function

l0tek
  • 1
  • by the time you execute the on_click method, you have iterated over all the rows and konto is straggling on as the last row by chance. – JonSG Mar 16 '23 at 15:18

0 Answers0