W3C home > Mailing lists > Public > www-forms@w3.org > December 2002

WG: retaining previous settings in a select1

From: Roman Huditsch <roman.huditsch@hico.com>
Date: Fri, 20 Dec 2002 09:11:58 +0100
Message-ID: <0C79A363CB0321418927D0CB1AD0403C29A6F5@hicoetsrv000006.hico.local>
To: <www-forms@w3.org>


I tried it with setvalue actions too, but unfortunately that didn't solve my problem. The values are all stored correctly. The only thing to change is that the UI controls do not show the right (selected) labels. When I insert a new structure new UI controls appear empty. So far so good. But unfortunately already selected labels in the "old" UI controls disapeear. This only happens with my select1. Input values are shown correctly. So either I have some mistake in my code or there is a porblem with X-Smiles showing the correct selected labels in my "old" select1-UI.


-----Ursprüngliche Nachricht-----
Von: Sebastian Schnitzenbaumer [mailto:schnitz@webaccess.mozquito.com]
Gesendet: Mittwoch, 18. Dezember 2002 16:04
An: Roman Huditsch; tvraman@almaden.ibm.com
Cc: www-forms@w3.org
Betreff: Re: retaining previous settings in a select1

Roman, all,

quoting what I believe is your main question:
Roman> What I would like
Roman> to have is that all my previous settings are retained when
Roman> new form fields are inserted.

yes, yes, yes, good question. The solution in XForms 1.0 for this is to
fire an array of setvalues when the insert occurs.

The semantics of repeat / insert will copy the structure of the
repeat's highlighted selected nodeset, but not the content. When
you want to apply default values for the inserted nodeset, you
listen to the event (e.g. click on the trigger defining insert as an
action) and add setvalue actions (using the <action> container),
that copy them from anywhere in that model (perhaps in a
different instance -> default) to the inserted nodeset.

Implementation-wise, I've tried this in X-Smiles, and it works,
with the exception that it seems that probably X-Smiles cannot
reference the inserted nodeset via setvalue not just yet immediately
after the insert action occurs when defined together on one trigger -
when doing the setvalue with a second trigger manually after doing
the insert it works fine.

- Sebastian

----- Original Message -----
From: "Roman Huditsch" <roman.huditsch@hico.com>
To: <tvraman@almaden.ibm.com>
Cc: <www-forms@w3.org>
Sent: Monday, December 16, 2002 6:58 PM
Subject: AW: retaining previous settings in a select1


yes, of course you are right. I hesitated to submit the entire code, because
it is quite a lot for a small eMail ;). But you can sure have it. Attached
is my code and I would be really proud if you use it for your examples area.
But please consider that the code is (unfortunately) still buggy and under


-----Ursprüngliche Nachricht-----
Von: T. V. Raman [mailto:tvraman@us.ibm.com]
Gesendet: Montag, 16. Dezember 2002 16:30
An: Roman Huditsch
Cc: www-forms@w3.org
Betreff: retaining previous settings in a select1

I'm confused, I dont see a repeat in your example, did you mean the

Incidentally, would you be willing to contribute complete working
examples to the XForms WG for our Examples area?
We'll give you full credit, acknowledge your contribution  --for which
you'll probably be rewarded with even more spam than you already get
:-)>>>>> "Roman" == Roman Huditsch <roman.huditsch@hico.com> writes:

    Roman> Hello all,

    Roman> Over the weekend I tried to work again on my XForms-based
    Roman> editor and doing this I came up with some more questions.
    Roman> I have a select1 within a repeat element where I can choose
    Roman> a name from names already contained within my instance
    Roman> data.  So far so good.  There is also a button for
    Roman> inserting new elements to my instance data. And there is
    Roman> the problem.  When I had a name selected within the select1
    Roman> and clicked the insert-button, new form fields appear as
    Roman> desired, but my previous name-selection doesn't show the
    Roman> right (selected) name any more.  The intersting thing is
    Roman> that when I submit the instance data, the values are set
    Roman> correctly. So I assume that there is either some kind of
    Roman> rendering bug or some error in my code.  What I would like
    Roman> to have is that all my previous settings are retained when
    Roman> new form fields are inserted.  Can you help me with this
    Roman> problem, please?

    Roman> <xforms:select1 ref="tm:instanceOf/tm:topicRef/@xlink:href"
    Roman> class="topicInstanceOf"> <xforms:choices> <xforms:item>
    Roman> <xforms:label>nein</xforms:label> <xforms:value />
    Roman> </xforms:item> </xforms:choices> <xforms:itemset
    Roman> <xforms:label ref="." /> <xforms:value ref="../../@id" />
    Roman> </xforms:itemset> </xforms:select1>

    Roman> wbr, Roman

Best Regards,
T. V. Raman:  PhD (Cornell University)
IBM Research: Human Language Technologies
Architect:    Conversational And Multimodal WWW Standards
Phone:        1 (408) 927 2608   T-Line 457-2608
Fax:        1 (408) 927 3012     Cell: 1 650 799 5724
Email:        tvraman@us.ibm.com
WWW:      http://www.cs.cornell.edu/home/raman
AIM:      TVRaman
PGP:          http://emacspeak.sf.net/raman.asc
Snail:        IBM Almaden Research Center,
              650 Harry Road
              San Jose 95120
Received on Friday, 20 December 2002 03:12:41 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:07 UTC