Re: [Xsltforms-support] Table-row and nested xf:repeat in beta3
Brought to you by:
alain-couthures
From: <st...@sa...> - 2011-03-31 14:49:13
|
Yes, that looks really good--thanks very much for your response! Best wishes, Steve Quoting COUTHURES Alain <ala...@ag...>: > Steve, > > XSLTForms still has problems with repeats within tables when there > are some extra lines at the beginning or at the end. > > Using THEAD, TBODY and TFOOT should better work but, for your > examples, I prefered using XPath predicates for having just a repeat > element: > > xsltforms-repeat-sans-table.xml: > > <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?> > <html xmlns="http://www.w3.org/1999/xhtml" > xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:ev="http://www.w3.org/2001/xml-events"> > <head> > <title>OASE Form</title> > <link rel="stylesheet" type="text/css" href="/css/oase.css"/> > <script type="text/javascript" src="/js/oase.js"> > </script> > <xforms:model> > <xforms:instance id="search"> > <xse xmlns=""> > <project>sans-table</project> > <search> > <index>txt</index> > <binop> > <key/> > <filter type="position" value="any"/> > </binop> > </search> > <result count="0" list="oase"> > <url>javascript:oasePager('etcsri','oase')</url> > </result> > </xse> > </xforms:instance> > <xforms:instance id="new-search"> > <search xmlns="" type="include"> > <index></index> > <binop> > <key/> > <filter type="position" value="any"/> > </binop> > </search> > </xforms:instance> > <xforms:instance id="new-binop"> > <binop xmlns="" invert="no" type="and"> > <key/> > <filter type="position" value="any"/> > </binop> > </xforms:instance> > <xforms:submission action="xxx" method="post" id="go" > mediatype="application/xml" replace="instance"> > <xforms:action ev:event="xforms-submit-done"> > <xforms:load> > <xforms:resource > value="instance('search')/result"/> > </xforms:load> > </xforms:action> > </xforms:submission> > </xforms:model> > </head> > <body> > <h1> > <xforms:output value="project"/> Search: > <xforms:output value="result/@count"/> results so far > </h1> > <xforms:repeat nodeset="search" id="search-repeat"> > <fieldset> > <legend> > <xforms:group ref=".[count(preceding-sibling::search)=0]"> > Search index > </xforms:group> > <xforms:group ref=".[count(preceding-sibling::search)>0]"> > <xforms:select1 ref="@type"> > <xforms:item> > <xforms:label>include</xforms:label> > <xforms:value>and</xforms:value> > </xforms:item> > </xforms:select1> > results of searching > </xforms:group> > <xforms:select1 ref="index"> > <xforms:item> > <xforms:label>transliterations</xforms:label> > <xforms:value>txt</xforms:value> > </xforms:item> > </xforms:select1> > </legend> > > <xforms:group ref=".[index[.='txt']]"> > <xforms:repeat nodeset="binop" id="binop-repeat"> > <xforms:output value="if(.[not(preceding-sibling::binop)]/key,'For ','')"/> > <xforms:select1 ref=".[preceding-sibling::binop]/@type"> > <xforms:item> > <xforms:label>and</xforms:label> > <xforms:value>and</xforms:value> > </xforms:item> > </xforms:select1> > <xforms:input ref="key"/> > <xforms:select1 ref="filter[@type='position']/@value"> > <xforms:item> > <xforms:label>Any position</xforms:label> > <xforms:value>any</xforms:value> > </xforms:item> > </xforms:select1> > </xforms:repeat> > </xforms:group> > > <xforms:trigger> > <xforms:label>Add another search term</xforms:label> > <xforms:insert ev:event="DOMActivate" > context="." > nodeset="search/binop[last()]" > position="after" > origin="instance('new-binop')"/> > </xforms:trigger> > > </fieldset> > </xforms:repeat> > > <xforms:trigger> > <xforms:label>Add a search</xforms:label> > <xforms:insert ev:event="DOMActivate" > context="." nodeset="search" > origin="instance('new-search')"/> > </xforms:trigger> > <hr/> > <xforms:submit submission="go"> > <xforms:label>GO</xforms:label> > </xforms:submit> > </body> > </html> > > xsltforms-repeat-with-table.xml: > > <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?> > <html xmlns="http://www.w3.org/1999/xhtml" > xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:ev="http://www.w3.org/2001/xml-events"> > <head> > <title>OASE Form</title> > <link rel="stylesheet" type="text/css" href="/css/oase.css"/> > <script type="text/javascript" src="/js/oase.js"> > </script> > <xforms:model> > <xforms:instance id="search"> > <xse xmlns=""> > <project>with-table</project> > <search> > <index>txt</index> > <binop> > <key/> > <filter type="position" value="any"/> > </binop> > </search> > <result count="0" list="oase"> > <url>javascript:oasePager('etcsri','oase')</url> > </result> > </xse> > </xforms:instance> > <xforms:instance id="new-search"> > <search type="include"> > <index></index> > <binop> > <key/> > <filter type="position" value="any"/> > </binop> > </search> > </xforms:instance> > <xforms:instance id="new-binop"> > <binop invert="no" type="and"> > <key/> > <filter type="position" value="any"/> > </binop> > </xforms:instance> > <xforms:submission action="xxx" method="post" id="go" > mediatype="application/xml" replace="instance"> > <xforms:action ev:event="xforms-submit-done"> > <xforms:load> > <xforms:resource > value="instance('search')/result"/> > </xforms:load> > </xforms:action> > </xforms:submission> > </xforms:model> > </head> > <body> > <h1> > <xforms:output value="project"/> Search: > <xforms:output value="result/@count"/> results so far > </h1> > <xforms:repeat nodeset="search" id="search-repeat"> > <fieldset> > <legend> > <xforms:group ref=".[count(preceding-sibling::search)=0]"> > Search index > </xforms:group> > <xforms:group ref=".[count(preceding-sibling::search)>0]"> > <xforms:select1 ref="@type"> > <xforms:item> > <xforms:label>include</xforms:label> > <xforms:value>and</xforms:value> > </xforms:item> > </xforms:select1> > results of searching > </xforms:group> > <xforms:select1 ref="index"> > <xforms:item> > <xforms:label>transliterations</xforms:label> > <xforms:value>txt</xforms:value> > </xforms:item> > </xforms:select1> > </legend> > > <xforms:group ref=".[index[.='txt']]"> > <table> > <tbody> > <xforms:repeat nodeset="binop" id="binop-repeat"> > <tr> > <td> > <xforms:output value="if(.[not(preceding-sibling::binop)]/key,'For ','')"/> > <xforms:select1 ref=".[preceding-sibling::binop]/@type"> > <xforms:item> > <xforms:label>and</xforms:label> > <xforms:value>and</xforms:value> > </xforms:item> > </xforms:select1> > <xforms:input ref="key"/> > </td> > <td> > <xforms:select1 ref="filter[@type='position']/@value"> > <xforms:item> > <xforms:label>Any position</xforms:label> > <xforms:value>any</xforms:value> > </xforms:item> > </xforms:select1> > </td> > </tr> > </xforms:repeat> > </tbody> > </table> > </xforms:group> > > <xforms:trigger> > <xforms:label>Add another search term</xforms:label> > <xforms:insert ev:event="DOMActivate" > context="." > nodeset="search/binop[last()]" > position="after" > origin="instance('new-binop')"/> > </xforms:trigger> > > </fieldset> > </xforms:repeat> > > <xforms:trigger> > <xforms:label>Add a search</xforms:label> > <xforms:insert ev:event="DOMActivate" > context="." nodeset="search" > origin="instance('new-search')"/> > </xforms:trigger> > <hr/> > <xforms:submit submission="go"> > <xforms:label>GO</xforms:label> > </xforms:submit> > </body> > </html> > > > As you can see I also added missing empty namespace declarations. > > Does it work for you now? > > Thanks! > > -Alain > > Le 27/03/2011 20:24, st...@sa... a écrit : >> I am new to XForms, so I am hesitant to cry 'bug!' right away, but I >> think there is an issue with nesting repeats and table rows. I've >> cut my source down to make it easier to see the structure and posted >> it at: >> >> http://oracc.museum.upenn.edu/xsltforms-repeat-sans-table.xml >> >> and >> >> http://oracc.museum.upenn.edu/xsltforms-repeat-with-table.xml >> >> In the first case, the repeat works correctly: the first binop in >> the instance is displayed (but without the label--another bug?) and >> clicking on the add-another-search-term button takes the repeat >> from the correct instance ('new-binop'). >> >> In the with-table case, the first binop is displayed (with label) >> but clicking on the add-another-search-term button repeats the >> first binop. >> >> Thanks, >> >> Steve >> >> >> >> ------------------------------------------------------------------------------ >> Enable your software for Intel(R) Active Management Technology to meet the >> growing manageability and security demands of your customers. Businesses >> are taking advantage of Intel(R) vPro (TM) technology - will your software >> be a part of the solution? Download the Intel(R) Manageability Checker >> today! http://p.sf.net/sfu/intel-dev2devmar >> _______________________________________________ >> Xsltforms-support mailing list >> Xsl...@li... >> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >> > > |