Hi All,
I am trying to make a b:select selection to render an other b:select.
I have the b:on="change" event rendering the other b:select, but i cannot seem to extract the needed options. I have a<div> with xml in it. The value of the first b:select determines the id of the<div>. I want to have the names of the elements inside the <div>/root/ to be the options in the second b:select. How do I do this?
the xml:
<div id="type1">
<root>
<element1 />
<element2 />
</root>
</div>
<root>
<element1 />
<element2 />
</root>
</div>
the code:
<b:select b:name="objects" >
<s:event b:on="change">
<s:render b:destination="id('elements')">
<b:select b:name="elements" >
<s:for-each b:select="{concat(id('objects')/@value, '/root/*')}">
<b:option b:value="name(.)">name(.)</b:option>
</s:for-each>
</b:select>
</s:render>
</s:event>
<b:option b:value="type1">type1</b:option>
<b:option b:value="type2">type2</b:option>
</b:select>
<s:event b:on="change">
<s:render b:destination="id('elements')">
<b:select b:name="elements" >
<s:for-each b:select="{concat(id('objects')/@value, '/root/*')}">
<b:option b:value="name(.)">name(.)</b:option>
</s:for-each>
</b:select>
</s:render>
</s:event>
<b:option b:value="type1">type1</b:option>
<b:option b:value="type2">type2</b:option>
</b:select>
When selecting type1 in the first b:select, the second b:select should show 'element1' and 'element2'.
How do I do this?
Thanks in advance,
Lesley

I have the solution
18 July, 2008 - 13:35 — burger.ljI can do this using xml-transform. The transform renders the second b:select inside a
<div>.The other way to solve the problem is to put an id() around the {concat}, which makes it work.