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


Hi,

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
development.

wbr,
Roman

-----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
itemset?

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>
nodeset="/tm:topicMap/tm:topic/tm:baseName/tm:baseNameString[string-length()
!=0]">
    Roman> <xforms:label ref="." /> <xforms:value ref="../../@id" />
    Roman> </xforms:itemset> </xforms:select1>

    Roman> wbr, Roman

--
Best Regards,
--raman
------------------------------------------------------------
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 Wednesday, 18 December 2002 10:05:23 UTC