Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <code>select</code> element is a poor match for your requirements because it only has a single node binding. Instead of trying to subvert the control's semantics in that way, I would use a <code>repeat</code> of <code>trigger</code> elements with <code>insert</code> and <code>delete</code> actions, styled with CSS in such a way as to provide the appearance of a multi-selection control.</p> <p>Your question doesn't mention the format of the data, but supposing instance data like this:</p> <pre><code>&lt;xf:instance id="options"&gt; &lt;options xmlns=""&gt; &lt;option selected="false"&gt; &lt;first /&gt; &lt;/option&gt; &lt;option selected="false"&gt; &lt;second /&gt; &lt;/option&gt; &lt;option selected="false"&gt; &lt;third /&gt; &lt;/option&gt; &lt;option selected="false"&gt; &lt;fourth /&gt; &lt;/option&gt; &lt;option selected="false"&gt; &lt;fifth /&gt; &lt;/option&gt; &lt;/options&gt; &lt;/xf:instance&gt; &lt;xf:instance id="results"&gt; &lt;results xmlns="" /&gt; &lt;/xf:instance&gt; </code></pre> <p>Then you should be able to get the behaviour you want with something along these lines (not tested):</p> <pre><code>&lt;xf:repeat id="repeat" nodeset="instance('options')/option"&gt; &lt;xf:trigger appearance="minimal"&gt; &lt;xf:label&gt; &lt;xf:output value="name(*)" /&gt; &lt;/xf:label&gt; &lt;xf:action ev:event="DOMActivate" if="@selected = 'false'"&gt; &lt;xf:setvalue ref="@selected" value="'true'" /&gt; &lt;xf:insert origin="instance('options')/option[index('repeat')]/*" context="instance('results')" nodeset="*" at="count(../*)" position="after" /&gt; &lt;/xf:action&gt; &lt;xf:action ev:event="DOMActivate" if="@selected = 'true'"&gt; &lt;xf:setvalue ref="@selected" value="'false'" /&gt; &lt;xf:delete nodeset="instance('results')/*[name(.) = name(current()/*)]" /&gt; &lt;/xf:action&gt; &lt;/xf:trigger&gt; &lt;/xf:repeat&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload