You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sven Meier (JIRA)" <ji...@apache.org> on 2013/01/31 22:11:14 UTC

[jira] [Closed] (WICKET-5021) AjaxFormComponentUpdatingBehavior and Behavior not working together properly

     [ https://issues.apache.org/jira/browse/WICKET-5021?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sven Meier closed WICKET-5021.
------------------------------

    Resolution: Invalid
      Assignee: Sven Meier

When your behavior disables the checkbox in #onComponentTag(), the component already prepared the componentTag without a disabled attribute.

You should override #onConfigure() instead:

		checkbox2.add(new Behavior() {
		    @Override
		    public void onConfigure(Component component) {
				if (doDisableCheckbox2) {
					component.setEnabled(false);
				} else {
					component.setEnabled(true);
				}
		    }
		});

                
> AjaxFormComponentUpdatingBehavior and Behavior not working together properly
> ----------------------------------------------------------------------------
>
>                 Key: WICKET-5021
>                 URL: https://issues.apache.org/jira/browse/WICKET-5021
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.5.0
>            Reporter: Thomas Konstantinides
>            Assignee: Sven Meier
>         Attachments: enabledisable.zip
>
>
> I have attached a QuickStart which shows the following problem:
> On a WebPage having one simple form there's two checkboxes: checkbox1 and checkbox2. 
> Checkbox1 has an AjaxFormComponentUpdatingBehavior as "onchange" handler, which sets a boolean flag 'doDisableInput2'. This flag is read by a Behavior added to checkbox2 which then does the actual disabling or enabling of checkbox2. On re-rendering checkbox2 the Behavior for the disabling/enabling seems to be called but the enabled state of the checkbox is not displayed properly. So it seems that some step in the re-rendering process is not executed when using the AjaxFormComponentUpdatingBehavior.
> As effect of this behavior in the QuickStart if you click checkbox1 and thus internally change checkbox2 to be disabled and afterwards you click checkbox2 (which is not displayed as disabled) wicket shows a page stating that there's access problems. This seems fine to me since the component is disabled.
> What I would expect however is that the component is also shown as disabled after it has been refreshed by ajax.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira