<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:xforms="http://www.w3.org/2002/xforms" 
      xmlns:ev="http://www.w3.org/2001/xml-events">
  <head>
    <title>Question about dispatching MIPS</title>
    <xforms:model>
      <xforms:instance>
        <data xmlns="">
          <apply>true</apply>
          <value></value>
          <events/>
        </data>
      </xforms:instance>
      <xforms:bind nodeset="value[/data/apply='true']" relevant="false()"/>
    </xforms:model>
  </head>
  <body>
    <h1>Question about dispatching the MIPS notification events</h1>
    <p>This testcase illustrates the problem when a detaching of a MIP lead to a state change.
       In this case we have a value which is marked as not relevant. When the MIP is removed by
       changing the value of @apply and the make a rebuild, recalculate, revalidate and refresh
       the element becomes relevant as the MIP is removed. Then the question is: Do we see a
       xforms-enable event from a bound control?
    </p>
    
    <div>Initially disabled: 
         <xforms:input ref="value">
           <xforms:label>Value:</xforms:label>
           <xforms:setvalue ref="../events" value="concat('xforms-disabled ', .)" ev:event="xforms-disabled"/>
           <xforms:setvalue ref="../events" value="concat('xforms-enabled ', .)" ev:event="xforms-enabled"/>
         </xforms:input>
    </div>
    
    <div>Change value to something else than 'true' to enable the above control:
         <xforms:select1 ref="apply">
           <xforms:label>Value:</xforms:label>
           <xforms:item>
             <xforms:label>True</xforms:label>
             <xforms:value>true</xforms:value>
           </xforms:item>
           <xforms:item>
             <xforms:label>False</xforms:label>
             <xforms:value>false</xforms:value>
           </xforms:item>
           <xforms:action ev:event="xforms-value-changed">
             <xforms:rebuild/>
             <xforms:recalculate/>
             <xforms:revalidate/>
             <xforms:refresh/>
           </xforms:action>
         </xforms:select1>
    </div>
    <div>
         <xforms:textarea ref="events">
           <xforms:label>The incomming disabled/enabled events on value (first is last):</xforms:label>
         </xforms:textarea>
    </div>
  </body>
</html>

