regarding post 11658060 (Problem with xforms-value-changed, incremental="true" and replace="instance")

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

regarding post 11658060 (Problem with xforms-value-changed, incremental="true" and replace="instance")

Alexander Žaťko
I have run into the same issue Henrik reported last year with the  
xforms-value-changed causing infinite loop condition. So I followed  
Erik's advice here:

http://www.nabble.com/forum/ViewPost.jtp?post=11658060&framed=y

However, I am unable to stop the app from running into infinite loop  
when I place the setvalue elements that reset the flag into the  
submission element like this:

<xforms:submission id="read" ref="instance('main')" resource="read-
places" method="post" replace="instance" validate="false">

     <xforms:action ev:event="xforms-submit-done">
         <xforms:setvalue ref="instance('main')/xvc-flag">false</
xforms:setvalue>
     </xforms:action>

     <xforms:action ev:event="xforms-submit-error">
         <xforms:setvalue ref="instance('main')/xvc-flag">false</
xforms:setvalue>
     </xforms:action>

</xforms:submission>

When I remove the 2 xforms:submission actions child elements the  
infinite loop condition does not occur, but I also am unable to  
execute the logic triggred by the xforms-value-changed because the  
controlling flag is set to block that action. I am wondering where am  
I making a mistake as it seems like the UI gets' rebuilt after the  
xforms-submit-done is executed, at which point the logic triggred by  
the xforms-value-changed is unblocked again and is executed by the UI  
rebuild.

The control containing the xforms-value-changed looks like this:

<xforms:select1 ref="place/@id" appearance="minimal">
     <xforms:label>Select Area </xforms:label>
     <xforms:itemset nodeset="areas">
         <xforms:label ref="@name"/>
         <xforms:value ref="@id"/>
     </xforms:itemset>
     <xforms:action ev:event="xforms-value-changed"  
if="instance('main')/xvc-flag = 'false'">
         <xforms:setvalue ref="instance('main')/xvc-flag">true</
xforms:setvalue>
         <xforms:send submission="read"/>
     </xforms:action>
</xforms:select1>

Thanks

A.


--
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: regarding post 11658060 (Problem with xforms-value-changed, incremental="true" and replace="instance")

Alessandro Vernet
Administrator
Alex,

On Feb 15, 2008, at 4:58 AM, Alexander Zatko wrote:

> I have run into the same issue Henrik reported last year with the  
> xforms-value-changed causing infinite loop condition. So I followed  
> Erik's advice here:
>
> http://www.nabble.com/forum/ViewPost.jtp?post=11658060&framed=y
>
> However, I am unable to stop the app from running into infinite loop  
> when I place the setvalue elements that reset the flag into the  
> submission element like this:
> [...]
The problem you describe looks very similar to the one discussed in  
the thread linked below. In that case the solution is to add an  
<xforms:refresh/>.

http://www.nabble.com/More-infinite-loops-when-upgrading-to-3.6-to14714527.html#a14747677

If this doesn't help, could you create an example which we can run the  
XForms sandbox and which shows the issue you are talking about?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.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
Reply | Threaded
Open this post in threaded view
|

Re: Re: regarding post 11658060 (Problem with xforms-value-changed, incremental="true" and replace="instance")

Alexander Žaťko
Alex,

The remedy offered in that message did not help me. I am attaching a  
file here that shows the loop. I just adapted the original Henrik's  
file.

A.





On Feb 15, 2008, at 9:01 PM, Alessandro Vernet wrote:

> Alex,
>
> On Feb 15, 2008, at 4:58 AM, Alexander Zatko wrote:
>
>> I have run into the same issue Henrik reported last year with the  
>> xforms-value-changed causing infinite loop condition. So I followed  
>> Erik's advice here:
>>
>> http://www.nabble.com/forum/ViewPost.jtp?post=11658060&framed=y
>>
>> However, I am unable to stop the app from running into infinite  
>> loop when I place the setvalue elements that reset the flag into  
>> the submission element like this:
>> [...]
>
> The problem you describe looks very similar to the one discussed in  
> the thread linked below. In that case the solution is to add an  
> <xforms:refresh/>.
>
> http://www.nabble.com/More-infinite-loops-when-upgrading-to-3.6-to14714527.html#a14747677
>
> If this doesn't help, could you create an example which we can run  
> the XForms sandbox and which shows the issue you are talking about?
>
> Alex
> --
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> Orbeon's Blog: http://www.orbeon.com/blog/
> Personal Blog: http://avernet.blogspot.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


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

loop.xhtml (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: regarding post 11658060 (Problem with xforms-value-changed, incremental="true" and replace="instance")

Alessandro Vernet
Administrator
Alex,

On Feb 15, 2008, at 1:20 PM, Alexander Zatko wrote:
> The remedy offered in that message did not help me. I am attaching a  
> file here that shows the loop. I just adapted the original Henrik's  
> file.


This is an interesting one.

In this case you need to add a refresh before the setvalue in the  
xforms-submit-done and xforms-submit-error event handler. If you  
don't, after the submission the engine sees that the value for the  
input has changed, but first runs the xforms-submit-done handler. At  
the end, it run your xforms-value-changed handler, which at that point  
can run since in xforms-submit-done you set the value of the flag to  
false. Adding a refresh at the beginning of xforms-submit-done forces  
the xforms-value-changed to be dispatched right there, before you set  
the value of the flag to false.

Erik implemented last week a very nice enhancement to the logging. Now  
log messages are indented so you can see what triggers what. This is  
very useful to figure out what is going on in cases like this one. In  
the attached events.log you can see the log with the xforms:refresh. I  
have also attached your code with the added xforms:refresh for  
reference.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.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

events.log (6K) Download Attachment
loop.xhtml (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: regarding post 11658060 (Problem with xforms-value-changed, incremental="true" and replace="instance")

Alexander Žaťko
Thank you - your proposed solution works in my app too.

A.

On Feb 17, 2008, at 8:53 AM, Alessandro Vernet wrote:

> Alex,
>
> On Feb 15, 2008, at 1:20 PM, Alexander Zatko wrote:
>> The remedy offered in that message did not help me. I am attaching  
>> a file here that shows the loop. I just adapted the original  
>> Henrik's file.
>
>
> This is an interesting one.
>
> In this case you need to add a refresh before the setvalue in the  
> xforms-submit-done and xforms-submit-error event handler. If you  
> don't, after the submission the engine sees that the value for the  
> input has changed, but first runs the xforms-submit-done handler. At  
> the end, it run your xforms-value-changed handler, which at that  
> point can run since in xforms-submit-done you set the value of the  
> flag to false. Adding a refresh at the beginning of xforms-submit-
> done forces the xforms-value-changed to be dispatched right there,  
> before you set the value of the flag to false.
>
> Erik implemented last week a very nice enhancement to the logging.  
> Now log messages are indented so you can see what triggers what.  
> This is very useful to figure out what is going on in cases like  
> this one. In the attached events.log you can see the log with the  
> xforms:refresh. I have also attached your code with the added  
> xforms:refresh for reference.
>
> Alex
> --
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> Orbeon's Blog: http://www.orbeon.com/blog/
> Personal Blog: http://avernet.blogspot.com/
> <events.log><loop.xhtml>
> --
> 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