You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org> on 2008/09/13 19:08:44 UTC

[jira] Commented: (TAPESTRY-2460) Nested BeanEditors (where the block parameter for a property to one BeanEditor contains another BeanEditor) results in a StackOverflowException

    [ https://issues.apache.org/jira/browse/TAPESTRY-2460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630797#action_12630797 ] 

Howard M. Lewis Ship commented on TAPESTRY-2460:
------------------------------------------------

This jumped out at me:

	@Component(parameters =
	{ "object=context.propertyValue", "model=model" })
	private BeanEditor editor2;

I suspect things would work if

object=a.data

I think what's happening is that the inner BeanEditor is trying to update a property of its object ... that means that a Block is, via the PropertyEditContext, trying to resolve context.propertyValue.

i.e. this code:

           public void setPropertyValue(Object value)
            {
                propertyModel.getConduit().set(object, value);
            }


In other words, we have, say, a TextField whose value is bound to context.propertyValue.

However, to update that we need the object parameter bound to BeanEditor and passed to PropertyEditor.

That object parameter is bound to  .... context.propertyValue.

The reason it works for rendering, and not for form submission, is that during rendering, the parameter fields (object inside PropertyEditor and BeanEditor) cache their values.  During a form submssion, the value are re-resolved on each reference, and because they are @Environmental, the same object is used at both levels, and that leads to the endless loop.

I'm thinking about how I can recognize and fix this case.  I think BeanEditor needs to add Form actions to resolve the object parameter and store its value into a temporary field; that is, dereference the object parmater just once, around any usages of PropertyEditor.


> Nested BeanEditors (where the block parameter for a property to one BeanEditor contains another BeanEditor) results in a StackOverflowException
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2460
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2460
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.13
>            Reporter: Kristian Marinkovic
>            Assignee: Howard M. Lewis Ship
>             Fix For: 5.0.14
>
>         Attachments: beaneditor.zip
>
>
> the eclipse/maven example project shows how a StackOverflowException is thrown if a Form is submitted that contains a BeanEditor that itself contains another BeanEditor. However the initial display works perfectly.
> somehow i suspect the PropertyConduits to be responsible because two of them produce the infinite loop.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org