Files changed (3)
+When having dynamic pages which change without a complete reload, Ajax is in play. For making these things easier :mod:`quantumcore.dynamicpage` provides some helper functionality for sending data from and to the rendered HTML page.
+ The Page object is the component which binds everything together. It's the one rendering the actual HTML page and knows about all variants and actions.
+ A ``PageVariant`` class holds the slot methods explained above and is referenced from a ``Page`` object by name via a dictionary.
+ An action is a method inside the ``Page`` object which performs some functionality and returns some commands to be send to the HTML page.
+ The HTML page is the output of a ``Page`` object when being called. One can see it as the representation of the ``Page`` object and the selected ``PageVariants`` on the user's screen. This HTML page can change on the fly without a complete reload by replacing, deleting or appending parts of it.
+Lets assume that a page is rendered on a user's browser and the user clicks the ``Edit`` button. We now want one part of the page to be replaced by the edit form.
+ * A handler on the server needs to respond to this action. Let's assume it responds to ``/ajax/editform``.
+ 5. The ``editform()`` method is somehow creating the form and using a helper function to prepare commands to be send to the HTML page.
+ 7. A :term:`jQuery` plugin is called when receiving the response, reading the commands and performing them.
+ 8. One command will be "replace the contents of DOM element ``content`` with this bit of HTML" and the HTML will be the editform.
+In the end the user will see the editform. Additionally we might have some command which simply calls some initialization script for e.g. activating an Rich Text Editor or something similar.
+Something like this will also happen when the user saves the form. Only a ``POST`` request probably with normal POST data will be sent to the server (to a different URL, e.g. ``/ajax/save``) and again some commands will be received, either for displaying errors or for replacing the form by the new content.