I’m trying to call a Form Module (inletOutlet Module1) from a RowTemplate inside the same Form:
I receive the following error: `
ModuleNotFoundError: No module named 'Module1'
How am I supposed to call Module1 from inside RowTemplate1?
I’m trying to call a Form Module (inletOutlet Module1) from a RowTemplate inside the same Form:
I receive the following error: `
ModuleNotFoundError: No module named 'Module1'
How am I supposed to call Module1 from inside RowTemplate1?
The stock Anvil way is to use an event on the repeating panel and have the row template trigger that event to execute a function in the enclosing form. Here’s an example:
https://anvil.works/build#clone:UPU6OV7FZJZO3LYY=DW6TUV7D4XIIRBT2XMZJPJA3
Beyond that, Anvil Extras has a Messaging module that provides more of a typical publish/subscribe event system, where you can trigger events and not worry about what is handling them: GitHub - anvilistas/anvil-extras
Thanks for your reply, but I got it working.
I got it to work by inputting:
from .. import Module1
the best way to do it is to type “from .” and have anvil fill in the rest. For some reason it seems like Anvil doesn’t pull it unless you do the autofill. I’m pretty sure it’s user error, though
Ah, sorry, I misread and thought you’d wanted to access the enclosing Form.