I’ve tried to connect my code to my server code and I get the following error: SerializationError: Cannot pass Form1 object to a server function: arguments [0]
def Run_click(self, keys,sender, event_name):
"""This method is called when the button is clicked"""
text1 = self.Script_Box.text
call_enter_text = anvil.server.call('enter_text', self)
pass
You don’t want to pass your form to the server function. Instead pass data to the server function, e.g. the text from the form:
def Run_click(self, keys,sender, event_name):
"""This method is called when the button is clicked"""
text1 = self.Script_Box.text
call_enter_text = anvil.server.call('enter_text', text1)
And then use that text in the server function.
Edit: the original error, SerializationError, always means you’re trying to pass something to the server (or from server to client) that you cannot pass between them.
Passing a Form to the Server, so that it could add data, was one of the first things I tried, many moons ago.
But that’s not allowed (see Valid arguments and return values). In fact, it’s actually much more efficient (faster) to pass just the data back and forth. So, here the limitation works in your favor.
Since this is a different error, you should start a new post with it, and give the relevant code. There’s not enough context to be able to know what code is causing the error.