Added a DEMO clone app to help this conversation. By my read of the documentation and prior responses to this simple action… starting this app should just reroute the use to our website. And, you can see that the link ‘click’ event is executed, however, only by clicking on the link will actually navigate to the url. To repeat/clarify, I want to redirect a user to an outside url, in code.
Still trying to get this to work, I investigated the http module, but I don’t think I should need that. As I continue to test getting a link click event to fire, it is firing… so I’m really puzzled as to why things are not working.
I thought I had solved this, but apparently not. As soon as my app has authenticated a user, I want to send them to another url/website. Consider this code, I have a link on my form named testlink. This is raising the click event in that I do see the debugging text in my output panel, however, the raise_event is not navigating to google.com. When I explicitly click on the link though, it does.
class homepage(homepageTemplate):
def __init__(self, **properties):
# Set Form properties and Data Bindings.
self.init_components(**properties)
anvil.users.logout()
while not anvil.users.login_with_form():
pass
self.testlink.url="https://google.com"
self.testlink.raise_event('click')
def testlink_click(self, **event_args):
print('this is the testlink click event')
print(event_args)
https://anvil.works/build#clone:GVN5AYMPNTUAXYCF=IHPE55EDVKKMBHRPFRSJ5DDG