PDA

View Full Version : [FNR] IE6: Radio generated without name



mariusz.pala
29 Oct 2010, 12:54 AM
Hi,

in IE6 I have some Radio buttons with the same name but not in RadioGroup (because they are place in a werid way).
But in IE6 the Radio is generated without "name" attribute which causes that every radio can be selected, not just one. See the screenshot:
23068

This is generated HTML from IE Dev Toolbar:


<INPUT class=" x-form-radio" id="x-auto-814" style="LEFT: 0px; POSITION: relative; TOP: 1px" type="radio" CHECKED __eventBits="6144" value="null" />

And this is the code:


ContentPanel main = new ContentPanel();
main.setHeaderVisible(false);
main.setBodyBorder(false);
main.setBorders(false);
main.setStyleAttribute("margin", "5px");

FieldSet optionSet = new FieldSet();
optionSet.setHeading(CaraMessages.INSTANCE.taskNotificationDialogNotifyWhenTask());
optionSet.setLayout(new RowLayout(Orientation.HORIZONTAL));
optionSet.setWidth("100%");
optionSet.setHeight(130);

ContentPanel group1 = new ContentPanel();
group1.setHeaderVisible(false);
group1.setBodyBorder(false);
group1.setBorders(false);
FormLayout layout = new FormLayout();
layout.setHideLabels(true);
group1.setLayout(layout);

final Radio issueRadio = new Radio();
issueRadio.setName(RADIO_NAME);
issueRadio.setBoxLabel(CaraMessages.INSTANCE.taskNotificationDialogIssued());
group1.add(issueRadio);

final Radio completedRadio = new Radio();
completedRadio.setName(RADIO_NAME);
completedRadio.setBoxLabel(CaraMessages.INSTANCE.taskNotificationDialogCompleted());
group1.add(completedRadio);

final Radio rejectedRadio = new Radio();
rejectedRadio.setName(RADIO_NAME);
rejectedRadio.setBoxLabel(CaraMessages.INSTANCE.taskNotificationDialogRejected());
group1.add(rejectedRadio);

ContentPanel group2 = new ContentPanel();
group2.setHeaderVisible(false);
group2.setBodyBorder(false);
group2.setBorders(false);
layout = new FormLayout();
layout.setHideLabels(true);
group2.setLayout(layout);

final Radio startOverdueRadio = new Radio();
startOverdueRadio.setName(RADIO_NAME);
startOverdueRadio.setBoxLabel(CaraMessages.INSTANCE.taskNotificationDialogStartOverdue());
group2.add(startOverdueRadio, new FormData("96%"));

final Radio finishDueRadio = new Radio();
finishDueRadio.setName(RADIO_NAME);
finishDueRadio.setBoxLabel(CaraMessages.INSTANCE.taskNotificationDialogFinishDueIn());

final SpinnerField thresholdField = new SpinnerField();
thresholdField.setWidth(50);
thresholdField.setPropertyEditorType(Integer.class);
thresholdField.setMinValue(0);
thresholdField.setFormat(NumberFormat.getFormat("##0"));
thresholdField.setAllowDecimals(false);
// thresholdField.setValue(taskTemplate.getTargetDuration());
thresholdField.setFireChangeEventOnSetValue(true);

LabelField dayLabel = new LabelField(CaraMessages.INSTANCE.taskNotificationDialogDays());

MultiField<Field<?>> mf = new MultiField<Field<?>>("", finishDueRadio, thresholdField, dayLabel);
group2.add(mf, new FormData("96%"));

final Radio finishOverdueRadio = new Radio();
finishOverdueRadio.setName(RADIO_NAME);
finishOverdueRadio.setBoxLabel(CaraMessages.INSTANCE.taskNotificationDialogFinishOverdue());
group2.add(finishOverdueRadio, new FormData("96%"));

main.add(optionSet);

optionSet.add(group1, new RowData(0.5, 1));
optionSet.add(group2, new RowData(0.5, 1));

add(main);

The weird thing is that the Explorer example works fine. Actually buttons inside RadioGroup seems to be fine. So what can be wrong?

mariusz.pala
29 Oct 2010, 1:31 AM
The fix I need in that case is to modify onRender method in CheckBox class:

Replace

@Override
protected void onRender(Element target, int index) {
if (this instanceof Radio) {
input = new El(DOM.createInputRadio(""));
} else {
input = new El(DOM.createInputCheck());
}

With:

@Override
protected void onRender(Element target, int index) {
if (this instanceof Radio) {
input = new El(DOM.createInputRadio(name));
} else {
input = new El(DOM.createInputCheck());
}

Unfortunately I can't ovewrite the onRender method and just change this because some attributes are not visible. How I can make a workaround for that without modifying Ext GWT source?

sven
29 Oct 2010, 2:08 AM
This is a duplicate and we already work on a fix for this.

mariusz.pala
29 Oct 2010, 3:14 AM
This is really critical, can you help me somehow with that? I changed the code to

input = new El(DOM.createInputRadio(name));
but the result is the same...

sven
29 Oct 2010, 3:23 AM
That change is not sufficient. I commited a change to SVN at revision 2296 which should fix this.

Can you please validate this?

mariusz.pala
29 Oct 2010, 3:28 AM
Thanks, I will do that.

sven
29 Oct 2010, 3:51 AM
Please also report back here than if possible.

mariusz.pala
29 Oct 2010, 4:00 AM
Of course, it just take a while to create a build with over 60 permutations to test :)

sven
29 Oct 2010, 4:04 AM
You can only compile one permutation for testing. IE6 also supports dev mode.

mariusz.pala
29 Oct 2010, 4:48 AM
I know, but I don't have IE6 :) And I was hoping that the fix will work, so I didn't want to create another build. And I was right, it works now:) Thanks!

sven
29 Oct 2010, 4:51 AM
Great. This change will be part of GXT 2.2.1