# HG changeset patch # User paulb # Date 1122056820 0 # Node ID a7ea3c1684c1e479a71631fe955b26a31d02b15c # Parent 7e7d9dbcec620fdd8d93dfb675f98d49140de747 [project @ 2005-07-22 18:26:56 by paulb] Added usage of the child-element and child-attribute functions for coherent references to potentially non-existent nodes in the form data. diff -r 7e7d9dbcec62 -r a7ea3c1684c1 docs/in-page-updates.html --- a/docs/in-page-updates.html Fri Jul 22 18:26:38 2005 +0000 +++ b/docs/in-page-updates.html Fri Jul 22 18:27:00 2005 +0000 @@ -61,8 +61,8 @@
options
element, investigate
the values associated with the type
element.comment
-element, then add any attributes that may be found on existing
- comment
elements within the current type
+element, then add any attributes that may be found on
+existing comment
elements within the current type
element.<p>+ style="font-weight: bold;">onchange="requestUpdate('{$application-url}comments', '{template:list-attribute('type-enum', 'value')}',
Item type:
<select template:element="type" name="{template:list-attribute('type-enum', 'value')}" multiple="multiple"
onchange="requestUpdate('{$application-url}comments', '{template:list-attribute('type-enum', 'value')}',
'{template:other-elements(../options)}', '{template:other-attributes('value', ../options/comment)}',
'/structure/item/options')">
<option template:element="type-enum" template:expr="@value-is-set" template:expr-attr="selected"
template:value="@value" value="{@value}" />
</select>
</p>
This complicated string calls a special update request JavaScript function which triggers the in-page update, and it specifies the following things:
@@ -151,10 +151,15 @@ exposed comment field does not disappear (for example, if we already have "Personal" selected but select "Important" in addition), and so we need to provide the details of the field which holds the value of the -comment text. We find such details by referencing thecomment
-element from the type
element and stating that we want the
- value
attribute on that comment
-element.
+comment text. We find such details by referencing the options
+element from the type
element and stating that we want
+the value
attribute on any comment
+element that may exist. Note that we cannot reference the comment
+element directly since it may not exist at first, but then come into
+being after an update, but not be referenced here in this parameter;
+therefore, we need to make up the final part of the reference using the
+special template:child-attribute
+and template:child-element
functions.