Select ID when long click on item of a listview that is using a dictionary

Is not working ? What’s going on in your result?

It give me just the last ID of the listview

But you can simplify: delete by simply taking the index from the list view. There is no need to delete by id, as it is in the long click event.

I need the ID to delete on the mysql table

What is the format of the listview_entrada list ?
Key: Value, Key-Value, Key Value ?

I am setting the list like that

Isn’t it easier to save all the id in a variable and then get the id with the position of the listview?Like my example?

1 Like

I am trying that, I am not so fast, rsrs

It works, thanks @pepocero and @Rogerio_Rios

image

Your example @pepocero it will work.
But, why doesn’t the first block @Miguel_Silva posted work ?

Don’t forget to mark the solution. :+1:

I’m not sure.

Can it be because “position” is always 0?

I dont know. I thought his @Miguel_Silva blocks should work. I don’t know why it didn’t work.
:man_shrugging:
He said It was returning the last ID.

I simplified my job, this is the blokcs are working for me, I am using “position + 2” because on a csv table the first list is the names of columns:
image

I don’t know what to do, but the solution was
@pepocero. Then you changed. And that is another moment. I do not agree with changing the solution. The @pepocero gave you the way with practically ready blocks. Now you have completely changed …
I do not agree with changing the solution. I do not admire these situations where the user questions and after help, says he solved it alone.

1 Like

I agree with @Rogerio_Rios . And it’s not because I want you to mark my answer as a solution, because I don’t care.

It’s because if you’ve arrived to some solution it’s thanks to others who have guided you (In fact, you didn’t notice that the position was always zero until we mentioned it.)

Marking your own answer as a solution doesn’t seem to be the smartest option.

This kind of situation happens a lot in the forum. They come asking something they don’t know and then come up with a solution thanks to an idea given to them by another user and then mark their answer as a solution.

You can keep doing it for me.
I don’t care.
But if you come to ask something in the forum is because you do not know. Or you don’t know how to do it. If you come to a solution is because of the interaction with other users. So the solution is not yours. If it was, you wouldn’t have asked any questions, you would have reached the solution without creating any posts.

1 Like

This is the summary … And I agree …

Friend, your answer doesn’t totally works for me, it presents error, must I mark as a solution? it help me, but it is not a solution, guided me it is true, I just marked my code as a solution to help someone who is searching a solution more easy and that is working. and I thanked you for help, i doesn’t said that I reached the solution alone.
One more time, thanks for your help

I will continue to “teach you how to fish instead of giving the fish”

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.