Self.instances ID's are disappearing after refresh in QuasarPage #442
Replies: 9 comments
-
You should not work with the self.instances of a container such as a Div or WebPage. instances is a class attribute of WebPage and JustpyBaseComponent. What are you trying to do? Which functionality are you looking for? |
Beta Was this translation helpful? Give feedback.
-
I built single web page application, in which there is dynamic output. This means, based on some parameters, the output is changing immediately. But now I have another Problem |
Beta Was this translation helpful? Give feedback.
-
Please take a look at the example here which shows how to change a Div content immediately as input changes: |
Beta Was this translation helpful? Give feedback.
-
I have forgotten to write, that as dynamic output I am using QList |
Beta Was this translation helpful? Give feedback.
-
Basically the same idea. In the event handler change the QList as you want. |
Beta Was this translation helpful? Give feedback.
-
For changing the content of the QList I am accessing and changing it like this in the event handler. msg.page.components[1].components[0].components[3].components[1] = XXXXXXXXX Is this not the correct way to do? |
Beta Was this translation helpful? Give feedback.
-
It is better to assign the element you want to change to an attribute of the page like in this example: |
Beta Was this translation helpful? Give feedback.
-
Just take following example(QList example a little changed), now the question is when I click the buttons, for example Button 7, I want that only the text attributes in QList change to something different, the only way I can see to access on QList Text Column, and change every Cell is to access with Components. Another Problem is that I have global variables in python. How to reset all them to defaults when a new tab or page opened.
** Another Problem is that I have internal global variables in python. How to reset all them to defaults when a new tab or page opened. |
Beta Was this translation helpful? Give feedback.
-
I solved the second problem, using global variables as page attributes. |
Beta Was this translation helpful? Give feedback.
-
I have created some jp.Divs and gave them as arguments ID="ID_xxxxx".
So I used the ID to change the content in events with the following way
Self.instances["ID_xxxxx"] = something.
After refreshing the website server could not find this ID_s them, the solution was, rebuild the project or close the tab and open it again.
So I do not know if it is a bug or not. Or it is not recommended to work with self.instances in the events?
Another salutation for that was to work only with components.
Another Problem that I have now, when I open a page to make changes, and after that I open another tab or new window. Or even another browser, it is remembering the changes.
How to make it so that for each tab, windows or generally any new connection sessions, everything set to defaults?
Beta Was this translation helpful? Give feedback.
All reactions