jfweemaes / ubiquity-xforms

Automatically exported from code.google.com/p/ubiquity-xforms
0 stars 0 forks source link

Repeat in Repeat interpretation #522

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi there,

I found something strange. If you use an repeat element within an other 
repeat element and out of the repeats triggers for adding and deleting 
elements, you will activate all elements by pressing the outer trigger.
Here an example 

<repeat1>
  <value1>
  <value2>
  <repeat2>
    <value3>
  </repeat2>
</repeat1>

[outer repeat] [inner repeat]

after pushing the [outer repeat] button, you will see a model like this:

<repeat1>
  <value1>
  <value2>
  <repeat2>
    <value3>
    <value3>
  </repeat2>
</repeat1>
<repeat1>
  <value1>
  <value2>
  <repeat2>
    <value3>
    <value3>
  </repeat2>
</repeat1>

instead of:
<repeat1>
  <value1>
  <value2>
  <repeat2>
    <value3>
  </repeat2>
</repeat1>
<repeat1>
  <value1>
  <value2>
  <repeat2>
    <value3>
  </repeat2>
</repeat1>

(take a look for the <value3>. Value 3 should only be one time in this 
model; except, if you add some by unsing the second trigger.

System:
IE 7,8
ub0.7
WinXP

regards

Original issue reported on code.google.com by F.Schroe...@gmail.com on 8 Sep 2009 at 12:36

GoogleCodeExporter commented 8 years ago
Hello everybody!

I think I got the problem! The index('[node]') function isn't working as it 
should 
work. It returns the number of instances that exists. The function is made to 
count 
the current repeat-number. This way it's not working.

Ready for an example?
 - hope you are, here it comes!

Here is a given note:
<product id="1">
  <name/>
</product>
<product id="2">
  <name/>
</product>
<product id="3">
  <name/>
</product>

if you start repeating it, you can catch the error:
<repeat noteset="product" id="productlist">
  <output ref="//product" value="@id"/> // RIGHT output (1, 2, 3)
  <output ref="//product" value="index('productlist')"/> // WRONG output (always 3 
(3 entries))
</repeat>

We need to fix this. Does someone know, where the code for the function is?

Original comment by F.Schroe...@gmail.com on 11 Sep 2009 at 8:33