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 11:01:50 UTC