Object has no attribute 'popper'

I have a list of dicts, and am plotting the list in a data grid. Because each dict would overflow the grid cell, I decided to put a button in each DataRowPanel, and then make it so that when a user hovers on the cell, it displays the rest of the dictionary content.

However, I’m repeatedly met with object has no attribute 'popper' for when I try to 1. put the button in the repeating panel and then have the dictionary info display on hover (in which the error is becomes that the button object has no attribute) and 2. just put the dictionary into the repeating panel with no button but still implement a hoverover feature.

My code is

for i, d in enumerate(list_of_dicts):
   self.button = Button(text = foo) # foo already defined outside loop
   row = i % self.rows              # rows and columns are unimportant, already work with populating grid
   column = i // self.rows
   rp.items[row][column] = self.button
   
   self.button.popover(dictionary,
                       placement = 'bottom',
                       animation = False,
                       trigger = 'stickyhover')
   # Populate cells one at a time
   rp.items = rp.items
   time.sleep(0.5)

def button_click(self, **event_args):
   self.button.pop('toggle')
   sleep(.1)

I’m essentially following what was done in Stu’s example here since I’m still a bit new to both the feature and the documentation that comes with it.

Do you have a clone link that highlights the issue. Will be easier for debugging this issue.

Just from the script it’s hard to tell. rp.items = rp.items - should it be outside of the loop?

Hey Stu, sorry for the wait. My original app had a lot of “private” info like my MongoDB connection string so I made a copy with the DB query hardcoded as a list of dicts as it would be in the original app. Here is the trimmed version with just the form where I’m having trouble.

It’s able to successfully populate the grid, and I’m trying to make it so that there’s a hover functionality that displays the overflowed information.

https://anvil.works/build#clone:BA22VVVYQG5S24JZ=YM2PLOJ3XF4A6TATVNK4J5LH

self.button.popover(display,
                     placement = 'bottom',
                     animation = False,
                     trigger = 'stickyhover')

Commenting this part out will populate the grid with the anvil button objects like intended so it seems like the issue lies in popover

display seems to be a dictionary - it should be a string or an Anvil component.

I’ll make a note to improve the error.

1 Like

Thank you so much Stu, I just casted it as a str() and it worked!