W3C home > Mailing lists > Public > www-forms@w3.org > July 2007

Re: repeat: Last elements not deletable with relevant=""

From: John Boyer <boyerj@ca.ibm.com>
Date: Fri, 20 Jul 2007 08:50:29 -0700
To: "Lorenzo De Tomasi" <lorenzo.detomasi@gmail.com>
Cc: www-forms@w3.org, www-forms-request@w3.org
Message-ID: <OF998CD9A3.002C728F-ON8825731E.0050B28F-8825731E.005704AB@ca.ibm.com>
Hi Lorenzo, 

There are articles and blogs all over the place that talk about how to do 

In XForms 1.1, please see 

In XForms 1.0, please see 

I assume you want to stick to XForms 1.0.  When you start to read the 
XForms 1.0 content, you will think at first that it does not apply to your 
situation because you want to ensure that there is always at least one 
entry in the table.  So, please read to the bottom of the blog entry 
because what I first do is show you a general methodology for repeats that 
can become empty, and then it shows how to restore the existence of one 

This is more useful than the technique you are using (below) because the 
user experience is that a 'delete' button will delete a row OR will clear 
the row if it is the only one.

There are several minor variations available, including doing *exactly* 
what you describe below as well as adding an initial empty row of data so 
that the user experience of the repeat would start out non-empty (you do 
this by inserting a row during a model-construct-done IF there is only the 
one non-relevant row of data, and you implement the IF using an XPath 
predicate as is done in other places shown in the blog entry above).

John M. Boyer, Ph.D.
STSM: Lotus Forms Architect and Researcher
Chair, W3C Forms Working Group
Workplace, Portal and Collaboration Software
IBM Victoria Software Lab
E-Mail: boyerj@ca.ibm.com 

Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer

"Lorenzo De Tomasi" <lorenzo.detomasi@gmail.com> 
Sent by: www-forms-request@w3.org
07/20/2007 03:18 AM


repeat: Last elements not deletable with relevant=""

I'm trying to make an xform that works like Gmail contacts (
http://sinapsi.isotype.org/describe_person.xhtml ).
I would like to block deleting of all the items: i.e. if there is only
one section it cannot be deleted and if, in a section, there is only
one contact, it cannot be deleted (as in Gmail) .
I know that the solution is to disable the delete triggers using

Aaron Reed, a member of Mozilla xforms mailing list, has sent me this
example: http://sinapsi.isotype.org/xforms/relevant.xhtml

Junk doesn't store anything in this case.  It is just the instance
data node that the relevancy state is managed on.

I think it's redundant, superfluous for this simple, useful and (for
sure) very used task.
If I omit nodeset="junk", the xforms plugin hides the delete trigger,
but it doesn't display the relative field.
I would like to suggest to the xform team the necessity to make more
understandable this function and to make it easier to implement for
dummies in future versions of xforms, also by adding a specific
command for this. I think it will be better if it will be implemented
as default and if a it can be disabled in specific cases.

What do you think?

Aaron has told me that probably this issue has already been presented
to the W3C, but we were unable to find it in their archive. Where can
I find more infos?

Thank you very much

Lorenzo De Tomasi
Designer multimodale
http://www.isotype.org (in costruzione)
Received on Friday, 20 July 2007 15:53:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:37:56 UTC