# HG changeset patch # User paulb # Date 1122064750 0 # Node ID 4c793cf266d8f2c7ecab33435c194de8906f751c # Parent dd93b1723e894ddfc1382d0f44377e87799b25f0 [project @ 2005-07-22 20:39:04 by paulb] Removed application-url. diff -r dd93b1723e89 -r 4c793cf266d8 docs/in-page-updates.html --- a/docs/in-page-updates.html Fri Jul 22 20:32:51 2005 +0000 +++ b/docs/in-page-updates.html Fri Jul 22 20:39:10 2005 +0000 @@ -129,7 +129,7 @@ responsible for displaying the type values:

  <p>
Item type:
<select template:element="type" name="{template:list-attribute('type-enum', 'value')}" multiple="multiple"
onchange="requestUpdate(
'{$application-url}comments',
'comments',
'{template:list-attribute('type-enum', 'value')}',
'{template:other-elements(../options)}',
'{template:child-attribute('value', template:child-element('comment', 1, template:other-elements(../options)))}',
-
'{$application-url}comments'
+
'comments'
The URL which will serve the in-page update requested by this -field. We use a special variable called application-url -which will need to be provided to the template when generating the Web -page. This will produce something like the following:
+field. Since the value stated is a relative reference to a resource, it +will produce something like the following:
http://localhost:8080/comments
So the request for an in-page update will be sent to this generated URL.
@@ -241,20 +240,9 @@ parameter directly from the request parameters; this parameter is added to a collection of parameters that will be used to control the stylesheet when making the final Web page output.

-

Another parameter that will be used in stylesheet processing is -the application-url parameter mentioned above. We -obtain the address and port of the Web server environment and add the -result as a simple URL to the application-url -stylesheet parameter. Finally, we send the output to the user but -employing the additional stylesheet parameters to configure the result:

-
        # Add information essential for in-page requests.

if trans.get_server_port() == "80":
stylesheet_parameters["application-url"] = \
"http://%s%s" % (trans.get_server_name(), trans.get_path_without_query())
else:
stylesheet_parameters["application-url"] = \
"http://%s:%s%s" % (trans.get_server_name(), trans.get_server_port(), trans.get_path_without_query())

# Complete the response.

self.send_output(trans, [trans_xsl], structureFinally, we send the output to the user but employing the additional +stylesheet parameters to configure the result:

+
        # Complete the response.

self.send_output(trans, [trans_xsl], structure, stylesheet_parameters)

In order to introduce the infrastructure mentioned above which separates requests for Web pages from requests for JavaScript files, we diff -r dd93b1723e89 -r 4c793cf266d8 examples/Common/Configurator/Resources/config_template.xhtml --- a/examples/Common/Configurator/Resources/config_template.xhtml Fri Jul 22 20:32:51 2005 +0000 +++ b/examples/Common/Configurator/Resources/config_template.xhtml Fri Jul 22 20:39:10 2005 +0000 @@ -22,13 +22,13 @@

Model + onchange="requestUpdate('accessories', '{template:other-attributes('value', ../storage-unit)}', '{template:other-elements(../../accessories)}', '{template:other-list-attributes('accessory-enum', 'value', ../../accessories)}', '/configuration/accessories')"> diff -r dd93b1723e89 -r 4c793cf266d8 examples/Common/Configurator/__init__.py --- a/examples/Common/Configurator/__init__.py Fri Jul 22 20:32:51 2005 +0000 +++ b/examples/Common/Configurator/__init__.py Fri Jul 22 20:39:10 2005 +0000 @@ -95,15 +95,6 @@ else: trans_xsl = self.prepare_output("configuration") - # Add information essential for in-page requests. - - if trans.get_server_port() == "80": - stylesheet_parameters["application-url"] = \ - "http://%s%s" % (trans.get_server_name(), trans.get_path_without_query()) - else: - stylesheet_parameters["application-url"] = \ - "http://%s:%s%s" % (trans.get_server_name(), trans.get_server_port(), trans.get_path_without_query()) - # Complete the response. self.send_output(trans, [trans_xsl], configuration, stylesheet_parameters) diff -r dd93b1723e89 -r 4c793cf266d8 examples/Common/VerySimple/Resources/structure_multivalue_template.xhtml --- a/examples/Common/VerySimple/Resources/structure_multivalue_template.xhtml Fri Jul 22 20:32:51 2005 +0000 +++ b/examples/Common/VerySimple/Resources/structure_multivalue_template.xhtml Fri Jul 22 20:39:10 2005 +0000 @@ -22,7 +22,7 @@ Item type: