1.1 --- a/examples/Common/Configurator/Resources/config_database.xml Thu Jul 21 18:49:14 2005 +0000
1.2 +++ b/examples/Common/Configurator/Resources/config_database.xml Thu Jul 21 18:49:50 2005 +0000
1.3 @@ -42,4 +42,10 @@
1.4 <screen>
1.5 <screen-enum value="(Not selected)" price="0"/>
1.6 </screen>
1.7 + <accessories>
1.8 + <accessory-enum value="(Not selected)" price="0"/>
1.9 + <accessory-enum value="DVD+R 10 pack" price="100" storage="DVD+-RW 8x"/>
1.10 + <accessory-enum value="DVD+RW 10 pack" price="200" storage="DVD+-RW 8x"/>
1.11 + <accessory-enum value="CD-RW 10 pack" price="50" storage="CD-RW 48x/24x/48x"/>
1.12 + </accessories>
1.13 </database>
2.1 --- a/examples/Common/Configurator/Resources/config_database.xsl Thu Jul 21 18:49:14 2005 +0000
2.2 +++ b/examples/Common/Configurator/Resources/config_database.xsl Thu Jul 21 18:49:50 2005 +0000
2.3 @@ -85,6 +85,20 @@
2.4 </xsl:copy>
2.5 </xsl:for-each>
2.6 </storage>
2.7 + <accessories>
2.8 + <xsl:variable name="values" select="accessories/accessory-enum/@value"/>
2.9 + <xsl:variable name="storage-values" select="storage/storage-unit/@value"/>
2.10 + <xsl:for-each select="$database/database/accessories/accessory-enum">
2.11 + <xsl:if test="$storage-values[string() = current()/@storage] or not(@storage)">
2.12 + <xsl:copy>
2.13 + <xsl:apply-templates select="@*"/>
2.14 + <xsl:if test="$values[string() = current()/@value]">
2.15 + <xsl:attribute name="value-is-set">true</xsl:attribute>
2.16 + </xsl:if>
2.17 + </xsl:copy>
2.18 + </xsl:if>
2.19 + </xsl:for-each>
2.20 + </accessories>
2.21 <peripherals>
2.22 <keyboard>
2.23 <xsl:variable name="value" select="peripherals/keyboard/@value"/>
3.1 --- a/examples/Common/Configurator/Resources/config_template.xhtml Thu Jul 21 18:49:14 2005 +0000
3.2 +++ b/examples/Common/Configurator/Resources/config_template.xhtml Thu Jul 21 18:49:50 2005 +0000
3.3 @@ -83,7 +83,9 @@
3.4 <h2>Additional Storage</h2>
3.5
3.6 <p template:element="storage-unit">Storage unit
3.7 - <select template:attribute="value" name="{template:this-attribute()}">
3.8 + <select template:attribute="value" name="{template:this-attribute()}"
3.9 + onchange="requestUpdate('{$application-url}accessories', '{template:other-attributes('value', ../storage-unit)}', '{template:other-elements(../../accessories)}', '{template:other-list-attributes('accessory-enum', 'value', ../../accessories)}', '/configuration/accessories')">
3.10 +
3.11 <option template:element="storage-unit-enum" template:expr="@value-is-set" template:expr-attr="selected" template:value="@value"
3.12 value="{@value}"></option>
3.13 </select>
3.14 @@ -96,6 +98,15 @@
3.15 <input type="submit" value="Add storage"
3.16 name="add-storage-unit={template:this-element()}" /></p>
3.17 </div>
3.18 +
3.19 + <div template:element="accessories" template:id="accessories-node" id="{template:this-element()}" class="accessories">
3.20 + <h2>Accessories</h2>
3.21 +
3.22 + <select name="{template:list-attribute('accessory-enum', 'value')}" multiple="multiple">
3.23 + <option template:element="accessory-enum" template:expr="@value-is-set" template:expr-attr="selected" template:value="@value"
3.24 + value="{@value}"></option>
3.25 + </select>
3.26 + </div>
3.27 </div>
3.28 <div id="bottom">
3.29 <div template:element="peripherals" class="peripherals">