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 2015/11/18 19:48:10 UTC

[jira] [Commented] (WICKET-6038) RadioGroup selection reset

    [ https://issues.apache.org/jira/browse/WICKET-6038?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15011650#comment-15011650 ] 

Sven Meier commented on WICKET-6038:
------------------------------------

Have you tried removing checked="checked" from your markup?

> RadioGroup selection reset
> --------------------------
>
>                 Key: WICKET-6038
>                 URL: https://issues.apache.org/jira/browse/WICKET-6038
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.20.0
>         Environment: Ubuntu Desktop 14.04 LTS, latest Firefox/Chrome
>            Reporter: Sergiu Hlihor
>            Priority: Minor
>
> Given the following RadioGroup code:
> RadioGroup<String> groupSelection = new RadioGroup<String>("selectionChoice", new PropertyModel<String>(this, "selectionChoice")) {
> 	@Override
> 	protected void onSelectionChanged(Object newSelection) {
> 		super.onSelectionChanged(newSelection);
> 		// do something
> 	}
> 	@Override
> 	protected boolean wantOnSelectionChangedNotifications() {
> 		return true;
> 	}
> };
> groupSelection.add(new Radio<String>("firstSelection", new Model<String>("First")));
> groupSelection.add(new Radio<String>("secondSelection", new Model<String>("Second")));
> Html:
> <div class="col-xs-offset-2 col-xs-10" wicket:id="bankAccountType">
> 	<label class="radio"> <input id="secondSelection" name="groupChoice" type="radio" wicket:id="secondSelection">Second</label>
> 	<label class="radio"> <input id="firstSelection" name="groupChoice" type="radio" wicket:id="firstSelection" checked="checked">First</label>
> </div>
> The "firstSelection" is checked as expected when page is first loaded. However, when selecting the "secondSelection", the server side selection changed code is executed, however, the Radio button is switched back to "firstSelection".  The issue apparently dissapears if the html lines which define the Radio options are switched (which defeats the purpose of displaying second option as default selected one). 
> From our side, the severity is minor, however, if fixed, I would appreciate greatly if the fix is applied also on 6.x branch.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)