Menu

Repeat issues

Robert
2018-05-03
2018-05-06
  • Robert

    Robert - 2018-05-03

    Hi all!
    Xforms and xsltforms are awesome! Thanks for the work on it.
    I had a problem using them while creating an application which helps in analyzing the email traffic of employees.

    The desired behaviour of the attached form would be:
    If I select an employee, only his/her emails are shown.

    Bug #1
    If I select "employee B" (has 3 emails), after this I select "employee A" (has 2 email summaries), the last email of "employee B" remains in the repeat erroneously.

    Bug #2
    If I click in the rows of the repeat, the first row is populated by the row I clicked on.

    I tested it on Firefox 52 and XSLTForms 1.0 (647). I am a little bit confused. Are these bugs, or I am just missing something with my code? Many thanks!
    Here is my code:

    <?xml version="1.0" encoding="iso-8859-2"?>
    <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?>
    <?xsltforms-options debug="no"?>
    <h:html xmlns:h="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/2002/xforms" 
    xmlns:ev="http://www.w3.org/2001/xml-events">
        <h:head>
            <model id="model_data">
                <instance id="iEmployees" >
                    <employees xmlns="">
                        <employee id="emp_a" nev="employee A">
                            <email date="1 May 2018" subject="1st email to Emp A"></email>
                            <email date="2 May 2018" subject="2nd email to Emp A"></email>
                        </employee>
                        <employee id="emp_b" nev="employee B">
                            <email date="1 May 2018" subject="1st email to Emp B"></email>
                            <email date="2 May 2018" subject="2nd email to Emp B"></email>
                            <email date="3 May 2018" subject="3rd email to Emp B"></email>
                        </employee>
                    </employees>            
                </instance>
                <instance id="iSession">
                    <data xmlns="">
                    <employee id=""/>
                    </data>          
                </instance>
            </model>
        </h:head>
        <h:body>
            <select1 ref="instance('iSession')/employee/@id" appearance="minimal">
                <label>Employee:</label>
                <itemset nodeset="instance('iEmployees')/employee"><label ref="@nev" /><value ref="@id" /></itemset>
            </select1>
            <h:br />
            <group ref="instance('iEmployees')/employee[@id=instance('iSession')/employee/@id]">
            <h:table>
                <h:tr>
                <h:th>date</h:th>
                <h:th>subject</h:th>
            </h:tr>
            <repeat nodeset="email[parent::employee[@id=instance('iSession')/employee/@id]]" id="repeatLevel">
            <h:tr>
                <h:td><input ref="@date"></input></h:td>
                <h:td><input ref="@subject"></input></h:td>
            </h:tr>
            </repeat></h:table>
            </group>
        </h:body>
    </h:html>
    
     
  • Alain Couthures

    Alain Couthures - 2018-05-05

    Hi Robert,

    This issue has been fixed with rev. 648.

    XSLTForms 1.1 has just been uploaded to ease download process.

    Thank you for your feedback!

    --Alain

     
    • Robert

      Robert - 2018-05-06

      Hi Alain,
      it works now. Thank you for your quick response!
      Robert

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.