Login  Register

Re: Re: Select1 binding to instance in Form builder

Posted by Erik Bruchez on Mar 04, 2011; 4:29am
URL: https://discuss.orbeon.com/Select1-binding-to-instance-in-Form-builder-tp3333206p3334665.html

Hasan,

There is a service editor and an action editor which allow you to do this from Form Builder directly (although 3.7.1 is very old now, so I don't know the status of these editors in the version you are using).

Barring that, as Hank suggests, you can write custom XForms in the form to run a submission to load the data into an instance, and manually modify the select control's itemset to point to that instance.

-Erik

On Thu, Mar 3, 2011 at 12:22 PM, Hank Ratzesberger <[hidden email]> wrote:
Hi Hasan,

You can use the src attribute to have the instance loaded :

<xforms:instance id="stations"
 src="<a href="http://db.nees.ucsb.edu/exist/rest/db?_query=doc(&#39;/pub/stations.xml&#39;)" target="_blank">http://db.nees.ucsb.edu/exist/rest/db?_query=doc('/pub/stations.xml')"/>

The select control has an itemset with a nodeset attribute.  Sorry that the
xpath and all looks complicated. Note that you can have both items and itemsets,
so you can have a "slect one" etc. :


<xforms:select1 ref="sta" id="sta-select">
 <xforms:item>
   <xforms:value/>
   <xforms:label> Select Station ... </xforms:label>
 </xforms:item>
 <xforms:itemset nodeset="instance('stations')//pfarr[@name='Sta_Info']/pfarr">
   <xforms:value value="upper-case(@name)"/>
   <xforms:label><xforms:output value="concat(upper-case(@name),' - ',pfstring[@name='Description'])"/></xforms:label>
 </xforms:itemset>
</xforms:select1>


<xforms:itemset nodeset="instance('stations')//pfarr[@name='Sta_Info']/pfarr">
 <xforms:value value="upper-case(@name)"/>
 <xforms:label><xforms:output value="concat(upper-case(@name),' - ',pfstring[@name='Description'])"/></xforms:label>
</xforms:itemset>


HTH,
Hank

On Mar 3, 2011, at 4:03 AM, Hasan wrote:

> Alex,
>
> I am currently using Form Builder in Orbeon 3.7.1 dev version . I need to
> bind my select1 components to a url for drop down values.
>
> Does Form Builder provides the functionality to get the item values from
> some URL/source.
>
>
> Regards,
>
> Hasan
>
> -----
> Hasan
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Select1-binding-to-instance-in-Form-builder-tp3333206p3333206.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws

Hank Ratzesberger
NEES@UCSB
Earth Research Institute
6707 Ellison Hall
University of California, Santa Barbara
805-893-8042









--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws