Import my home page inside my login page so that after successful login I have to enable certain components in the Home Page
I am cross referencing Home Page in Login Page and vice versa , is it not allowed ?
What I’ve tried and what’s not working:
this is the error i get
AttributeError: module ‘xpense_tracker_v1.HomePage’ has no attribute ‘HomePage’ at [NewUserReg, line 13](javascript:void(0)) called from [HomePage, line 10](javascript:void(0))
Code Sample:
from ..NewUserReg import NewUserReg #this is the import from my home page
from ..HomePage import HomePage #this is the import from my Login Page
I get it Jay…thx… I moved the import inside my button click event now it does not give any error but iam unable to set a value in of a component inside the home page for example
def btn_save_click(self, **event_args):
from ..HomePage import HomePage
HomePage().label_2.text=self.txt_usrname.text
HomePage().label_3.text=date.today().strftime('%d-%b-%Y')
Note : the form is containerized inside an alert like this
When you use code like that you’re creating a new instance of the form, so you’re not changing the label text on the original instance. Using get_open_form () gets you the original instance, which is why that works.