The first argument of Anvil.call

While waiting the official answer, I found the work around thanks to these posts:

In 3. Custom HTML python code
def my_method(self, name):
    print (name)
    self.parent.raise_event('x-update-label', new_text = name)

in 3. Custom HTML -  HTML code


// change $('.content') to this
function myFunc() {
    anvil.call(this, 'my_method', 'world')
}

in 2 Blank Panel
def __init__(self, **properties):
    # Set Form properties and Data Bindings.
    self.init_components(**properties)
    self.set_event_handler('x-update-label', self.update_label)
    
  def update_label(self, new_text, **event_args):
    print (new_text+ "++++++++++++==")
2 Likes