You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by le...@gmail.com on 2010/12/22 13:03:04 UTC
help with bug TAP5-587
Hi,
Is there any solution for bug TAP5-587?
I have searched in the releases notes, but a solution did not appear .
My page needs to show an input text for each element of a variable size
collection, that's the reason why I can't use blocks, the quantity needs to
be variable. For that reason i have used the loop component but i get the
exception that you can look at TAP5-587 .
The cause of the bug is that when a volatile Loop in a form gets updated
through Ajax and results in having less source items than on initial page
render, a java.util.NoSuchElementException because the Loop seems to think
there are more source items then there are.
The report bug gives a solution, rewrite the Loop's advanceVolatile()
method, but it doesn't work, that solves the NoSuchElementException but the
form fails. The form wants to render some input, and read a null property of
an object from the collection.
I tried to use an if sentence in the .tml, but it doesn't work. Tapestry
rendered the loop even if the condition is false, and throws the same
exception.
Any ideas?
Re: help with bug TAP5-587
Posted by Robert Zeigler <ro...@roxanemy.com>.
What value are you binding to the loop's formState parameter? Have you tried "NONE"?
Robert
On Dec 22, 2010, at 12/226:03 AM , leandroaispuru@gmail.com wrote:
> Hi,
> Is there any solution for bug TAP5-587?
> I have searched in the releases notes, but a solution did not appear .
> My page needs to show an input text for each element of a variable size
> collection, that's the reason why I can't use blocks, the quantity needs to
> be variable. For that reason i have used the loop component but i get the
> exception that you can look at TAP5-587 .
> The cause of the bug is that when a volatile Loop in a form gets updated
> through Ajax and results in having less source items than on initial page
> render, a java.util.NoSuchElementException because the Loop seems to think
> there are more source items then there are.
> The report bug gives a solution, rewrite the Loop's advanceVolatile()
> method, but it doesn't work, that solves the NoSuchElementException but the
> form fails. The form wants to render some input, and read a null property of
> an object from the collection.
> I tried to use an if sentence in the .tml, but it doesn't work. Tapestry
> rendered the loop even if the condition is false, and throws the same
> exception.
>
> Any ideas?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: help with bug TAP5-587
Posted by le...@gmail.com.
Sorry, we have solved the problem with jim's solution.
But i tried what you have said and it did not work.
Thank you Robert for answer to me so quickly.
2010/12/22 <le...@gmail.com>
> Thanks Jim!
> Now it works fine!
> I have used the question mark with the solution of the bug that i have
> passed in the first email!
>
> thank you so much again!
> Bye!
>
> 2010/12/22 Jim O'Callaghan <jc...@yahoo.co.uk>
>
> When you say at the end of your email that Tapestry rendered the loop even
>> if the condition is false, how are you checking the condition? Have you
>> tried using the question mark operator in your output loop / condition to
>> stop output if an item is null? Ex.:
>>
>> <t:formatnull value="${contract?.manager?.address?.city?.name}" />
>>
>> ... where if any of the hierarchy is null is will stop trying to evaluate
>> methods / properties on subordinates, avoiding a NPE.
>>
>> Is it possible that where you are referencing a condition in a loop that
>> the
>> actual reference is invisibly instantiating something?
>>
>> Regards,
>> Jim.
>>
>> -----Original Message-----
>> From: leandroaispuru@gmail.com [mailto:leandroaispuru@gmail.com]
>> Sent: 22 December 2010 12:03
>> To: users@tapestry.apache.org
>> Subject: help with bug TAP5-587
>>
>> -Hi,
>> Is there any solution for bug TAP5-587?
>> I have searched in the releases notes, but a solution did not appear .
>> My page needs to show an input text for each element of a variable size
>> collection, that's the reason why I can't use blocks, the quantity needs
>> to
>> be variable. For that reason i have used the loop component but i get the
>> exception that you can look at TAP5-587 .
>> The cause of the bug is that when a volatile Loop in a form gets updated
>> through Ajax and results in having less source items than on initial page
>> render, a java.util.NoSuchElementException because the Loop seems to think
>> there are more source items then there are.
>> The report bug gives a solution, rewrite the Loop's advanceVolatile()
>> method, but it doesn't work, that solves the NoSuchElementException but
>> the
>> form fails. The form wants to render some input, and read a null property
>> of
>> an object from the collection.
>> I tried to use an if sentence in the .tml, but it doesn't work. Tapestry
>> rendered the loop even if the condition is false, and throws the same
>> exception.
>>
>> Any ideas?
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
Re: help with bug TAP5-587
Posted by le...@gmail.com.
Thanks Jim!
Now it works fine!
I have used the question mark with the solution of the bug that i have
passed in the first email!
thank you so much again!
Bye!
2010/12/22 Jim O'Callaghan <jc...@yahoo.co.uk>
> When you say at the end of your email that Tapestry rendered the loop even
> if the condition is false, how are you checking the condition? Have you
> tried using the question mark operator in your output loop / condition to
> stop output if an item is null? Ex.:
>
> <t:formatnull value="${contract?.manager?.address?.city?.name}" />
>
> ... where if any of the hierarchy is null is will stop trying to evaluate
> methods / properties on subordinates, avoiding a NPE.
>
> Is it possible that where you are referencing a condition in a loop that
> the
> actual reference is invisibly instantiating something?
>
> Regards,
> Jim.
>
> -----Original Message-----
> From: leandroaispuru@gmail.com [mailto:leandroaispuru@gmail.com]
> Sent: 22 December 2010 12:03
> To: users@tapestry.apache.org
> Subject: help with bug TAP5-587
>
> -Hi,
> Is there any solution for bug TAP5-587?
> I have searched in the releases notes, but a solution did not appear .
> My page needs to show an input text for each element of a variable size
> collection, that's the reason why I can't use blocks, the quantity needs to
> be variable. For that reason i have used the loop component but i get the
> exception that you can look at TAP5-587 .
> The cause of the bug is that when a volatile Loop in a form gets updated
> through Ajax and results in having less source items than on initial page
> render, a java.util.NoSuchElementException because the Loop seems to think
> there are more source items then there are.
> The report bug gives a solution, rewrite the Loop's advanceVolatile()
> method, but it doesn't work, that solves the NoSuchElementException but the
> form fails. The form wants to render some input, and read a null property
> of
> an object from the collection.
> I tried to use an if sentence in the .tml, but it doesn't work. Tapestry
> rendered the loop even if the condition is false, and throws the same
> exception.
>
> Any ideas?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
RE: help with bug TAP5-587
Posted by Jim O'Callaghan <jc...@yahoo.co.uk>.
When you say at the end of your email that Tapestry rendered the loop even
if the condition is false, how are you checking the condition? Have you
tried using the question mark operator in your output loop / condition to
stop output if an item is null? Ex.:
<t:formatnull value="${contract?.manager?.address?.city?.name}" />
... where if any of the hierarchy is null is will stop trying to evaluate
methods / properties on subordinates, avoiding a NPE.
Is it possible that where you are referencing a condition in a loop that the
actual reference is invisibly instantiating something?
Regards,
Jim.
-----Original Message-----
From: leandroaispuru@gmail.com [mailto:leandroaispuru@gmail.com]
Sent: 22 December 2010 12:03
To: users@tapestry.apache.org
Subject: help with bug TAP5-587
-Hi,
Is there any solution for bug TAP5-587?
I have searched in the releases notes, but a solution did not appear .
My page needs to show an input text for each element of a variable size
collection, that's the reason why I can't use blocks, the quantity needs to
be variable. For that reason i have used the loop component but i get the
exception that you can look at TAP5-587 .
The cause of the bug is that when a volatile Loop in a form gets updated
through Ajax and results in having less source items than on initial page
render, a java.util.NoSuchElementException because the Loop seems to think
there are more source items then there are.
The report bug gives a solution, rewrite the Loop's advanceVolatile()
method, but it doesn't work, that solves the NoSuchElementException but the
form fails. The form wants to render some input, and read a null property of
an object from the collection.
I tried to use an if sentence in the .tml, but it doesn't work. Tapestry
rendered the loop even if the condition is false, and throws the same
exception.
Any ideas?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org