Hello Friends:
Let me follow-up my question yesterday with a trivial use-case involving it.
Let’ say the following snippet is for the simplest of Landing Pages, one only with a Button component labeled Login (as depicted).
Landing Page Form code:
class LandingForm(LandingFormTemplate):
def __init__(self, **properties):
self.init_components(**properties)
# 'Click' Event handler for Login button.
def btn_login_click(self, **event_args):
if not anvil.users.login_with_form(allow_cancel=True,allow_remembered=False):
print('Path-A') # User clicked Cancel button.
else:
print('Path-B') # This is never reached under any circumstance.
self.textbox_hello_world.visible = True
Now, as long as the user submits invalid eMail addresses, login_with_form(...)
loops internally forever. The only way out is either to (A) click the login form’s Cancel button and Path-A is executed; or (B) submit a valid eMail address and (to my surprise) Path-B is not executed. In fact, Path-B is never executed because login_with_form(...)
vectors off somewhere else.
In this trivial example, a TextBox with Hello, World! is made visible on success, but practical cases might perform, say, additional user-validation logic, or navigate to a specific App based on that logic.
How can one perform such if/else
conditional logic if Path-B can never execute?
Thank you!