XSLTools

Change of docs/in-page-updates.html

179:a7ea3c1684c1
docs/in-page-updates.html
     1.1 --- a/docs/in-page-updates.html	Fri Jul 22 18:26:38 2005 +0000
     1.2 +++ b/docs/in-page-updates.html	Fri Jul 22 18:27:00 2005 +0000
     1.3 @@ -61,8 +61,8 @@
     1.4        <li>Inside this new <code>options</code> element, investigate
     1.5  the values associated with the&nbsp;<code>type</code> element.</li>
     1.6        <li>If any of the selected type values is "Personal", make a new <code>comment</code>
     1.7 -element, then&nbsp;add&nbsp;any attributes that may be found on existing
     1.8 -        <code>comment</code> elements within the current <code>type</code>
     1.9 +element, then&nbsp;add&nbsp;any attributes that may be found on
    1.10 +existing <code>comment</code> elements within the current <code>type</code>
    1.11  element.</li>
    1.12      </ol>
    1.13    </li>
    1.14 @@ -128,7 +128,7 @@
    1.15  added or removed, we add an event attribute on the form field
    1.16  responsible for displaying the type values:</p>
    1.17  <pre>  &lt;p&gt;<br />    Item type:<br />    &lt;select template:element="type" name="{template:list-attribute('type-enum', 'value')}" multiple="multiple"<br />      <span
    1.18 - style="font-weight: bold;">onchange="requestUpdate('{$application-url}comments', '{template:list-attribute('type-enum', 'value')}',<br />     &nbsp;'{template:other-elements(../options)}', '{template:other-attributes('value', ../options/comment)}',<br />      '/structure/item/options')"</span>&gt;<br />      &lt;option template:element="type-enum" template:expr="@value-is-set" template:expr-attr="selected"<br />        template:value="@value" value="{@value}" /&gt;<br />    &lt;/select&gt;<br />  &lt;/p&gt;</pre>
    1.19 + style="font-weight: bold;">onchange="requestUpdate('{$application-url}comments', '{template:list-attribute('type-enum', 'value')}',<br />     &nbsp;'{template:other-elements(../options)}',<br />      '{template:child-attribute('value', template:child-element('comment', 1, template:other-elements(../options)))}',<br />      '/structure/item/options')"</span>&gt;<br />      &lt;option template:element="type-enum" template:expr="@value-is-set" template:expr-attr="selected"<br />        template:value="@value" value="{@value}" /&gt;<br />    &lt;/select&gt;<br />  &lt;/p&gt;</pre>
    1.20  <p>This complicated string calls a special update request JavaScript
    1.21  function which triggers the in-page update, and it specifies the
    1.22  following things:</p>
    1.23 @@ -151,10 +151,15 @@
    1.24  exposed comment field does not disappear (for example, if we already
    1.25  have "Personal" selected but select "Important" in addition), and so we
    1.26  need to provide the details of the field which holds the value of the
    1.27 -comment text. We find such details by referencing the&nbsp;<code>comment</code>
    1.28 -element from the <code>type</code> element and stating that we want the
    1.29 -    <code>value</code> attribute on that&nbsp;<code>comment</code>
    1.30 -element.</li>
    1.31 +comment text. We find such details by referencing the <code>options</code>
    1.32 +element from the <code>type</code> element and stating that we want
    1.33 +the <code>value</code> attribute on any <code>comment</code>
    1.34 +element that may exist. Note that we cannot reference the <code>comment</code>
    1.35 +element directly since it may not exist at first, but then come into
    1.36 +being after an update, but not be referenced here in this parameter;
    1.37 +therefore, we need to make up the final part of the reference using the
    1.38 +special <code>template:child-attribute</code>
    1.39 +and <code>template:child-element</code> functions.</li>
    1.40    <li>Finally, we need to provide some context to the application to
    1.41  tell it something about where in the complete form data structure the
    1.42  updated information resides.&nbsp;</li>