Re: AW: Empty Repeats

I believe the insert copies the last member of the homogeneous collection in the initial instance data (9.3.5).

This means that when the nodeset is emptied it is still possible to insert new nodes as long as
the nodeset in the initial instance data was not empty.

A way to hide the node that you use to copy from in the repeat structure could be to make a predicate on
the nodeset xpath on the repeat, for instance items/item[text()!=""] would only select the item elements that
has at least one none empty textnode below it.

/Kenneth

>>> "Roman Huditsch" <roman.huditsch@hico.com> 01/21/03 02:13pm >>>
Hello Guillermo,
 
I just had the same problems with deleting the last item and wanting to insert new ones. But as the spec says (or as I have understood it) the insert-action just makes a copy of the last item homogenous collection. So when there is no more item left to copy from, the insert action can't take place.
I hope this helps a bit.
 
wbr,
Roman 

-----Ursprüngliche Nachricht-----
Von: Guillermo Menéndez [mailto:gmcorral@terra.es] 
Gesendet: Dienstag, 21. Januar 2003 14:04
An: www-forms@w3.org 
Betreff: Empty Repeats


Hello, 
 
I was trying to find a way to make a Repeat structure that could have no initial elements, or at least that could display no elements when the form is loaded. This is because I'm using XForms to process external documents that maybe not always provide instance data for some of the Repeats. I have looked in the specification and it clearly says that initial instance data must be provided to construct the members to the homogeneous collection, but I though that maybe there is a way such as copying the repeat data from an inline instance, but I couldn't make it work. If anyone have any idea it would be very appreciated.
 
Another issue is that when deleting the last element of a Repeat structure, at least in X-smiles, it doesn't let you insert new nodes anymore, until the form is reloaded. Maybe this is only a bug of X-smiles, because the specification doesn't say anything about this.
 
Regards,
 
Guillermo

Received on Tuesday, 21 January 2003 08:33:57 UTC