I'm trying to sequence a form by using readonly to control whether a user can answer a question or not. Sequencing is based on user responses to previous questions. The question and it's label should still be visible but greyed out. I'm using the readonly bind option, but am having problems when it is applied to an Input control. It works fine when the control is say a textbox, but results in an exception when it is applied to an Input control. The error I initially got was:
I found a previous issue which referred to this error http://www.nabble.com/Some-problems-calling-XPLs-td20659999.html So I changed the properties file as suggested. This then resulted in the following more informative error message:
Looking at xforms.js, line 1709 appears to be related to setting the readonly/disabled attribute for text fields. The following example demonstrates the issue:
The other issue is that the read-only/disabled attribute isn't applied to the label, so the question text still appears as a normal question. Opening this example in the Mozilla XForms add-in shows the question text as well as the controls grayed out when the question is read only. The version of Orbeon I'm using is: Orbeon Forms 3.7.0alpha.200808202311 I suspect this is a bug, but I couldn't find any other references to it in the forum archive. ------------------------------------------------------------------------------------------------ Free publications and statistics available on www.abs.gov.au
-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
Hi,
I notice your build dates from last August. These issues do not seem to happen with a recent build. -Erik On Jan 28, 2009, at 2:15 PM, Julie-Anne McDonald wrote: > > I'm trying to sequence a form by using readonly to control whether a > user can answer a question or not. > Sequencing is based on user responses to previous questions. > The question and it's label should still be visible but greyed out. > > I'm using the readonly bind option, but am having problems when it > is applied to an Input control. > It works fine when the control is say a textbox, but results in an > exception when it is applied to an Input control. > > The error I initially got was: > Exception in client-side code. > • Message: C has no properties > • File: http://localhost:8080/orbeon/xforms-server/xforms-yuicalendar-min.js > • Line number: 89 > > I found a previous issue which referred to this error > http://www.nabble.com/Some-problems-calling-XPLs-td20659999.html > > So I changed the properties file as suggested. > This then resulted in the following more informative error message: > Exception in client-side code. > • Message: textField has no properties > • File: http://localhost:8080/orbeon/ops/javascript/xforms.js > • Line number: 1709 > > Looking at xforms.js, line 1709 appears to be related to setting the > readonly/disabled attribute for text fields. > > The following example demonstrates the issue: > <html xmlns="http://www.w3.org/1999/xhtml" > xmlns:xf="http://www.w3.org/2002/xforms" > xmlns:sp="http://scratchpad"> > <head> > <title>Orbeon readonly bind on input issue</title> > > <style type="text/css"> > /* show read only questions in gray */ > *:read-only > { > color:gray; > } > > /* for firefox use this - mozilla doesn't support pseudo > elements */ > *:-moz-read-only > { > color:gray; > } > </style> > > <xf:model id="myModel"> > <xf:instance id="instScratchPad"> > <sp:ScratchPad> > <sp:InterimValues> > <sp:Sequence1></sp:Sequence1> > <sp:Control1></sp:Control1> > <sp:Sequence2></sp:Sequence2> > <sp:Control2></sp:Control2> > </sp:InterimValues> > </sp:ScratchPad> > </xf:instance> > > <xf:bind id="Question1-bind" > nodeset="instance('instScratchPad')/sp:InterimValues/ > sp:Control1" > readonly="not (instance('instScratchPad')/ > sp:InterimValues/sp:Sequence1[.='1'])"> > </xf:bind> > > <xf:bind id="Question2-bind" > nodeset="instance('instScratchPad')/sp:InterimValues/ > sp:Control2" > readonly="not (instance('instScratchPad')/ > sp:InterimValues/sp:Sequence2[.='1'])"> > </xf:bind> > > </xf:model> > </head> > > <body> > > <p>1b is an Input control. When you bind readonly based on 1a > it raises an exception.</p> > <xf:select1 ref="instance('instScratchPad')/sp:InterimValues/ > sp:Sequence1" appearance="full"> > <xf:label>1a Do you want to answer Question 1?</xf:label> > <xf:item> > <xf:label>No</xf:label> > <xf:value>0</xf:value> > </xf:item> > <xf:item> > <xf:label>Yes</xf:label> > <xf:value>1</xf:value> > </xf:item> > </xf:select1> > > <br/> > <xf:input ref="instance('instScratchPad')/sp:InterimValues/ > sp:Control1"> > <xf:label>1b. </xf:label> > </xf:input> > > <br/> > <br/> > <p>2b is a Textarea control. When you bind readonly based on > 2a it works as expected.</p> > <xf:select1 ref="instance('instScratchPad')/sp:InterimValues/ > sp:Sequence2" appearance="full"> > <xf:label>2a Do you want to answer Question 2?</xf:label> > <xf:item> > <xf:label>No</xf:label> > <xf:value>0</xf:value> > </xf:item> > <xf:item> > <xf:label>Yes</xf:label> > <xf:value>1</xf:value> > </xf:item> > </xf:select1> > > <br/> > <xf:textarea ref="instance('instScratchPad')/sp:InterimValues/ > sp:Control2"> > <xf:label>2b. </xf:label> > </xf:textarea> > </body> > </html> > > > The other issue is that the read-only/disabled attribute isn't > applied to the label, so the question text still appears as a normal > question. > > Opening this example in the Mozilla XForms add-in shows the question > text as well as the controls grayed out when the question is read > only. > > The version of Orbeon I'm using is: > Orbeon Forms 3.7.0alpha.200808202311 > > I suspect this is a bug, but I couldn't find any other references to > it in the forum archive. > > ------------------------------------------------------------------------------------------------ > > Free publications and statistics available on www.abs.gov.au > > > > -- > You receive this message as a subscriber of the [hidden email] > mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Hi Erik, I'll go through the process of getting the latest build - our environment is very locked down, and it takes considerable effort to get new versions of software in, so it was quicker and easier to post the question than to get the latest build to try... thanks. Erik Bruchez <[hidden email]> wrote on 29/01/2009 09:43:47 AM: > [image removed] > > [ops-users] Re: Problem with readonly bind applied to Input controls > [SEC=UNCLASSIFIED] > > Protective Mark > > Erik Bruchez > > to: > > ops-users > > 29/01/2009 09:44 AM > > Please respond to ops-users > > Hi, > > I notice your build dates from last August. These issues do not seem > to happen with a recent build. > > -Erik > > On Jan 28, 2009, at 2:15 PM, Julie-Anne McDonald wrote: > > > > > I'm trying to sequence a form by using readonly to control whether a > > user can answer a question or not. > > Sequencing is based on user responses to previous questions. > > The question and it's label should still be visible but greyed out. > > > > I'm using the readonly bind option, but am having problems when it > > is applied to an Input control. > > It works fine when the control is say a textbox, but results in an > > exception when it is applied to an Input control. > > > > The error I initially got was: > > Exception in client-side code. > > • Message: C has no properties > > • File: http://localhost:8080/orbeon/xforms-server/xforms- > yuicalendar-min.js > > • Line number: 89 > > > > I found a previous issue which referred to this error > > http://www.nabble.com/Some-problems-calling-XPLs-td20659999.html > > > > So I changed the properties file as suggested. > > This then resulted in the following more informative error message: > > Exception in client-side code. > > • Message: textField has no properties > > • File: http://localhost:8080/orbeon/ops/javascript/xforms.js > > • Line number: 1709 > > > > Looking at xforms.js, line 1709 appears to be related to setting the > > readonly/disabled attribute for text fields. > > > > The following example demonstrates the issue: > > <html xmlns="http://www.w3.org/1999/xhtml" > > xmlns:xf="http://www.w3.org/2002/xforms" > > xmlns:sp="http://scratchpad"> > > <head> > > <title>Orbeon readonly bind on input issue</title> > > > > <style type="text/css"> > > /* show read only questions in gray */ > > *:read-only > > { > > color:gray; > > } > > > > /* for firefox use this - mozilla doesn't support pseudo > > elements */ > > *:-moz-read-only > > { > > color:gray; > > } > > </style> > > > > <xf:model id="myModel"> > > <xf:instance id="instScratchPad"> > > <sp:ScratchPad> > > <sp:InterimValues> > > <sp:Sequence1></sp:Sequence1> > > <sp:Control1></sp:Control1> > > <sp:Sequence2></sp:Sequence2> > > <sp:Control2></sp:Control2> > > </sp:InterimValues> > > </sp:ScratchPad> > > </xf:instance> > > > > <xf:bind id="Question1-bind" > > nodeset="instance('instScratchPad')/sp:InterimValues/ > > sp:Control1" > > readonly="not (instance('instScratchPad')/ > > sp:InterimValues/sp:Sequence1[.='1'])"> > > </xf:bind> > > > > <xf:bind id="Question2-bind" > > nodeset="instance('instScratchPad')/sp:InterimValues/ > > sp:Control2" > > readonly="not (instance('instScratchPad')/ > > sp:InterimValues/sp:Sequence2[.='1'])"> > > </xf:bind> > > > > </xf:model> > > </head> > > > > <body> > > > > <p>1b is an Input control. When you bind readonly based on 1a > > it raises an exception.</p> > > <xf:select1 ref="instance('instScratchPad')/sp:InterimValues/ > > sp:Sequence1" appearance="full"> > > <xf:label>1a Do you want to answer Question 1?</xf:label> > > <xf:item> > > <xf:label>No</xf:label> > > <xf:value>0</xf:value> > > </xf:item> > > <xf:item> > > <xf:label>Yes</xf:label> > > <xf:value>1</xf:value> > > </xf:item> > > </xf:select1> > > > > <br/> > > <xf:input ref="instance('instScratchPad')/sp:InterimValues/ > > sp:Control1"> > > <xf:label>1b. </xf:label> > > </xf:input> > > > > <br/> > > <br/> > > <p>2b is a Textarea control. When you bind readonly based on > > 2a it works as expected.</p> > > <xf:select1 ref="instance('instScratchPad')/sp:InterimValues/ > > sp:Sequence2" appearance="full"> > > <xf:label>2a Do you want to answer Question 2?</xf:label> > > <xf:item> > > <xf:label>No</xf:label> > > <xf:value>0</xf:value> > > </xf:item> > > <xf:item> > > <xf:label>Yes</xf:label> > > <xf:value>1</xf:value> > > </xf:item> > > </xf:select1> > > > > <br/> > > <xf:textarea ref="instance('instScratchPad')/sp:InterimValues/ > > sp:Control2"> > > <xf:label>2b. </xf:label> > > </xf:textarea> > > </body> > > </html> > > > > > > The other issue is that the read-only/disabled attribute isn't > > applied to the label, so the question text still appears as a normal > > question. > > > > Opening this example in the Mozilla XForms add-in shows the question > > text as well as the controls grayed out when the question is read > > only. > > > > The version of Orbeon I'm using is: > > Orbeon Forms 3.7.0alpha.200808202311 > > > > I suspect this is a bug, but I couldn't find any other references to > > it in the forum archive. > > > > > ------------------------------------------------------------------------------------------------ > > > > Free publications and statistics available on www.abs.gov.au > > > > > > > > -- > > You receive this message as a subscriber of the [hidden email] > > mailing list. > > To unsubscribe: [hidden email] > > For general help: [hidden email] > > OW2 mailing lists service home page: http://www.ow2.org/wws > > -- > Orbeon Forms - Web Forms for the Enterprise Done the Right Way > http://www.orbeon.com/ > > > -- > You receive this message as a subscriber of the [hidden email] > mailing list. > To unsubscribe: [hidden email] > For general help: [hidden email] > OW2 mailing lists service home page: http://www.ow2.org/wws ------------------------------------------------------------------------------------------------ Free publications and statistics available on www.abs.gov.au
-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |