[SOLVED] Issue with button binding in advanced data list viewer

I am having issues using binding appropriately. I have made a repeateable componenet that has a button with a background picture (the heart). i have removed the text, and made the background of the button translucent.

but, when i save the entire column as a repeatable component.

this is what is saved. and this is what it produces when used

to be clear, i can set the background picture in the repeated element. the issue though is that the blue background and word ‘button’ shouldnt be there.

how do i get rid of these?
@Steven

[UPDATE]
I had not changed the background color of the button.
that’s fixed.

for button text, instead of leaving it as ‘undefined’ i simply entered 1 space.
that’s fixed now!

3 Likes

@jared how are you passing data from your button to your blocks so that you can tell which City is being favorited?

I havent figured that out, not with a listviewer. Instead, I do this
Screen Shot 2020-10-25 at 11.32.11 PM

and this

currently, you have to click into the picture to ‘like’ it.

if the objects were cloned its much easier IMO. @steven, is there a way to figure out which component is clicked, or is there a way to correspond a button to a repeated item?

1 Like

You can figure out which button is pressed in any of the items by using something like the font or background color (and a transparency of 0). But I can’t figure out how to tell which row is clicked of that button. So in short, no, I haven’t been able to figure it out.

1 Like

What @athornock suggested is a possible solution. I’m not sure if this is what you’re asking but I believe if you have a button inside of your data viewer layout there should be an on click block for that button which passes the id of the item that was clicked. This is an example with a label but the same should be true for the button. You can find these blocks by expanding the Data_Viewer_List1 (or whatever you’ve named yours) in the blocks toolbox and then finding the relevant component.

Screen Shot 2020-10-26 at 9.45.45 AM

There should also be a block to get the entire object by the rowId if you want to use that. It might be faster.

Can you clarify what you mean by is there a way to correspond a button to a repeated item?

3 Likes

A technique I have used is to create a button transparent text with a font size of 0.1. Then the text can be “decoded” to determine which row was selected.

1 Like

Thanks for the response Steve!

Here are the options i have available. I only get rowID, nothing related to the button i have in the repeated item. I guess you could do a vlookup? from all rowID’s, find position of current rowID, this would correspond to the button clicked on if there was only 1 button per row i think.

Screen Shot 2020-10-26 at 1.11.31 PM Screen Shot 2020-10-26 at 1.11.38 PM

1 Like

Sorry, what I mean is that your button should have a unique on click event. You should see this under the Data_Viewer_List1 component in the blocks toolbox (towards the bottom left of the image below). I included a picture with a simple example showing the label from my previous post. If you use this method you should know both which button was clicked (if you have multiple) and which row Id is affiliated with this button. Does that make sense? Do you have the ability to expand the DV List to view the child components? It is possible I’m misunderstanding your question as well so I apologize if that is the case. If so, it might be helpful for you to walk me through the whole process that you’re trying to accomplish so I can better understand how to help.

2 Likes

source

2 Likes

Thank you @Steven! I didn’t think to look there.

2 Likes