Closed stefvanbuuren closed 7 months ago
Possibly related to #6
Problem identified. In start.js
line 166, we have
if (output.agegrp !== "1-21y") {
document.forms.agegrp_dsc[output.agegrp].checked = true;
}
The test always evaluated to true
because output.agegrp
is an array, and the next line then errors.
Repair by comparing to the first element
if (output.agegrp[0] !== "1-21y") {
document.forms.agegrp_dsc[output.agegrp[0]].checked = true;
}
Note: This change should be done everywhere where output.{xxx}
is compared using the strict !==
operator.
The following now runs:
# "Initialization >4Y" bug in JAMES 1.5.9
# Solved in JAMES 1.5.10 (12 April 2024)
library(jamesclient)
library(httr)
library(jsonlite)
host <- "https://james.groeidiagrammen.nl"
fn <- system.file("extdata", "bds_v3.0", "terneuzen", "T_1017.json",
package = "jamesdemodata", mustWork = TRUE)
r <- james_post(host = host, path = "/blend/request/json", sitehost = host, txt = fn)
browseURL(r$parsed$site)
In JAMES 1.5.9, the following request does not correctly initialize the UI and deactivate the radiobuttons. It happens for all children with a measurement > 4 years.
Created on 2024-04-12 with reprex v2.1.0