title: xforms and getting a particular value from a list
body: <p>There is a small code that works with appache tomcat and chiba-3.0.0b2</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:events="http://www.w3.org/2001/xml-events"&gt;
  &lt;xhtml:head&gt;
      &lt;xforms:model&gt;
  </code></pre>
  
  <p>there is instance where to get a dynamic list</p>
  
  <pre><code>        &lt;xforms:instance id="xs"&gt;
              &lt;xs&gt;
                  &lt;x kd="1" name="one"&gt;&lt;/x&gt;
                  &lt;x kd="2" name="two"&gt;&lt;/x&gt;
                  &lt;x kd="3" name="three"&gt;&lt;/x&gt;
                  &lt;!-- ... --&gt;
              &lt;/xs&gt;
          &lt;/xforms:instance&gt;
      &lt;/xforms:model&gt;
  &lt;/xhtml:head&gt;
  &lt;xhtml:body&gt;
  </code></pre>
  
  <p>There is a switch-case construction</p>
  
  <pre><code>&lt;xforms:switch&gt;
  </code></pre>
  
  <p>list case</p>
  
  <pre><code>&lt;xforms:case id="list"&gt;
      &lt;xhtml:ul&gt;
          &lt;xforms:itemset nodeset="instance('xs')/x"&gt;
              &lt;xhtml:li&gt;
                  &lt;xforms:trigger&gt;
                      &lt;xforms:toggle events:event="DOMActivate" case="onerec" /&gt;
                      &lt;xforms:value ref="@kd" /&gt;
                      &lt;xforms:label ref="@name" /&gt;
                  &lt;/xforms:trigger&gt;
              &lt;/xhtml:li&gt;
          &lt;/xforms:itemset&gt;
      &lt;/xhtml:ul&gt;
  &lt;/xforms:case&gt;
  </code></pre>
  
  <p>one record case</p>
  
  <pre><code>&lt;xforms:case id="onerec"&gt;
  </code></pre>
  
  <p>How to get a last submitted button value instead of '2' in formula [@kd=2] (i.e instead of [@kd=2] i like  @kd='clicked trigger value')???</p>
  
  <pre><code>    &lt;xforms:itemset nodeset="instance('xs')/x[@kd=2]"&gt;
          There are name "&lt;xforms:label ref="@name" /&gt;" and id "&lt;xforms:value ref="@kd" /&gt;"
      &lt;/xforms:itemset&gt;
  </code></pre>
  
  <p>There is a back button</p>
  
  <pre><code>    &lt;xforms:trigger&gt;
  </code></pre>
  
  <p>opening the list case</p>
  
  <pre><code>                &lt;xforms:toggle events:event="DOMActivate" case="list" /&gt;
                  &lt;xforms:label&gt;Back&lt;/xforms:label&gt;
              &lt;/xforms:trigger&gt;
          &lt;/xforms:case&gt;
      &lt;/xforms:switch&gt;
  &lt;/xhtml:body&gt;
  &lt;/xhtml:html&gt;
  </code></pre>
  
  <p>Thank you</p>