RE: Question re bind constraint

Hi Chris and John,
see the sample i post. This can be done even without current(). 
Best regards. Giovanni

------------ tested with forms player - end -----------------
<html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:xforms="http://www.w3.org/2002/xforms"
        xmlns:fp="urn:formsplayer.com"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
    <object id="FormsPlayer" classid="CLSID:4D0ABA11-C5F0-4478-991A-375C4B648F58" width="0" height="0">
        <b>FormsPlayer has failed to load! Please check your installation.</b>
    </object> <?import namespace="xforms" implementation="#FormsPlayer"?>
    <head>
	<!--Modelli:start-->

	<style type="text/css"> 
	
	.valid xforms\:alert {
		display: none;
	}
	.invalid xforms\:alert {
		display: block; 
		font-weight: bold;
		color: blue;
	}
	</style>
	
<xforms:model id="mdl_menu" functions="fp:serialise">
    <xforms:instance id="inst_menu" xmlns="">
        <Operation>
            <Command/>
            <Command1/>
            <Command2/>
        </Operation>
    </xforms:instance>

    <xforms:instance id="checkvalues" xmlns="">
    	<Values>
	  <Value>1</Value>
	  <Value>2</Value>
	  <Value>3</Value>
    	</Values>
    </xforms:instance>

    <xforms:bind id="bindvalue" type="xsd:integer" nodeset="instance('checkvalues')/Value" />
    <xforms:bind id="bindcommand" type="xsd:integer" nodeset="instance('inst_menu')/Command" constraint="not(. = instance('checkvalues')/Value)" />
    <xforms:bind id="bindboolean" nodeset="instance('inst_menu')/Command2" type="xsd:boolean" calculate="instance('inst_menu')/Command = instance('checkvalues')/Value" />
</xforms:model>



	<!--Modelli:end-->
        <title></title>

    </head>
    <body>
		<div class="body">
<table border="1" width="980" cellspacing="5">
<tr>
  <td valign="top">
	<!--menu:start-->

<table border="0" width="100%">
    <tr>
        <td>
        <xforms:input id="id_menu_cmd" bind="bindcommand" model="mdl_menu" >
            <xforms:label class="formLabel">Number</xforms:label>
            <xforms:alert>Type a correct number!</xforms:alert>
        </xforms:input>
        </td>
    </tr>
    <tr>
        <td>
        <xforms:input ref="instance('inst_menu')/Command1" model="mdl_menu">
            <xforms:label class="formLabel">Next field</xforms:label>
        </xforms:input>
        </td>
    </tr>
    <tr>
        <td>
        <xforms:output ref="instance('inst_menu')/Command2" model="mdl_menu" >
            <xforms:label class="formLabel">Boolean</xforms:label>
        </xforms:output>
        </td>
    </tr>
</table>


	<!--menu:end-->
  </td>
</tr>
</table>
		</div>
    </body>
</html>
------------ tested with forms player - end -----------------



____________________________________________________________
Libero ADSL: 3 mesi gratis e navighi a 1.2 Mega, senza costi di attivazione.
Abbonati subito su http://www.libero.it

Received on Thursday, 16 December 2004 10:49:49 UTC