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

RE: xforms:copy binding query

From: John Boyer <boyerj@ca.ibm.com>
Date: Tue, 23 Oct 2007 10:31:19 -0400
To: "Robert Walpole" <robert.walpole@devon.gov.uk>
Cc: "Aaron Reed" <aaronr@us.ibm.com>, www-forms@w3.org, www-forms-request@w3.org
Message-ID: <OF585ED81A.9694BC44-ON8825737D.004E6399-8825737D.004FD2A1@ca.ibm.com>
Hi Robert,

It's not clear enough from your first message what you are actually trying 
to do. This latest post involving use of insert surely seems to be going 
in the wrong direction, though, as the point of copy is that you don't 
need generalized insertion capabilities.

I understood that you wanted two different controls to be able to 
contribute to a test data result.

OK, so that means the ref of the two controls points at the same node 
"/test/data"

But what is the itemset nodeset supposed to point at in the two different 
controls?

Are you thinking to have the two itemsets be different?

If so, I think it is only slightly problematic.  However, it should be 
possible to make it work, and in particular to do so without use of 
insert, but there will be a minor hiccup in the fact that each of the 
select controls will receive out of range error events for the subtrees 
placed in "/test/data" that do not correspond to items in the union of the 
item sets but not the complement of their intersection.

In other words, if you have an item generated by control S1 but not S2, 
and you select that item, the subtree will be copied into the node 
referenced by S1, but S2 should then receive an out of range event because 
it has no item to match that copied node.  But this is a notification 
event, which could be ignored or cancelled.

Finally, perhaps let us know what you really want to do at a higher level, 
since a solution other than having two selects with non-identical item 
sets might present itself.  But if it is exactly what you need, it should 
in principle work, modulo the out of range notifications.

Cheers,
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





"Robert Walpole" <robert.walpole@devon.gov.uk> 
Sent by: www-forms-request@w3.org
10/23/2007 04:01 AM

To
"Aaron Reed" <aaronr@us.ibm.com>, <www-forms@w3.org>
cc

Subject
RE: xforms:copy binding query






Hi Aaron,

Thanks for your reply. I understand what you are saying about the
bindings although this does seem a bit of a limitation.

I am interested in your suggestion of using the xforms-select event but
I am struggling to see how this would work.

At present I am just trying to get it to work with one select control
and I have something like the following:

<xforms:model>
                 <xforms:instance>
                                 <communitygroup>
                                                 <data/>
                         <metadata/>
            </communitygroup>
      </xforms:instance>
                 <xforms:bind id="data" nodeset="/communitygroup/data"/>
      <xforms:bind id="metadata" nodeset="/communitygroup/metadata"/>
      <xforms:instance id="accessibility-instance"
src="accessibility.xml"/>
</xforms:model>

<xforms:select bind="data">
                 <xforms:label>Metadata</xforms:label>
                 <xforms:itemset
nodeset="instance('accessibility-instance')/accesstype">
                 <xforms:label ref="accessterm"/>
            <xforms:copy ref="accessibility"/>
            <xforms:action ev:event="xforms-select">
                  <xforms:insert bind="metadata" at="last()"
position="after"/>
                         <xforms:setvalue ref="."/>
                 </xforms:action>
                 </xforms:itemset>
</xforms:select> 

However this produces some pretty mangled results and I'm not at all
sure what the bindings should really look like in this case.

Any pointers you (or anyone else) can offer would be much appreciated.

P.S. accessibility.xml attached in case required.

Many Thanks
Rob Walpole
Devon Portal Developer
Email robert.walpole@devon.gov.uk
Web http://www.devonline.gov.uk



> -----Original Message-----
> From: www-forms-request@w3.org 
> [mailto:www-forms-request@w3.org] On Behalf Of Aaron Reed
> Sent: 19 October 2007 21:53
> To: www-forms@w3.org
> Subject: Re: xforms:copy binding query
> 
> 
> 
> Hi Rob,
> 
> You can certainly bind two selects/select1s to the same node, 
> but when 
> you select items in a select/select1, it will replace the values 
> underneath it.  The only way you could mix and mingle them 
> are if both 
> selects had the same items and you use ctrl+<click> when 
> selecting items 
> (assuming your process uses a html:select type of control) but then 
> there isn't much reason to have both.  You could always try 
> to manage it 
> yourself with binding the two selects to different nodes and then 
> handling the xforms-select and xforms-deselect events and 
> inserting/deleting the nodes under the 'real' target node yourself.
> 
> --Aaron
> 
> Robert Walpole wrote:
> > Hi,
> > 
> > I am seeking some clarification about how the XForms copy element
> > (http://www.w3.org/TR/2007/WD-xforms11-20070222/#ui-adv-copy) should
> > work.
> > 
> > My question is whether it should be possible to use xforms:copy on
> > different xforms:select controls to copy different element 
> nodes into
> > the same target node?
> > 
> > For example, say I want to have 2 select controls that use use
> > xforms:copy to populate the data node in the following...
> > 
> > <test>
> >              <data/>
> > </test>
> > 
> > In this case I would bind both of my select controls to the 
> data nodeset
> > and by selecting two values from both controls I would hope to get
> > something like the following result...
> > 
> > <test>
> >              <data>
> >                              <abc>123</abc>
> >                              <abc>456</abc>
> >                              <def>321</def>
> >                              <def>654</def>
> >              </data>
> > </test> 
> > 
> > Is this allowable? It may be that I cannot bind two 
> different controls
> > to the same target node. Any clarification of this would be much
> > appreciated.
> > 
> > Many Thanks
> > Rob Walpole
> > Devon Portal Developer
> > Email robert.walpole@devon.gov.uk
> > Web http://www.devonline.gov.uk
> > 
> > 
> > 
> > 
> 
> 
> 
> 



Received on Tuesday, 23 October 2007 14:32:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:10 GMT