You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@click.apache.org by "James P Brown (JIRA)" <ji...@apache.org> on 2009/02/28 00:12:55 UTC

[JIRA] Updated: (CLK-497) FieldSet isDisabled and isReadonly methods broken

     [ http://issues.apache.org/click/browse/CLK-497?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James P Brown updated CLK-497:
------------------------------

    Attachment: FieldSet_isDisabled_isReadonly_bug.zip

I am attaching source code changes I made to the Field and FieldSet classes to address this defect (and the svn patch files for a project level diff), and modified FieldSetTest and FormTest unit test classes to test bug and fix.

I do not believe this to be the best way to address the problem, as I turned the private inner class into a public one, and added two methods to expose the isDisabled and isReadonly data of the outer class FieldSet. However, this is a drastic measure that clearly breaks the intended design of the inner class. I believe someone more familiar with this code will have to sort this out.

Nonetheless, I believe my changes to the unit test classes to be of value going forward, regardless of the true solution.

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