Skip to content

Commit e0a8673

Browse files
authored
Issue 53620: Luminex import update to writeSameCheckboxCell to use "disabled" behavior instead of hiding the column inputs (#915)
1 parent 6a39bd6 commit e0a8673

3 files changed

Lines changed: 10 additions & 12 deletions

File tree

luminex/src/org/labkey/luminex/LuminexUploadWizardAction.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,14 +441,16 @@ public void writeSameCheckboxCell(RenderContext ctx, HtmlWriter out)
441441
InputBuilder.checkbox().name(id).id(id)
442442
).appendTo(out);
443443

444-
StringBuilder onchange = new StringBuilder("b = this.checked;");
444+
StringBuilder onchange = new StringBuilder("b = this.checked;\n");
445445
// Index starts at 1 -- always leave the first column visible (Issue 53620)
446446
for (int i = 1; i < getColumns().size(); i++)
447447
{
448448
DisplayColumn col = getColumns().get(i);
449-
onchange.append("document.getElementsByName('").append(col.getFormFieldName(ctx)).append("')[0].style.display = b ? 'none' : 'block';\n");
449+
// Issue 53620: instead of hiding the input, set it "disabled" via CSS (but not actually disabled so it will still submit)
450+
onchange.append("document.getElementsByName('").append(col.getFormFieldName(ctx)).append("')[0].style.opacity = b ? 0.6 : 1;\n");
451+
onchange.append("document.getElementsByName('").append(col.getFormFieldName(ctx)).append("')[0].style.pointerEvents = b ? 'none' : 'all';\n");
450452
}
451-
onchange.append("if (b) { ").append(groupName).append("Updated(); }");
453+
onchange.append("if (b) { ").append(groupName).append("Updated(); }\n");
452454
HttpView.currentPageConfig().addHandler(id, "change", onchange.toString());
453455
}
454456

luminex/src/org/labkey/luminex/query/NegativeBeadDisplayColumnGroup.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,15 @@ public void writeSameCheckboxCell(RenderContext ctx, HtmlWriter out)
5555
DisplayColumn col = getColumns().get(i);
5656
if (col.getColumnInfo() != null)
5757
{
58-
onChange.append("s = document.getElementsByName('")
59-
.append(col.getFormFieldName(ctx))
60-
.append("')[0].options.length;\n")
61-
.append("document.getElementsByName('")
62-
.append(col.getFormFieldName(ctx))
63-
.append("')[0].style.display = b || s == 0 ? 'none' : 'block';\n");
58+
// Issue 53620: instead of hiding the input, set it "disabled" via CSS (but not actually disabled so it will still submit)
59+
onChange.append("document.getElementsByName('").append(col.getFormFieldName(ctx)).append("')[0].style.opacity = b ? 0.6 : 1;\n");
60+
onChange.append("document.getElementsByName('").append(col.getFormFieldName(ctx)).append("')[0].style.pointerEvents = b ? 'none' : 'all';\n");
6461
}
6562
}
6663

6764
onChange.append(" if (b) { ")
6865
.append(inputName)
69-
.append("Updated(); }");
66+
.append("Updated(); }\n");
7067
HttpView.currentPageConfig().addHandler(id, "change", onChange.toString());
7168

7269
return ret;

luminex/test/src/org/labkey/test/tests/luminex/LuminexRTransformTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ public void uploadRun()
132132
// make sure the Standard checkboxes are checked
133133
checkCheckbox(Locator.name("_titrationRole_standard_Standard1"));
134134
checkCheckbox(Locator.name("titration_" + ANALYTE1 + "_Standard1"));
135-
checkCheckbox(Locator.name("titration_" + ANALYTE2 + "_Standard1"));
136-
checkCheckbox(Locator.name("titration_" + ANALYTE3 + "_Standard1"));
135+
checkCheckbox(Locator.name("titration_" + ANALYTE1 + "_Standard1CheckBox")); // Issue 53620: "Same" checkbox for standards
137136
// make sure that that QC Control checkbox is checked
138137
checkCheckbox(Locator.name("_titrationRole_qccontrol_Standard1"));
139138
// set LotNumber for the first analyte

0 commit comments

Comments
 (0)