Select1 binding to instance in Form builder

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Select1 binding to instance in Form builder

Hasan
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
Regards,
Hasan
Reply | Threaded
Open this post in threaded view
|

Re: Select1 binding to instance in Form builder

Hank Ratzesberger-2
Hi Hasan,

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

<xforms:instance id="stations"
  src="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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Select1 binding to instance in Form builder

Erik Bruchez
Administrator
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Select1 binding to instance in Form builder

Hasan
I simpley created a select1 drop down, created a service . I want to bind the select1 control with a service that returns a xml itemset.


Select1 on form

Than i have created a http-service to some url. Testing this service returns response xml that is correct like

HTTP Service

Than a action is created and control is bind with for activation of form with the service.
Destination selection control itemset was given xpath.


Did i missed something or Xpath expression is not valid.

Is there any document/page on the orbeon wiki for the same.
Regards,
Hasan
Reply | Threaded
Open this post in threaded view
|

Re: Re: Select1 binding to instance in Form builder

Hasan
The version that i am using is Orbeon Forms dev-post-3.7.1.201001012242 .
Regards,
Hasan