More strange behaviour of repeat since Orbeon 2018

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

More strange behaviour of repeat since Orbeon 2018

Gerrit Boers
Hi,

Further testing has revealed another issue with the repeat where code that used to work doesn’t work anymore.
I used the following in a repeat:
 <xforms:trigger appearance="minimal">
                                                    <xforms:label ref="label"/>
                                                    <xforms:action ev:event="DOMActivate">
                                                        <xforms:setvalue ref="instance('selected-concept')/@code" value="xxforms:repeat-current('child-repeat')/@cCode"/>

Sometimes it works but mostly the wrong code will be set. for example clicking on the third child concept will not set the correct code (54455007) but the code of the parent (312853008):

 

The strange thing is that there’s no xxforms-index-changed event used on this repeat to set the code. Sometimes a second click will set the correct code, sometimes the first click will work. Even without any submission triggered the value is not set correctly.



Kind regards,

Gerrit





--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: More strange behaviour of repeat since Orbeon 2018

Alessandro  Vernet
Administrator
Hi Gerrit,

This indeed sounds like a bug. Is the parent node (312853008) even included
in the repeat id `child-repeat`? If not, then this isn't even a case of
being on the wrong iteration.

Could you try replacing the `<xforms:setvalue>` by an `<xforms:message
value="xxforms:repeat-current('child-repeat')/@cCode"/>`, and see if you
have multiple messages?

And of course, it would be great if you could put together a minimal example
that I can run to reproduce the issue.

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: More strange behaviour of repeat since Orbeon 2018

Gerrit Boers
Hi Alex,

No the parent node code does not appear in the child repeat. There is one instance containing the concept with it’s parents and children, the parents and children are displayed in repeats. The names are links allowing for navigation through the concept hierarchy.

If the action only contains the message:

<xforms:message value="xxforms:repeat-current('child-repeat')/@cCode"/>

Every click will display the correct code. If the setvalue is added:

<xforms:setvalue ref="instance('selected-concept')/@code" value="xxforms:repeat-current('child-repeat')/@cCode"/>
<xforms:message value="xxforms:repeat-current('child-repeat')/@cCode"/>

The behaviour becomes erratic as sometimes the dialog does not appear (the selected code instance contains the parent code) on the first click but will appear on the second click (showing the correct code. Just these two lines are in the action, no submissions are fired, no instances replaced.

I tried to put together a simple example but haven’t been able to reproduce this issue in a simple form.

The way things are now in Orbeon 2018 we have to stay with Orbeon 2017.2. It more or less boils down to the fact that it’s no longer possible to distinguish user action from system action, a lot of our code depends on being able to make that distinction.

Kind regards,

Gerrit

On 7 Oct 2018, at 01:49, Alessandro Vernet <[hidden email]> wrote:

Hi Gerrit,

This indeed sounds like a bug. Is the parent node (312853008) even included
in the repeat id `child-repeat`? If not, then this isn't even a case of
being on the wrong iteration.

Could you try replacing the `<xforms:setvalue>` by an `<xforms:message
value="xxforms:repeat-current('child-repeat')/@cCode"/>`, and see if you
have multiple messages?

And of course, it would be great if you could put together a minimal example
that I can run to reproduce the issue.

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: More strange behaviour of repeat since Orbeon 2018

Gerrit Boers
Hi Alex,

My colleague Alexander came up with a solution for this issue. The strange behaviour seems to be connected to index functions (xxforms:repeat-current() and index()). 

Replacing all uses of the xxforms:repeat-current() and index() functions by the context() function solves the issue.
Examples:

<xforms:setvalue ref="instance('selected-concept')/@code" value="instance('designation-resultset')/designation[index('designations')]/@code"/>
replaced by
<xforms:setvalue ref="instance('selected-concept')/@code" value="context()/@code"/>

and
<xforms:setvalue ref="instance('selected-concept')/@code" value="xxforms:repeat-current('child-repeat')/@cCode"/>
replaced by
<xforms:setvalue ref="instance('selected-concept')/@code" value="context()/@cCode"/>

Although the issue is solved as far as we’re concerned it does seem like a bug in the behaviour of the index functions.


Kind regards,

Gerrit


On 8 Oct 2018, at 12:56, Gerrit Boers <[hidden email]> wrote:

Hi Alex,

No the parent node code does not appear in the child repeat. There is one instance containing the concept with it’s parents and children, the parents and children are displayed in repeats. The names are links allowing for navigation through the concept hierarchy.

If the action only contains the message:

<xforms:message value="xxforms:repeat-current('child-repeat')/@cCode"/>

Every click will display the correct code. If the setvalue is added:

<xforms:setvalue ref="instance('selected-concept')/@code" value="xxforms:repeat-current('child-repeat')/@cCode"/>
<xforms:message value="xxforms:repeat-current('child-repeat')/@cCode"/>

The behaviour becomes erratic as sometimes the dialog does not appear (the selected code instance contains the parent code) on the first click but will appear on the second click (showing the correct code. Just these two lines are in the action, no submissions are fired, no instances replaced.

I tried to put together a simple example but haven’t been able to reproduce this issue in a simple form.

The way things are now in Orbeon 2018 we have to stay with Orbeon 2017.2. It more or less boils down to the fact that it’s no longer possible to distinguish user action from system action, a lot of our code depends on being able to make that distinction.

Kind regards,

Gerrit

On 7 Oct 2018, at 01:49, Alessandro Vernet <[hidden email]> wrote:

Hi Gerrit,

This indeed sounds like a bug. Is the parent node (312853008) even included
in the repeat id `child-repeat`? If not, then this isn't even a case of
being on the wrong iteration.

Could you try replacing the `<xforms:setvalue>` by an `<xforms:message
value="xxforms:repeat-current('child-repeat')/@cCode"/>`, and see if you
have multiple messages?

And of course, it would be great if you could put together a minimal example
that I can run to reproduce the issue.

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].


--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: More strange behaviour of repeat since Orbeon 2018

Alessandro  Vernet
Administrator
Hi Gerrit,

I'm glad you and Alexander found a solution, and using `context()` also
makes your expressions simpler in your case. I'm not sure if the difference
between `xxforms:repeat-current(…)` and `context()` is to be expected or
should be considered a bug.

If you'd like to pursue this further, and have a minimal example showing
that difference, we'll gladly look into it. But I'll hold no grudges against
you guys if you're happy enough to have found a solution to your problem :).

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet