[ 
http://issues.apache.org/click/browse/CLK-497?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11717#action_11717
 ] 

James P Brown commented on CLK-497:
-----------------------------------

Thank you for the speedy reply.

I actually like that the behaviour of the parent to child state is managed 
through the isDisabled/isReadonly methods, because it keeps the component state 
and behaviours somewhat independent of each other. With the approach you 
suggest above, I think you may get into trouble because the container would 
only get one chance to "push" to its children: at the time set is invoked. 
However, if child components are added subsequent to the state change, then 
they would miss the event. As well, if a child component changes its state 
after the event, then it would be out of sync with the event. The virtue of 
your reliance on the isDisabled invocation is that it neatly side steps the 
reliance on state change events, and puts everything into the runtime state 
evaluations. Otherwise, you would need a kind of "failsafe" set invocation in 
the lifecycle that forces all components to be in the correct state, which I 
think isn't the best way to go.

Nonetheless, I think the framework is very good, and my use cases shouldn't 
impact your design decisions. I should also point out that you did in fact 
resolve my original issue, and that I am abusing your good nature by expanding 
the scope of my original defect request. I think the onus is on me to think 
this out a bit more, and make a better effort to understand the internals of 
the code.

Thank you,

James


> FieldSet isDisabled and isReadonly methods broken
> -------------------------------------------------
>
>                 Key: CLK-497
>                 URL: http://issues.apache.org/click/browse/CLK-497
>             Project: Click
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.0.1
>         Environment: Windows XP, Java 6
>            Reporter: James P Brown
>         Attachments: FieldSet_isDisabled_isReadonly_bug.zip
>
>
> The FieldSet is supposed to force its child components to be 
> disabled/readonly when it is set to disabled/readonly. I did not observe this 
> when I attempted to create a FieldSet with a child component.
> I believe the code to support this is not working as anticipated. The Field 
> class has modified methods for isDisabled/isReadonly that specifically check 
> if the parent component (i.e. container) is an instanceof FieldSet (or Form, 
> which is working AFAIK). The problem is that the design of FieldSet relies on 
> an instance of its private inner class FieldSet.InnerContainerField for 
> managing those child elements. When I step through the code in debug mode, 
> the class instance is of this inner class type (InnerContainerField) not 
> FieldSet. Since InnerContainerField is not a type of FieldSet, the subsequent 
> logic is ignored.

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

Reply via email to