Hi there,
I have a web page with a link to a url eg./customer/showitem?id=7, which displays details of a specific customer in a child-window using method showitem() in class customer. The method may set the value of a customer class attribute that controls an alert which is displayed when the page is loaded (eg. self.onloadalert="Warning! Customer is in debt.").
If the customer window is closed, then opened again (perhaps with a different id eg. /customer/showitem?id=8), details of the new customer are displayed correctly, but the onload warning above still appears because customer.onloadalert has not changed since the last call (I've verified this it via. debugging). It looks as though even though the method runs from scratch on the 2nd url call, the customer class (and all its attribute values) still persists from the previous call.
I can solve the problem for this particular attribute by resetting it at the beginning of showitem(), but what about other customer.attributes? (especially if there are a lot of them) - I can't reset them all by name! How can I ensure that the class reloads (hence re-initialises) for each url call?
I am using CherryPy (3.20rc1), although I guess the question is applicable to other frameworks that use the same /class/method?params url format.
Any help would be appreciated.
Alan