Can we programmatically change binding properties in XForms/Orbeon?

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

Can we programmatically change binding properties in XForms/Orbeon?

Dagvadorj

I have a binding in XForms document like following:

<xforms:bind id="fr-form-binds" nodeset="instance('fr-form-instance')">
<xforms:bind id="section-1-bind" nodeset="section-1">
    <xforms:bind id="age-bind" name="age" nodeset="age" />
    <xforms:bind id="first-name-bind" nodeset="first-name"
        name="first-name"
        constraint="instance('fr-form-resources')//resource/section-1/first-name/alert/@show = false()" />
</xforms:bind>

Can we programmatically access (by XPath or something else) binding by its id and change constraint attribute in age-bind so that one doesn't need to write constraint like the one in first-name-bind and programmatically update the fr-form-resources?


Regards, 
Dagvadorj Galbadrakh


--
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: Can we programmatically change binding properties in XForms/Orbeon?

Erik Bruchez
Administrator
You can't change the attribute itself, but there might be a way to do
what you want to do. Can you clarify "so that one doesn't need to
write constraint like the one in first-name-bind and programmatically
update the fr-form-resources"?

-Erik

On Wed, Nov 28, 2012 at 1:37 AM, Dagvadorj Galbadrakh
<[hidden email]> wrote:

> I have a binding in XForms document like following:
>
> <xforms:bind id="fr-form-binds" nodeset="instance('fr-form-instance')">
> <xforms:bind id="section-1-bind" nodeset="section-1">
>     <xforms:bind id="age-bind" name="age" nodeset="age" />
>     <xforms:bind id="first-name-bind" nodeset="first-name"
>         name="first-name"
>
> constraint="instance('fr-form-resources')//resource/section-1/first-name/alert/@show
> = false()" />
> </xforms:bind>
>
> Can we programmatically access (by XPath or something else) binding by its
> id and change constraint attribute in age-bind so that one doesn't need to
> write constraint like the one in first-name-bind and programmatically update
> the fr-form-resources?
>
>
> Regards,
> Dagvadorj Galbadrakh
>
>
> --
> 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: Can we programmatically change binding properties in XForms/Orbeon?

Dagvadorj
I mean it would be great if we were able to change constraint in attribute with xpath or something instead of having a statically set constraint.

On 29 November 2012 02:51, Erik Bruchez <[hidden email]> wrote:
You can't change the attribute itself, but there might be a way to do
what you want to do. Can you clarify "so that one doesn't need to
write constraint like the one in first-name-bind and programmatically
update the fr-form-resources"?

-Erik

On Wed, Nov 28, 2012 at 1:37 AM, Dagvadorj Galbadrakh
<[hidden email]> wrote:
> I have a binding in XForms document like following:
>
> <xforms:bind id="fr-form-binds" nodeset="instance('fr-form-instance')">
> <xforms:bind id="section-1-bind" nodeset="section-1">
>     <xforms:bind id="age-bind" name="age" nodeset="age" />
>     <xforms:bind id="first-name-bind" nodeset="first-name"
>         name="first-name"
>
> constraint="instance('fr-form-resources')//resource/section-1/first-name/alert/@show
> = false()" />
> </xforms:bind>
>
> Can we programmatically access (by XPath or something else) binding by its
> id and change constraint attribute in age-bind so that one doesn't need to
> write constraint like the one in first-name-bind and programmatically update
> the fr-form-resources?
>
>
> Regards,
> Dagvadorj Galbadrakh
>
>
> --
> 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




--
Dagvadorj Galbadrakh


--
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: Re: Can we programmatically change binding properties in XForms/Orbeon?

Berrisford
Hi Dagvadorj;
    I’m a complete Orbeon novice myself, and not completely confident myself.  But I have seen working code e.g.
<xforms:bind id="inputStudentName" constraint="not(string(.)) or not(number(.))" nodeset="instance('controls')/inputs/student-name" /> and
<xforms:bind id="groupStudentName" nodeset="instance('controls')/groups/student-name" relevant="(instance('config')/search/type = 'student-name' and instance('config')/search/mode = 'results') or instance('config')/search/mode = 'search'" />
for constraining binding with XPath.  So if I understand your question correctly and that is what you’re after, I believe it is doable.  HOWEVER, as mentioned above, I’m a complete novice at this and still don’t completely understand how it all works so won’t be able to explain it much to you.
 
Thanks...

*************************************************
Berrisford Edwards
[hidden email]
Ph: +447917464336
 
Sent: Tuesday, December 04, 2012 2:20 AM
Subject: [ops-users] Re: Re: Can we programmatically change binding properties in XForms/Orbeon?
 
I mean it would be great if we were able to change constraint in attribute with xpath or something instead of having a statically set constraint.

On 29 November 2012 02:51, Erik Bruchez <[hidden email]> wrote:
You can't change the attribute itself, but there might be a way to do
what you want to do. Can you clarify "so that one doesn't need to
write constraint like the one in first-name-bind and programmatically
update the fr-form-resources"?

-Erik

On Wed, Nov 28, 2012 at 1:37 AM, Dagvadorj Galbadrakh
<[hidden email]> wrote:

> I have a binding in XForms document like following:
>
> <xforms:bind id="fr-form-binds" nodeset="instance('fr-form-instance')">
> <xforms:bind id="section-1-bind" nodeset="section-1">
>     <xforms:bind id="age-bind" name="age" nodeset="age" />
>     <xforms:bind id="first-name-bind" nodeset="first-name"
>         name="first-name"
>
> constraint="instance('fr-form-resources')//resource/section-1/first-name/alert/@show
> = false()" />
> </xforms:bind>
>
> Can we programmatically access (by XPath or something else) binding by its
> id and change constraint attribute in age-bind so that one doesn't need to
> write constraint like the one in first-name-bind and programmatically update
> the fr-form-resources?
>
>
> Regards,
> Dagvadorj Galbadrakh
>
>
> --
> 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



 
--
Dagvadorj Galbadrakh



--
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: Re: Re: Can we programmatically change binding properties in XForms/Orbeon?

Erik Bruchez
Administrator
I have added another comment on the StackOverflow thread:

http://stackoverflow.com/questions/13601914/can-we-programmatically-change-binding-properties-in-xforms-orbeon

-Erik

On Tue, Dec 4, 2012 at 1:48 AM, Berrisford Edwards
<[hidden email]> wrote:

> Hi Dagvadorj;
>     I’m a complete Orbeon novice myself, and not completely confident
> myself.  But I have seen working code e.g.
> <xforms:bind id="inputStudentName" constraint="not(string(.)) or
> not(number(.))" nodeset="instance('controls')/inputs/student-name" /> and
> <xforms:bind id="groupStudentName"
> nodeset="instance('controls')/groups/student-name"
> relevant="(instance('config')/search/type = 'student-name' and
> instance('config')/search/mode = 'results') or
> instance('config')/search/mode = 'search'" />
> for constraining binding with XPath.  So if I understand your question
> correctly and that is what you’re after, I believe it is doable.  HOWEVER,
> as mentioned above, I’m a complete novice at this and still don’t completely
> understand how it all works so won’t be able to explain it much to you.
>
> Thanks...
>
> *************************************************
> Berrisford Edwards
> [hidden email]
> Ph: +447917464336
>
> From: Dagvadorj Galbadrakh
> Sent: Tuesday, December 04, 2012 2:20 AM
> To: [hidden email]
> Subject: [ops-users] Re: Re: Can we programmatically change binding
> properties in XForms/Orbeon?
>
> I mean it would be great if we were able to change constraint in attribute
> with xpath or something instead of having a statically set constraint.
>
> On 29 November 2012 02:51, Erik Bruchez <[hidden email]> wrote:
>>
>> You can't change the attribute itself, but there might be a way to do
>> what you want to do. Can you clarify "so that one doesn't need to
>> write constraint like the one in first-name-bind and programmatically
>> update the fr-form-resources"?
>>
>> -Erik
>>
>> On Wed, Nov 28, 2012 at 1:37 AM, Dagvadorj Galbadrakh
>> <[hidden email]> wrote:
>> > I have a binding in XForms document like following:
>> >
>> > <xforms:bind id="fr-form-binds" nodeset="instance('fr-form-instance')">
>> > <xforms:bind id="section-1-bind" nodeset="section-1">
>> >     <xforms:bind id="age-bind" name="age" nodeset="age" />
>> >     <xforms:bind id="first-name-bind" nodeset="first-name"
>> >         name="first-name"
>> >
>> >
>> > constraint="instance('fr-form-resources')//resource/section-1/first-name/alert/@show
>> > = false()" />
>> > </xforms:bind>
>> >
>> > Can we programmatically access (by XPath or something else) binding by
>> > its
>> > id and change constraint attribute in age-bind so that one doesn't need
>> > to
>> > write constraint like the one in first-name-bind and programmatically
>> > update
>> > the fr-form-resources?
>> >
>> >
>> > Regards,
>> > Dagvadorj Galbadrakh
>> >
>> >
>> > --
>> > 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
>>
>
>
>
> --
> Dagvadorj Galbadrakh
>
> ________________________________
>
> --
> 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
>


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