All,
I need to implement the new configurable error summary (see DMV example). However, I am unable to get it to work. Problem: ======= 1. Load initial page 2. Enter digits (non-valid input) into the 'identifier' field 3. Expect an error message to appear at the top of the page (does not happen) Additional information: ================ 1. Here is the log info after an xforms-invalid event has been fired: ...XFormsServer - XForms - dispatching event: xforms-value-changed - identifier-select╖1 - at XFormsModel.java, line 1234... ...XFormsServer - XForms - dispatching event: xforms-optional - identifier-select╖1 - at XFormsOptionalEvent.java, line 26... ...XFormsServer - XForms - dispatching event: xforms-enabled - identifier-select╖1 - at XFormsEnabledEvent.java, line 26... ...XFormsServer - XForms - dispatching event: xforms-readwrite - identifier-select╖1 - at XFormsReadwriteEvent.java, line 26... ...XFormsServer - XForms - dispatching event: xforms-invalid - identifier-select╖1 - at XFormsInvalidEvent.java, line 27 ...XFormsServer - XForms - executing action: action boolean(not(instance('errors-instance')/aspic:error[@aspic:id = event('target-id') and @aspic:indexes = event('repeat-indexes'))])) ...XFormsServer - XForms - containing document cache: throwable caught, discarding document from pool. 2. It looks like this if-statement returns false (or invalid?): <xforms:action if="not(instance('errors-instance')/aspic:error[@aspic:id = event('target-id') and @aspic:indexes = event('repeat-indexes'))])"> 3. ... as removing the if-statement now gives me the following debug output (some ns entries removed): ....XFormsServer - XForms - resulting instance: model id='xforms-element-1', instance id= 'errors-instance' <aspic:errors xmlns:aspic=" <a href="http://www.cruk.com/aspic/editor/v1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.cruk.com/aspic/editor/v1"> <aspic:error aspic:id="" aspic:indexes="" aspic:label="" aspic:alert=""/> </aspic:errors> ....XFormsServer - XForms - resulting instance: model id='xforms-element-1', instance id= 'error-template' <aspic:error aspic:id="" aspic:indexes="" aspic:label="" aspic:alert="" xmlns:aspic="<a href="http://www.cruk.com/aspic/editor/v1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.cruk.com/aspic/editor/v1"> </aspic:error> ...XFormsServer - XForms - resulting instance: model id='xforms-element-1', instance id= 'testing' <aspic:testing xmlns:aspic="<a href="http://www.cruk.com/aspic/editor/v1" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.cruk.com/aspic/editor/v1"> <aspic:errors-repat/> <aspic:target-id>identifier-select</aspic:target-id> <aspic:repeat-indexes/> <aspic:alert>Must be a string, starting with a lowercase letter</aspic:alert> <aspic:label>I am a label</aspic:label> </aspic:testing> My view: ====== <?xml version='1.0' encoding='utf-8' ?> <xhtml:html xmlns=" " xmlns:aspic="http://www.cruk.com/aspic/editor/v1 " xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:f="http://orbeon.org/oxf/xml/formatting" xmlns:xforms=" http://www.w3.org/2002/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xi=" http://orbeon.org/oxf/xml/xinclude" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform " xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xsl:version="2.0" > <xhtml:head> <xhtml:meta content="text/html; charset=UTF-8" http-equiv="Content-Type" ></xhtml:meta> <xhtml:title> Expression Editor </xhtml:title> <xforms:model> <xforms:instance id="expression" > <aspic:claim> <aspic:id>-1</aspic:id> <aspic:expression></aspic:expression> <aspic:nextTokens> <aspic:nextToken aspic:enabled="true"> <aspic:id>-1</aspic:id> <aspic:syntax>NEG</aspic:syntax> </aspic:nextToken> <aspic:nextToken aspic:enabled="true"> <aspic:id>-1</aspic:id> <aspic:syntax>IDN</aspic:syntax> </aspic:nextToken> <aspic:nextToken aspic:enabled="true"> <aspic:id>-1</aspic:id> <aspic:syntax>VAR</aspic:syntax> </aspic:nextToken> </aspic:nextTokens> <aspic:variables> <aspic:variable> <aspic:id>-1</aspic:id> <aspic:name>MyVariable</aspic:name> </aspic:variable> <aspic:variable> <aspic:id>-1</aspic:id> <aspic:name>VariableB</aspic:name> </aspic:variable> </aspic:variables> <aspic:identifiers> <aspic:identifier> <aspic:id>-1</aspic:id> <aspic:name>aLocalidentifier</aspic:name> </aspic:identifier> <aspic:identifier> <aspic:id>-1</aspic:id> <aspic:name>aCat</aspic:name> </aspic:identifier> <aspic:identifier> <aspic:id>-1</aspic:id> <aspic:name>aDog</aspic:name> </aspic:identifier> </aspic:identifiers> <aspic:selectedToken> <aspic:token></aspic:token> <aspic:identifier></aspic:identifier> <aspic:variable></aspic:variable> <aspic:number></aspic:number> </aspic:selectedToken> </aspic:claim> </xforms:instance> <xforms:instance id="errors-instance"> <aspic:errors/> </xforms:instance> <xforms:instance id="error-template"> <aspic:error aspic:id="" aspic:indexes="" aspic:label="" aspic:alert=""/> </xforms:instance> <xforms:instance id="testing"> <aspic:testing> <aspic:errors-repeat/> <aspic:target-id/> <aspic:repeat-indexes/> <aspic:alert/> <aspic:label/> </aspic:testing> </xforms:instance> <!-- Xforms bind --> <xforms:bind nodeset="instance('expression')/aspic:selectedToken"> <xforms:bind nodeset="aspic:identifier" type="xs:string" constraint="matches(., '(^$)|(^([a-z])([A-Za-z0-9_])*$)')" required="false"/> <xforms:bind nodeset="aspic:variable" type="xs:string" constraint="matches(., '(^$)|(^[A-Z]([A-Za-z0-9_])*$)')" required="false"/> <xforms:bind nodeset="aspic:number" type="xs:double" constraint=". castable as xs:double or matches(. , '^$')" required="false"/> </xforms:bind> <xforms:submission ref="instance('expression')" id="next-token" method="post" action="/expression/next" replace="instance" instance="expression"/> </xforms:model> </xhtml:head> <xhtml:body> <!-- DISPLAY THE ERROR MESSAGES --> <xforms:group> <xforms:group ref="instance('errors-instance')/error"> <table> <xforms:repeat nodeset="instance('errors-instance')/error" id="errors-repeat"> <tr> <th><xforms:output value="@aspic:label"/></th> <td> <xforms:output value="if (string-length(@aspic:indexes) > 0) then concat('(Row ', @aspic:indexes, ')') else ''"/> </td> <td><xforms:output value="@aspic:alert"/></td> </tr> </xforms:repeat> </table> </xforms:group> <!-- UPDATE ERRORS --> <xforms:action ev:event="xforms-invalid" if="normalize-space(event('alert')) != ''"> <xforms:action if="not(instance('errors-instance')/aspic:error[@aspic:id = event('target-id') and @aspic:indexes = event('repeat-indexes'))])"> <xforms:setvalue ref="instance('testing')/aspic:errors-repeat" value="index('errors-repeat')"/> <xforms:setvalue ref="instance('testing')/aspic:target-id" value="event('target-id')"/> <xforms:setvalue ref="instance('testing')/aspic:repeat-indexes" value="event('repeat-indexes')"/> <xforms:setvalue ref="instance('testing')/aspic:alert" value="event('alert')"/> <xforms:setvalue ref="instance('testing')/aspic:label" value="event('label')"/> <xforms:insert context="instance('errors-instance')" nodeset="aspic:error" origin="instance('error-template')"/> <xforms:setvalue ref="instance('errors-instance')/aspic:error[index('errors-repeat')]/@aspic:id" value="event('target-id')"/> <xforms:setvalue ref="instance('errors-instance')/aspic:error[index('errors-repeat')]/@aspic:indexes" value="event('repeat-indexes')"/> </xforms:action> <xforms:setvalue ref="instance('errors-instance')/aspic:error[@aspic:id = event('target-id') and @aspic:indexes = string-join(event('repeat-indexes'), '-')]/@aspic:alert" value="event('alert')"/> <xforms:setvalue ref="instance('errors-instance')/aspic:error[@aspic:id = event('target-id') and @aspic:indexes = string-join(event('repeat-indexes'), '-')]/@aspic:label" value="event('label')"/> </xforms:action> <xforms:action ev:event="xforms-valid" if="instance('errors-instance')/aspic:error[@aspic:id = event('target-id') and @aspic:indexes = string-join(event('repeat-indexes'), '-')]"> <xforms:delete nodeset="instance('errors-instance')/aspic:error[@aspic:id = event('target-id') and @aspic:indexes = event('repeat-indexes')]"/> </xforms:action> <div id="expression" > <h2>Expression: </h2> <xforms:output ref="instance('expression')/aspic:expression" ></xforms:output> </div> <div id="next-token" > <h2>Next Tokens:</h2> <table> <!-- HANDLE NEGATION --> <xforms:repeat id="negation-repeat" nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken[@aspic:enabled='true']/aspic:syntax[.='NEG']" > <tr> <td> <xforms:submit appearance="xxforms:link" submission="next-token" incremental="true"> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="instance('expression')/aspic:selectedToken/aspic:token">NEG</xforms:setvalue> <xforms:setvalue ref="instance('expression')/aspic:expression" value="concat(instance('expression')/aspic:expression, '~')"/> </xforms:action> <xforms:label>Negation</xforms:label> <xforms:help>negation is a way to say 'not'</xforms:help> |
Administrator
|
Henrik,
Do you have the DMV Forms error summary working locally? (Same remark as in the other email, could you please attach files to the email instead of pasting them? Thanks!) -Erik Henrik Pettersen wrote: > All, > > I need to implement the new configurable error summary (see DMV > example). However, I am unable to get it to work. > > Problem: > ======= > 1. Load initial page > 2. Enter digits (non-valid input) into the 'identifier' field > 3. Expect an error message to appear at the top of the page (does not > happen) > > > Additional information: > ================ > 1. Here is the log info after an xforms-invalid event has been fired: > > ...XFormsServer - XForms - dispatching event: xforms-value-changed - > identifier-select╖1 - at XFormsModel.java, line 1234... > ...XFormsServer - XForms - dispatching event: xforms-optional - > identifier-select╖1 - at XFormsOptionalEvent.java, line 26... > ...XFormsServer - XForms - dispatching event: xforms-enabled - > identifier-select╖1 - at XFormsEnabledEvent.java, line 26... > ...XFormsServer - XForms - dispatching event: xforms-readwrite - > identifier-select╖1 - at XFormsReadwriteEvent.java, line 26... > ...XFormsServer - XForms - dispatching event: xforms-invalid - > identifier-select╖1 - at XFormsInvalidEvent.java, line 27 > ...XFormsServer - XForms - executing action: action > boolean(not(instance('errors-instance')/aspic:error[@aspic:id = > event('target-id') and @aspic:indexes = event('repeat-indexes'))])) > ...XFormsServer - XForms - containing document cache: throwable caught, > discarding document from pool. > > 2. It looks like this if-statement returns false (or invalid?): > > <xforms:action > if="not(instance('errors-instance')/aspic:error[@aspic:id = > event('target-id') and @aspic:indexes = event('repeat-indexes'))])"> > > 3. ... as removing the if-statement now gives me the following debug > output (some ns entries removed): > > ....XFormsServer - XForms - resulting instance: model > id='xforms-element-1', instance id= 'errors-instance' > <aspic:errors xmlns:aspic=" http://www.cruk.com/aspic/editor/v1"> > <aspic:error aspic:id="" aspic:indexes="" aspic:label="" > aspic:alert=""/> > </aspic:errors> > > ....XFormsServer - XForms - resulting instance: model > id='xforms-element-1', instance id= 'error-template' > <aspic:error aspic:id="" aspic:indexes="" aspic:label="" > aspic:alert="" > xmlns:aspic="http://www.cruk.com/aspic/editor/v1"> > </aspic:error> > > ...XFormsServer - XForms - resulting instance: model > id='xforms-element-1', instance id= 'testing' > <aspic:testing xmlns:aspic="http://www.cruk.com/aspic/editor/v1"> > <aspic:errors-repat/> > <aspic:target-id>identifier-select</aspic:target-id> > <aspic:repeat-indexes/> > <aspic:alert>Must be a string, starting with a lowercase > letter</aspic:alert> > <aspic:label>I am a label</aspic:label> > </aspic:testing> > > My view: > ====== > <?xml version='1.0' encoding='utf-8' ?> > <xhtml:html xmlns=" " xmlns:aspic="http://www.cruk.com/aspic/editor/v1 > <http://www.cruk.com/aspic/editor/v1>" > xmlns:ev="http://www.w3.org/2001/xml-events" > xmlns:f="http://orbeon.org/oxf/xml/formatting" xmlns:xforms=" > http://www.w3.org/2002/xforms" > xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xi=" > http://orbeon.org/oxf/xml/xinclude" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform > <http://www.w3.org/1999/XSL/Transform>" > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xsl:version="2.0" > > <xhtml:head> > <xhtml:meta content="text/html; charset=UTF-8" > http-equiv="Content-Type" ></xhtml:meta> > <xhtml:title> Expression Editor </xhtml:title> > <xforms:model> > <xforms:instance id="expression" > > <aspic:claim> > <aspic:id>-1</aspic:id> > <aspic:expression></aspic:expression> > <aspic:nextTokens> > <aspic:nextToken aspic:enabled="true"> > <aspic:id>-1</aspic:id> > <aspic:syntax>NEG</aspic:syntax> > </aspic:nextToken> > <aspic:nextToken aspic:enabled="true"> > <aspic:id>-1</aspic:id> > <aspic:syntax>IDN</aspic:syntax> > </aspic:nextToken> > <aspic:nextToken aspic:enabled="true"> > <aspic:id>-1</aspic:id> > <aspic:syntax>VAR</aspic:syntax> > </aspic:nextToken> > </aspic:nextTokens> > <aspic:variables> > <aspic:variable> > <aspic:id>-1</aspic:id> > <aspic:name>MyVariable</aspic:name> > </aspic:variable> > <aspic:variable> > <aspic:id>-1</aspic:id> > <aspic:name>VariableB</aspic:name> > </aspic:variable> > </aspic:variables> > <aspic:identifiers> > <aspic:identifier> > <aspic:id>-1</aspic:id> > <aspic:name>aLocalidentifier</aspic:name> > </aspic:identifier> > <aspic:identifier> > <aspic:id>-1</aspic:id> > <aspic:name>aCat</aspic:name> > </aspic:identifier> > <aspic:identifier> > <aspic:id>-1</aspic:id> > <aspic:name>aDog</aspic:name> > </aspic:identifier> > </aspic:identifiers> > <aspic:selectedToken> > <aspic:token></aspic:token> > <aspic:identifier></aspic:identifier> > <aspic:variable></aspic:variable> > <aspic:number></aspic:number> > </aspic:selectedToken> > </aspic:claim> > </xforms:instance> > > <xforms:instance id="errors-instance"> > <aspic:errors/> > </xforms:instance> > > <xforms:instance id="error-template"> > <aspic:error aspic:id="" aspic:indexes="" aspic:label="" > aspic:alert=""/> > </xforms:instance> > > <xforms:instance id="testing"> > <aspic:testing> > <aspic:errors-repeat/> > <aspic:target-id/> > <aspic:repeat-indexes/> > <aspic:alert/> > <aspic:label/> > </aspic:testing> > </xforms:instance> > > <!-- Xforms bind --> > <xforms:bind nodeset="instance('expression')/aspic:selectedToken"> > <xforms:bind nodeset="aspic:identifier" type="xs:string" > constraint="matches(., '(^$)|(^([a-z])([A-Za-z0-9_])*$)')" > required="false"/> > <xforms:bind nodeset="aspic:variable" type="xs:string" > constraint="matches(., '(^$)|(^[A-Z]([A-Za-z0-9_])*$)')" > required="false"/> > <xforms:bind nodeset="aspic:number" type="xs:double" > constraint=". castable as xs:double or matches(. , '^$')" > required="false"/> > </xforms:bind> > > > <xforms:submission ref="instance('expression')" > id="next-token" > method="post" > action="/expression/next" > replace="instance" > instance="expression"/> > > > </xforms:model> > </xhtml:head> > > <xhtml:body> > > <!-- DISPLAY THE ERROR MESSAGES --> > <xforms:group> > <xforms:group ref="instance('errors-instance')/error"> > <table> > <xforms:repeat > nodeset="instance('errors-instance')/error" id="errors-repeat"> > <tr> > <th><xforms:output value="@aspic:label"/></th> > <td> > <xforms:output value="if > (string-length(@aspic:indexes) > 0) then concat('(Row ', @aspic:indexes, > ')') else ''"/> > </td> > <td><xforms:output value="@aspic:alert"/></td> > </tr> > </xforms:repeat> > </table> > </xforms:group> > > <!-- UPDATE ERRORS --> > > <xforms:action ev:event="xforms-invalid" > if="normalize-space(event('alert')) != ''"> > <xforms:action > if="not(instance('errors-instance')/aspic:error[@aspic:id = > event('target-id') and @aspic:indexes = event('repeat-indexes'))])"> > > <xforms:setvalue > ref="instance('testing')/aspic:errors-repeat" > value="index('errors-repeat')"/> > <xforms:setvalue > ref="instance('testing')/aspic:target-id" value="event('target-id')"/> > <xforms:setvalue > ref="instance('testing')/aspic:repeat-indexes" > value="event('repeat-indexes')"/> > <xforms:setvalue > ref="instance('testing')/aspic:alert" value="event('alert')"/> > > <xforms:setvalue > ref="instance('testing')/aspic:label" value="event('label')"/> > > > <xforms:insert context="instance('errors-instance')" > nodeset="aspic:error" origin="instance('error-template')"/> > <xforms:setvalue > ref="instance('errors-instance')/aspic:error[index('errors-repeat')]/@aspic:id" > value="event('target-id')"/> > <xforms:setvalue > ref="instance('errors-instance')/aspic:error[index('errors-repeat')]/@aspic:indexes" > value="event('repeat-indexes')"/> > > </xforms:action> > <xforms:setvalue > ref="instance('errors-instance')/aspic:error[@aspic:id = > event('target-id') and @aspic:indexes = > string-join(event('repeat-indexes'), '-')]/@aspic:alert" > value="event('alert')"/> > <xforms:setvalue > ref="instance('errors-instance')/aspic:error[@aspic:id = > event('target-id') and @aspic:indexes = > string-join(event('repeat-indexes'), '-')]/@aspic:label" > value="event('label')"/> > </xforms:action> > > <xforms:action ev:event="xforms-valid" > if="instance('errors-instance')/aspic:error[@aspic:id = > event('target-id') and @aspic:indexes = > string-join(event('repeat-indexes'), '-')]"> > <xforms:delete > nodeset="instance('errors-instance')/aspic:error[@aspic:id = > event('target-id') and @aspic:indexes = event('repeat-indexes')]"/> > </xforms:action> > > > > <div id="expression" > > <h2>Expression: </h2> > <xforms:output > ref="instance('expression')/aspic:expression" ></xforms:output> > </div> > <div id="next-token" > > <h2>Next Tokens:</h2> > <table> > <!-- HANDLE NEGATION --> > <xforms:repeat id="negation-repeat" > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken[@aspic:enabled='true']/aspic:syntax[.='NEG']" > > > <tr> > <td> > <xforms:submit appearance="xxforms:link" > submission="next-token" incremental="true"> > <xforms:action ev:event="DOMActivate"> > <xforms:setvalue > ref="instance('expression')/aspic:selectedToken/aspic:token">NEG</xforms:setvalue> > <xforms:setvalue > ref="instance('expression')/aspic:expression" > value="concat(instance('expression')/aspic:expression, '~')"/> > > </xforms:action> > > <xforms:label>Negation</xforms:label> > <xforms:help>negation is a way to > say 'not'</xforms:help> > <xforms:send submission="next-token" > ev:event="negation-added-event"/> > </xforms:submit> > > </td> > </tr> > <tr> > <td> > <p></p> > </td> > </tr> > </xforms:repeat> > > <!-- HANDLE IDENTIFIER --> > <xforms:repeat id="identifier-repeat" > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken[@aspic:enabled='true']/aspic:syntax[.='IDN']" > > > <tr> > <td> > <xforms:submit > appearance="xxforms:link" submission="next-token" > > <xforms:label>Insert identifier > ... </xforms:label> > <xforms:send > ev:event="identifier-added-event" submission="next-token" ></xforms:send> > <xforms:action > ev:event="DOMActivate"> > <xforms:setvalue > ref="instance('expression')/aspic:selectedToken/aspic:token">IDN</xforms:setvalue> > </xforms:action> > > </xforms:submit> > > <xforms:select1 > ref="instance('expression')/aspic:selectedToken/aspic:identifier" > selection="open" > id="identifier-select" > incremental="true" > > appearance="xxforms:autocomplete" > xxforms:filter="true"> > <xforms:help>Please enter a name > for you identifier. Note that the name must start with a lowercase > letter</xforms:help> > <xforms:alert>Must be a string, > starting with a lowercase letter</xforms:alert> > <xforms:label>I am a > label</xforms:label> > <xforms:itemset > nodeset="instance('expression')/aspic:identifiers/aspic:identifier"> > <xforms:label > ref="aspic:name"/> > <xforms:value ref="aspic:name"/> > </xforms:itemset> > > </xforms:select1> > > </td> > </tr> > <tr> > <td> > <p></p> > </td> > </tr> > </xforms:repeat> > <!-- HANDLE VARIABLE --> > <xforms:group> > <xforms:repeat id="variable-repeat" > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken[@aspic:enabled='true']/aspic:syntax[.='VAR']" > > > <tr> > <td> > <xforms:submit > appearance="xxforms:link" submission="next-token" > > <xforms:label>Insert variable > ... </xforms:label> > <xforms:send > ev:event="variable-added-event" submission="next-token" ></xforms:send> > <xforms:action > ev:event="DOMActivate"> > <xforms:setvalue > ref="instance('expression')/aspic:selectedToken/aspic:token">VAR</xforms:setvalue> > > </xforms:action> > > </xforms:submit> > > <xforms:select1 > ref="instance('expression')/aspic:selectedToken/aspic:variable" > selection="open" > id="variable-select" > incremental="true" > > appearance="xxforms:autocomplete" > xxforms:filter="true"> > <xforms:help>Please enter a name > for you variable. Note that the name must start with an uppercase > letter</xforms:help> > <xforms:alert>Must be a string, > starting with an uppercase letter</xforms:alert> > <xforms:itemset > nodeset="instance('expression')/aspic:variables/aspic:variable"> > <xforms:label ref="aspic:name"/> > <xforms:value ref="aspic:name"/> > </xforms:itemset> > </xforms:select1> > > </td> > </tr> > <tr> > <td> > <p></p> > </td> > </tr> > </xforms:repeat> > </xforms:group> > > <!-- HANDLE NUMBER --> > <xforms:repeat id="number-repeat" > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken[@aspic:enabled='true']/aspic:syntax[.='NUM']" > > > <tr> > <td> > <xforms:submit appearance="xxforms:link" > submission="next-token" > > <xforms:label>Insert floating point > number ... </xforms:label> > <xforms:send > ev:event="variable-added-event" submission="next-token" ></xforms:send> > <xforms:action ev:event="DOMActivate"> > <xforms:setvalue > ref="instance('expression')/aspic:selectedToken/aspic:token">NUM</xforms:setvalue> > </xforms:action> > > </xforms:submit> > > <xforms:input > ref="instance('expression')/aspic:selectedToken/aspic:number"> > <xforms:help>Please enter a floating > point number between 0 and 1, e.g. '0.25'</xforms:help> > <xforms:send submission="next-token" > ev:event="token-added-event"/> > <xforms:alert>Must be a floating > point number between 0 and 1</xforms:alert> > </xforms:input> > </td> > </tr> > <tr> > <td/> > <td/> > </tr> > </xforms:repeat> > </table> > </div> > </xforms:group> > </xhtml:body> > </xhtml:html> > > > Did anyone get this to work? Do you have any > experiences/hints/suggestions? As usual, it would be much appreciated :-) > > Sincerely, > Henrik Pettersen > Advanced Computation Laboratory > Cancer research UK > > > > ------------------------------------------------------------------------ > > > -- > 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 > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Erik,
I am running Orbeon version 3.0.1.200608221050, and I can now confirm that I got the DMV Forms example to run alongside my project in the same container (Errors are being displayed as expected for this example). I have attached the source files for my error handling (note that these are the same source files that I sent in reply to the 'Problem with asynchrounous updates' posting, just a few minutes ago) Here is the contents of the zip: 0 22-08-06 13:02 resources/config/* 0 22-08-06 13:02 resources/context/* 0 22-08-06 13:02 resources/ops/* 2286 22-08-06 12:58 resources/page-flow.xml 13784 22-08-06 12:30 resources/expression/view/editor.xsl 1815 22-08-06 12:33 resources/test/instance/response.xml 639 22-08-06 12:22 resources/test/service/get.instance.xpl Thanks, Erik! Henrik On 8/22/06, Erik Bruchez <[hidden email]> wrote: > Henrik, > > Do you have the DMV Forms error summary working locally? (Same remark as > in the other email, could you please attach files to the email instead > of pasting them? Thanks!) > > -Erik > > Henrik Pettersen wrote: > > All, > > > > I need to implement the new configurable error summary (see DMV > > example). However, I am unable to get it to work. > > > > Problem: > > ======= > > 1. Load initial page > > 2. Enter digits (non-valid input) into the 'identifier' field > > 3. Expect an error message to appear at the top of the page (does not > > happen) > > > > > > Additional information: > > ================ > > 1. Here is the log info after an xforms-invalid event has been fired: > > > > ...XFormsServer - XForms - dispatching event: xforms-value-changed - > > identifier-select╖1 - at XFormsModel.java, line 1234... > > ...XFormsServer - XForms - dispatching event: xforms-optional - > > identifier-select╖1 - at XFormsOptionalEvent.java, line 26... > > ...XFormsServer - XForms - dispatching event: xforms-enabled - > > identifier-select╖1 - at XFormsEnabledEvent.java, line 26... > > ...XFormsServer - XForms - dispatching event: xforms-readwrite - > > identifier-select╖1 - at XFormsReadwriteEvent.java, line 26... > > ...XFormsServer - XForms - dispatching event: xforms-invalid - > > identifier-select╖1 - at XFormsInvalidEvent.java, line 27 > > ...XFormsServer - XForms - executing action: action > > boolean(not(instance('errors-instance')/aspic:error[@aspic:id = > > event('target-id') and @aspic:indexes = event('repeat-indexes'))])) > > ...XFormsServer - XForms - containing document cache: throwable caught, > > discarding document from pool. > > > > 2. It looks like this if-statement returns false (or invalid?): > > > > <xforms:action > > if="not(instance('errors-instance')/aspic:error[@aspic:id = > > event('target-id') and @aspic:indexes = event('repeat-indexes'))])"> > > > > 3. ... as removing the if-statement now gives me the following debug > > output (some ns entries removed): > > > > ....XFormsServer - XForms - resulting instance: model > > id='xforms-element-1', instance id= 'errors-instance' > > <aspic:errors xmlns:aspic=" http://www.cruk.com/aspic/editor/v1"> > > <aspic:error aspic:id="" aspic:indexes="" aspic:label="" > > aspic:alert=""/> > > </aspic:errors> > > > > ....XFormsServer - XForms - resulting instance: model > > id='xforms-element-1', instance id= 'error-template' > > <aspic:error aspic:id="" aspic:indexes="" aspic:label="" > > aspic:alert="" > > xmlns:aspic="http://www.cruk.com/aspic/editor/v1"> > > </aspic:error> > > > > ...XFormsServer - XForms - resulting instance: model > > id='xforms-element-1', instance id= 'testing' > > <aspic:testing xmlns:aspic="http://www.cruk.com/aspic/editor/v1"> > > <aspic:errors-repat/> > > <aspic:target-id>identifier-select</aspic:target-id> > > <aspic:repeat-indexes/> > > <aspic:alert>Must be a string, starting with a lowercase > > letter</aspic:alert> > > <aspic:label>I am a label</aspic:label> > > </aspic:testing> > > > > My view: > > ====== > > <?xml version='1.0' encoding='utf-8' ?> > > <xhtml:html xmlns=" " xmlns:aspic="http://www.cruk.com/aspic/editor/v1 > > <http://www.cruk.com/aspic/editor/v1>" > > xmlns:ev="http://www.w3.org/2001/xml-events" > > xmlns:f="http://orbeon.org/oxf/xml/formatting" xmlns:xforms=" > > http://www.w3.org/2002/xforms" > > xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xi=" > > http://orbeon.org/oxf/xml/xinclude" > > xmlns:xs="http://www.w3.org/2001/XMLSchema" > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform > > <http://www.w3.org/1999/XSL/Transform>" > > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xsl:version="2.0" > > > <xhtml:head> > > <xhtml:meta content="text/html; charset=UTF-8" > > http-equiv="Content-Type" ></xhtml:meta> > > <xhtml:title> Expression Editor </xhtml:title> > > <xforms:model> > > <xforms:instance id="expression" > > > <aspic:claim> > > <aspic:id>-1</aspic:id> > > <aspic:expression></aspic:expression> > > <aspic:nextTokens> > > <aspic:nextToken aspic:enabled="true"> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>NEG</aspic:syntax> > > </aspic:nextToken> > > <aspic:nextToken aspic:enabled="true"> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>IDN</aspic:syntax> > > </aspic:nextToken> > > <aspic:nextToken aspic:enabled="true"> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>VAR</aspic:syntax> > > </aspic:nextToken> > > </aspic:nextTokens> > > <aspic:variables> > > <aspic:variable> > > <aspic:id>-1</aspic:id> > > <aspic:name>MyVariable</aspic:name> > > </aspic:variable> > > <aspic:variable> > > <aspic:id>-1</aspic:id> > > <aspic:name>VariableB</aspic:name> > > </aspic:variable> > > </aspic:variables> > > <aspic:identifiers> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aLocalidentifier</aspic:name> > > </aspic:identifier> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aCat</aspic:name> > > </aspic:identifier> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aDog</aspic:name> > > </aspic:identifier> > > </aspic:identifiers> > > <aspic:selectedToken> > > <aspic:token></aspic:token> > > <aspic:identifier></aspic:identifier> > > <aspic:variable></aspic:variable> > > <aspic:number></aspic:number> > > </aspic:selectedToken> > > </aspic:claim> > > </xforms:instance> > > > > <xforms:instance id="errors-instance"> > > <aspic:errors/> > > </xforms:instance> > > > > <xforms:instance id="error-template"> > > <aspic:error aspic:id="" aspic:indexes="" aspic:label="" > > aspic:alert=""/> > > </xforms:instance> > > > > <xforms:instance id="testing"> > > <aspic:testing> > > <aspic:errors-repeat/> > > <aspic:target-id/> > > <aspic:repeat-indexes/> > > <aspic:alert/> > > <aspic:label/> > > </aspic:testing> > > </xforms:instance> > > > > <!-- Xforms bind --> > > <xforms:bind nodeset="instance('expression')/aspic:selectedToken"> > > <xforms:bind nodeset="aspic:identifier" type="xs:string" > > constraint="matches(., '(^$)|(^([a-z])([A-Za-z0-9_])*$)')" > > required="false"/> > > <xforms:bind nodeset="aspic:variable" type="xs:string" > > constraint="matches(., '(^$)|(^[A-Z]([A-Za-z0-9_])*$)')" > > required="false"/> > > <xforms:bind nodeset="aspic:number" type="xs:double" > > constraint=". castable as xs:double or matches(. , '^$')" > > required="false"/> > > </xforms:bind> > > > > > > <xforms:submission ref="instance('expression')" > > id="next-token" > > method="post" > > action="/expression/next" > > replace="instance" > > instance="expression"/> > > > > > > </xforms:model> > > </xhtml:head> > > > > <xhtml:body> > > > > <!-- DISPLAY THE ERROR MESSAGES --> > > <xforms:group> > > <xforms:group ref="instance('errors-instance')/error"> > > <table> > > <xforms:repeat > > nodeset="instance('errors-instance')/error" id="errors-repeat"> > > <tr> > > <th><xforms:output value="@aspic:label"/></th> > > <td> > > <xforms:output value="if > > (string-length(@aspic:indexes) > 0) then concat('(Row ', @aspic:indexes, > > ')') else ''"/> > > </td> > > <td><xforms:output value="@aspic:alert"/></td> > > </tr> > > </xforms:repeat> > > </table> > > </xforms:group> > > > > <!-- UPDATE ERRORS --> > > > > <xforms:action ev:event="xforms-invalid" > > if="normalize-space(event('alert')) != ''"> > > <xforms:action > > if="not(instance('errors-instance')/aspic:error[@aspic:id = > > event('target-id') and @aspic:indexes = event('repeat-indexes'))])"> > > > > <xforms:setvalue > > ref="instance('testing')/aspic:errors-repeat" > > value="index('errors-repeat')"/> > > <xforms:setvalue > > ref="instance('testing')/aspic:target-id" value="event('target-id')"/> > > <xforms:setvalue > > ref="instance('testing')/aspic:repeat-indexes" > > value="event('repeat-indexes')"/> > > <xforms:setvalue > > ref="instance('testing')/aspic:alert" value="event('alert')"/> > > > > <xforms:setvalue > > ref="instance('testing')/aspic:label" value="event('label')"/> > > > > > > <xforms:insert context="instance('errors-instance')" > > nodeset="aspic:error" origin="instance('error-template')"/> > > <xforms:setvalue > > ref="instance('errors-instance')/aspic:error[index('errors-repeat')]/@aspic:id" > > value="event('target-id')"/> > > <xforms:setvalue > > ref="instance('errors-instance')/aspic:error[index('errors-repeat')]/@aspic:indexes" > > value="event('repeat-indexes')"/> > > > > </xforms:action> > > <xforms:setvalue > > ref="instance('errors-instance')/aspic:error[@aspic:id = > > event('target-id') and @aspic:indexes = > > string-join(event('repeat-indexes'), '-')]/@aspic:alert" > > value="event('alert')"/> > > <xforms:setvalue > > ref="instance('errors-instance')/aspic:error[@aspic:id = > > event('target-id') and @aspic:indexes = > > string-join(event('repeat-indexes'), '-')]/@aspic:label" > > value="event('label')"/> > > </xforms:action> > > > > <xforms:action ev:event="xforms-valid" > > if="instance('errors-instance')/aspic:error[@aspic:id = > > event('target-id') and @aspic:indexes = > > string-join(event('repeat-indexes'), '-')]"> > > <xforms:delete > > nodeset="instance('errors-instance')/aspic:error[@aspic:id = > > event('target-id') and @aspic:indexes = event('repeat-indexes')]"/> > > </xforms:action> > > > > > > > > <div id="expression" > > > <h2>Expression: </h2> > > <xforms:output > > ref="instance('expression')/aspic:expression" ></xforms:output> > > </div> > > <div id="next-token" > > > <h2>Next Tokens:</h2> > > <table> > > <!-- HANDLE NEGATION --> > > <xforms:repeat id="negation-repeat" > > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken[@aspic:enabled='true']/aspic:syntax[.='NEG']" > > > > > <tr> > > <td> > > <xforms:submit appearance="xxforms:link" > > submission="next-token" incremental="true"> > > <xforms:action ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">NEG</xforms:setvalue> > > <xforms:setvalue > > ref="instance('expression')/aspic:expression" > > value="concat(instance('expression')/aspic:expression, '~')"/> > > > > </xforms:action> > > > > <xforms:label>Negation</xforms:label> > > <xforms:help>negation is a way to > > say 'not'</xforms:help> > > <xforms:send submission="next-token" > > ev:event="negation-added-event"/> > > </xforms:submit> > > > > </td> > > </tr> > > <tr> > > <td> > > <p></p> > > </td> > > </tr> > > </xforms:repeat> > > > > <!-- HANDLE IDENTIFIER --> > > <xforms:repeat id="identifier-repeat" > > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken[@aspic:enabled='true']/aspic:syntax[.='IDN']" > > > > > <tr> > > <td> > > <xforms:submit > > appearance="xxforms:link" submission="next-token" > > > <xforms:label>Insert identifier > > ... </xforms:label> > > <xforms:send > > ev:event="identifier-added-event" submission="next-token" ></xforms:send> > > <xforms:action > > ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">IDN</xforms:setvalue> > > </xforms:action> > > > > </xforms:submit> > > > > <xforms:select1 > > ref="instance('expression')/aspic:selectedToken/aspic:identifier" > > selection="open" > > id="identifier-select" > > incremental="true" > > > > appearance="xxforms:autocomplete" > > xxforms:filter="true"> > > <xforms:help>Please enter a name > > for you identifier. Note that the name must start with a lowercase > > letter</xforms:help> > > <xforms:alert>Must be a string, > > starting with a lowercase letter</xforms:alert> > > <xforms:label>I am a > > label</xforms:label> > > <xforms:itemset > > nodeset="instance('expression')/aspic:identifiers/aspic:identifier"> > > <xforms:label > > ref="aspic:name"/> > > <xforms:value ref="aspic:name"/> > > </xforms:itemset> > > > > </xforms:select1> > > > > </td> > > </tr> > > <tr> > > <td> > > <p></p> > > </td> > > </tr> > > </xforms:repeat> > > <!-- HANDLE VARIABLE --> > > <xforms:group> > > <xforms:repeat id="variable-repeat" > > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken[@aspic:enabled='true']/aspic:syntax[.='VAR']" > > > > > <tr> > > <td> > > <xforms:submit > > appearance="xxforms:link" submission="next-token" > > > <xforms:label>Insert variable > > ... </xforms:label> > > <xforms:send > > ev:event="variable-added-event" submission="next-token" ></xforms:send> > > <xforms:action > > ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">VAR</xforms:setvalue> > > > > </xforms:action> > > > > </xforms:submit> > > > > <xforms:select1 > > ref="instance('expression')/aspic:selectedToken/aspic:variable" > > selection="open" > > id="variable-select" > > incremental="true" > > > > appearance="xxforms:autocomplete" > > xxforms:filter="true"> > > <xforms:help>Please enter a name > > for you variable. Note that the name must start with an uppercase > > letter</xforms:help> > > <xforms:alert>Must be a string, > > starting with an uppercase letter</xforms:alert> > > <xforms:itemset > > nodeset="instance('expression')/aspic:variables/aspic:variable"> > > <xforms:label ref="aspic:name"/> > > <xforms:value ref="aspic:name"/> > > </xforms:itemset> > > </xforms:select1> > > > > </td> > > </tr> > > <tr> > > <td> > > <p></p> > > </td> > > </tr> > > </xforms:repeat> > > </xforms:group> > > > > <!-- HANDLE NUMBER --> > > <xforms:repeat id="number-repeat" > > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken[@aspic:enabled='true']/aspic:syntax[.='NUM']" > > > > > <tr> > > <td> > > <xforms:submit appearance="xxforms:link" > > submission="next-token" > > > <xforms:label>Insert floating point > > number ... </xforms:label> > > <xforms:send > > ev:event="variable-added-event" submission="next-token" ></xforms:send> > > <xforms:action ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">NUM</xforms:setvalue> > > </xforms:action> > > > > </xforms:submit> > > > > <xforms:input > > ref="instance('expression')/aspic:selectedToken/aspic:number"> > > <xforms:help>Please enter a floating > > point number between 0 and 1, e.g. '0.25'</xforms:help> > > <xforms:send submission="next-token" > > ev:event="token-added-event"/> > > <xforms:alert>Must be a floating > > point number between 0 and 1</xforms:alert> > > </xforms:input> > > </td> > > </tr> > > <tr> > > <td/> > > <td/> > > </tr> > > </xforms:repeat> > > </table> > > </div> > > </xforms:group> > > </xhtml:body> > > </xhtml:html> > > > > > > Did anyone get this to work? Do you have any > > experiences/hints/suggestions? As usual, it would be much appreciated :-) > > > > Sincerely, > > Henrik Pettersen > > Advanced Computation Laboratory > > Cancer research UK > > > > > > > > ------------------------------------------------------------------------ > > > > > > -- > > 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 > > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > -- > Orbeon - XForms Everywhere: > http://www.orbeon.com/blog/ > > > > > -- > 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 > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws > > > -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |