Re: disabled controls bindset failure

In the updated version of your form (using the xpath 'or' in the 
relevant expression), the "stage of analysis" select1 should be hidden 
when the form is first loaded because the initial value of the stage 
node is neither 'ewbrl' nor 'nibrf'.  Selecting one of those items in 
the first select1 should make the second select1 appear.

In the original testcase if you added xf: to the bind element, you 
should get the xforms-binding-exception.  Because that is a fatal error, 
the form is in an unknown state once that error is reported.

This is the updated version of your form that I'm using now, which works 
fine for me on Firefox:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'
xmlns:xf='http://www.w3.org/2002/xforms'
xmlns:ev='http://www.w3.org/2001/xml-events '>
         <head>
                 <meta http-equiv='content-type' content='text/html;
charset=UTF-8' />
                 <style type='text/css' id='internalstylesheet'>
                         code {text-color:black; background:white;
font-family:verdana, sans-serif}
                 </style>
                 <xf:model>
                     <xf:message level="modal" 
ev:event="xforms-binding-exception">xforms-binding-exception 
happened</xf:message>
                         <xf:instance>
                                 <generalinformation xmlns=''>
                                         <purpose />
                                         <stage />
                                 </generalinformation>
                         </xf:instance>
<!--
                                 <xf:bind nodeset='stage'
relevant='../purpose="ewbrl"' />
                                 <xf:bind nodeset='stage'
relevant='../purpose="nibrf"' />
-->
<xf:bind nodeset='stage' relevant='../purpose="ewbrl" or 
.../purpose="nibrf"' />

                         <xf:submission
                                 resource='file:testsubmit.xml'
                                 method='put'
                                 id='gi'
                         />
                 </xf:model>
                 <title>
                 </title>
         </head>
         <body>
                 <p>
                         <xf:select1 appearance='minimal' ref='purpose'>
                                 <xf:label>purpose of analysis
                                 </xf:label>
                                 <xf:item>
                                         <xf:label>
                                                 England and Wales
Building Regulations part L
                                         </xf:label>
                                         <xf:value>ewbrl</xf:value>
                                 </xf:item>
                                 <xf:item>
                                         <xf:label>
                                                 Scottish Building 
Regulations
                                         </xf:label>
                                         <xf:value>sbr</xf:value>
                                 </xf:item>
                                 <xf:item>
                                         <xf:label>
                                                 Northern Ireland
Building Regulations part F
                                         </xf:label>
                                         <xf:value>nibrf</xf:value>
                                 </xf:item>
                         </xf:select1>
                 </p>
                 <p>
                         <xf:select1 appearance='minimal' ref='stage'>
                                 <!--should be disabled for purpose 
value sbr
                                 -->
                                 <xf:label>
                                         Stage of analysis
                                 </xf:label>
                                 <xf:item>
                                         <xf:label>
                                                 As built
                                         </xf:label>
                                         <xf:value>
                                                 asbuilt
                                         </xf:value>
                                 </xf:item>
                                 <xf:item>
                                         <xf:label>
                                                 As designed
                                         </xf:label>
                                         <xf:value>
                                                 asdesigned
                                         </xf:value>
                                 </xf:item>
                         </xf:select1>
                 </p>
                 <xf:submit submission='gi'>
                 <xf:label>
                 Save
                 </xf:label>
                 </xf:submit>
         </body>
</html>

Hope that this helps,
--Aaron

e-letter wrote:
> On 31/08/2010, Aaron Reed<aaronr@us.ibm.com>  wrote:
>> Actually, I was wrong.  We already support throwing
>> xforms-binding-exception's during xforms-rebuild in the mozilla xforms
>> processor if we determine the same MIP has been added more than once.
>> The bug was in the testcase.  The bind elements in the original form are
>> missing the 'xf' namespace prefix so we weren't processing them as
>> xforms bind elements.  The parser saw them as xhtml bind elements.
>>
> I added the prefix 'xf:' to the bind element, but now the list menu
> disappears completely. When the bind element is removed, the list menu
> appears.
>
>

Received on Tuesday, 31 August 2010 20:08:53 UTC