[Xsltforms-support] problem w/ switch in select1
Brought to you by:
alain-couthures
From: Sandra B. <sb...@lo...> - 2010-02-18 20:01:05
|
Hello all, I have a form that works fine until I add a switch in a select1. I want to show a different entry section depending on what a user chooses in a drop-down list. I thought it might be the blank initial value but when I removed that I still got an error so I'm not sure what to do. Any advice would be greatly appreciated. Thanks, Sandy I'm using rev. 352 with Exist. I get the following error message: XSLTForms Exception -------------------------- Error initializing : (null, "xforms-select")@http://localhost:8080/exist/xforms/xsltforms/xsltforms.js:5989 init()@http://localhost:8080/exist/xforms/mods_editor2.xhtml:425 onload([object Event])@http://localhost:8080/exist/xforms/mods_editor2.html:1@:0 TypeError target has no properties The offending section of code seems to be: <!--Creator Info--> <h2>Creator Info</h2> <xf:repeat nodeset="instance('mods-data')/name" id="mods-repeat"> <group class="table"> <!--Type of name--> <div class="table-row"> <xf:label class="label-cell">Type of Name: </xf:label> <div class="input-cell"> <xf:select1 ref="@type" selection="closed"> <xf:item> <xf:label></xf:label> <xf:value>1</xf:value> </xf:item> <xf:item> <xf:label>personal</xf:label> <xf:value>personal</xf:value> </xf:item> <xf:item> <xf:label>corporate</xf:label> <xf:value>corporate</xf:value> </xf:item> <xf:item> <xf:label>conference</xf:label> <xf:value>conference</xf:value> </xf:item> <xf:toggle ev:event="xforms-value-changed"> <xf:case value="concat('case', .)"/> </xf:toggle> </xf:select1> </div> </div> <xf:switch> <xf:case id="case1"> </xf:case> <xf:case id="casepersonal"> <!--Role (creator, scribe, etc.)--> <div class="table-row"> <xf:label class="label-cell">Role: </xf:label> <div class="input-cell"> <xf:select1 ref="role/roleTerm" selection="closed"> <xf:item> <xf:label/> <xf:value/> </xf:item> <xf:item> <xf:label>Architect</xf:label> <xf:value>Architect</xf:value> </xf:item> <xf:item> <xf:label>Artist</xf:label> <xf:value>Artist</xf:value> </xf:item> <xf:item> <xf:label>Author</xf:label> <xf:value>Author</xf:value> </xf:item> <xf:item> <xf:label>Calligrapher</xf:label> <xf:value>Calligrapher</xf:value> </xf:item> <xf:item> <xf:label>Cartographer</xf:label> <xf:value>Cartographer</xf:value> </xf:item> <xf:item> <xf:label>Contributor</xf:label> <xf:value>Contributor</xf:value> </xf:item> <xf:item> <xf:label>Creator</xf:label> <xf:value>Creator</xf:value> </xf:item> <xf:item> <xf:label>Editor</xf:label> <xf:value>Editor</xf:value> </xf:item> <xf:item> <xf:label>Illustrator</xf:label> <xf:value>Illustrator</xf:value> </xf:item> <xf:item> <xf:label>Musician</xf:label> <xf:value>Musician</xf:value> </xf:item> <xf:item> <xf:label>Narrator</xf:label> <xf:value>Narrator</xf:value> </xf:item> <xf:item> <xf:label>Photographer</xf:label> <xf:value>Photographer</xf:value> </xf:item> <xf:item> <xf:label>Printer</xf:label> <xf:value>Publisher</xf:value> </xf:item> <xf:item> <xf:label>Scribe</xf:label> <xf:value>Scribe</xf:value> </xf:item> <xf:item> <xf:label>Transcriber</xf:label> <xf:value>Transcriber</xf:value> </xf:item> </xf:select1> </div> </div> <!--Last name--> <div class="table-row"> <xf:label class="label-cell">Family Name: </xf:label> <div class="input-cell"> <xf:input ref="namePart[@type='family']" incremental="true"/> </div> </div> <!--First name--> <div class="table-row"> <xf:label class="label-cell">Given Name: </xf:label> <div class="input-cell"> <xf:input ref="namePart[@type='given']" incremental="true"/> </div> </div> <!--Title--> <div class="table-row"> <xf:label class="label-cell">Title (such as Sir): </xf:label> <div class="input-cell"> <xf:input ref="namePart[@type='termsOfAddress']" incremental="true"/> </div> </div> <!--Birth-Death Dates--> <div class="table-row"> <xf:label class="label-cell">Birth/Death Dates: </xf:label> <div class="input-cell"> <xf:input ref="namePart[@type='date']" incremental="true"/> </div> </div> </xf:case> <xf:case id="casecorporate"> <!-- Corporate --> <div class="table-row"> <xf:label class="label-cell">Corporate Name: </xf:label> <div class="input-cell"> <xf:input ref="namePart[@type='']" incremental="true"/> </div> </div> </xf:case> <xf:case id="caseconference"> <!-- Corporate --> <div class="table-row"> <xf:label class="label-cell">Conference Name: </xf:label> <div class="input-cell"> <xf:input ref="namePart[@type='']" incremental="true"/> </div> </div> </xf:case> </xf:switch> </group> <br/> </xf:repeat> |