Commit 31cb68eb by Leonard Ambros II

Merge branch 'FEATURE-WG-388' into 'development'

resolution on WG-388 See merge request !60
parents 55e0429a 30350162
......@@ -484,7 +484,11 @@ const inputChecklist = (key, validation) => {
if (index == 0) {
checkbox.classList.add("checkboxFirst");
checkbox.setAttribute('id', `${key}`);
<<<<<<< WebGde/WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
}
=======
}
>>>>>>> WebGde/WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
div.appendChild(checkbox);
var label = document.createTextNode(item);
......@@ -558,6 +562,7 @@ const inputRadiolist = (key, validation) => {
dropdown1.classList.add('dropdown');
var dropdownContent = document.createElement('div');
dropdownContent.classList.add('dropdown-content');
dropdownContent.setAttribute('id',`dropdownContainer_${key}`);
dropdown1.appendChild(dropdownContent);
var isOther = false;
......@@ -573,11 +578,20 @@ const inputRadiolist = (key, validation) => {
radio.type = 'radio';
radio.name = `radioChoices_${key}`;
radio.classList.add("radioOption");
<<<<<<< WebGde/WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
radio.name = `radioChoices_${key}`;
=======
>>>>>>> WebGde/WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
radio.value = item;
if (index == 0) {
radio.classList.add('radioFirst');
radio.setAttribute('id', `${key}`);
}
<<<<<<< WebGde/WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
=======
>>>>>>> WebGde/WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
var label = document.createTextNode(item);
radioDiv.appendChild(radio);
radioDiv.appendChild(label);
......@@ -616,10 +630,11 @@ const inputRadiolist = (key, validation) => {
}
});
inputTextBox.addEventListener("input", event => {
inputTextBox.addEventListener('change', event => {
if (dependentRadio.checked) {
dependentRadio.value = event.target.value;
}
});
}
......@@ -1178,13 +1193,56 @@ export async function populateFields(imagePath) {
if (field == "fields") {
let fieldsobj = currForm[field];
//console.log(fieldsobj);
for (let [k, v] of Object.entries(fieldsobj)) {
for (let key of Object.keys(schema[doctype][section])) {
if (schema[doctype][section][key].aka == "field" + k) {
console.log("key = " + key);
console.log("validation: " + schema[doctype][section][key].validation.collection);
fields["field" + k] = v;
var fieldId = schema[doctype][section][key].fieldLabel;
var currId = fieldId.replace(" ", "_")
document.getElementById(currId).value = v;
//var fieldId = schema[doctype][section][key].fieldLabel;
//var currId = fieldId.replaceAll(" ", "_");
//console.log(fieldId);
//console.log(currId);
console.log(v);
//document.getElementById(currId).value = v;
if(schema[doctype][section][key].validation.collection === 'radiolist'){
console.log("RADIOLIST");
//retrieve the radio button value from the XML
const radioButton = document.querySelector(`input[value="${v}"]`);
if(radioButton){
radioButton.checked = true;
} else {
//const radOther1 = document.querySelector(`#radiochoices_${key} input[value="other"]`);
const radOther1 = document.querySelector(`#dropdownContainer_${key} input[value="other"]`);
if(radOther1){
radOther1.checked = true;
}
//const radOther2 = document.querySelector(`#radiochoices_${key} input[value="others"]`);
const radOther2 = document.querySelector(`#dropdownContainer_${key} input[value="others"]`);
if(radOther2){
radOther2.checked = true;
}
document.getElementById(`dependentTB_${key}`).value = v;
document.getElementById(`dependentTB_${key}`).style.display = 'inline-block'
}
} else{
document.getElementById(key).value = v;
}
continue;
}
}
}
......
......@@ -8,7 +8,7 @@ export const HIGH_LIGHT_SCHEMA = "./WebGde-Widgets/sample_schema/dbSchema_anno.
export const ROOT_FOLDER = "/WebGde-Widgets";
//this determines if the images will be retrieved from the gfs
const IP = "54.211.251.251"
const IP = "54.175.136.51"
const GDE_CONTEXTROOT = "WebGde-v121-b1"
export const DOMAIN = `http://${IP}:8080`
export const CONTEXTROOT = "gfs-explorer-ws"
......
......@@ -35,8 +35,8 @@
"aka" : "field5",
"validation" : {
"fieldLength" : 1.0,
"collection" : "dropdown",
"options" : [ "M", "F" ],
"collection" : "radiolist",
"items" : [ "M", "F", "others" ],
"mandatory" : true
}
},
......@@ -73,7 +73,7 @@
"validation" : {
"fieldLength" : 20.0,
"collection" : "radiolist",
"items" : [ "Emergency Room", "Inpatient", "Outpatient", "others" ],
"items" : [ "Emergency Room", "Inpatient", "Outpatient", "other" ],
"mandatory" : true
}
},
......@@ -83,7 +83,7 @@
"validation" : {
"fieldLength" : 7.0,
"collection" : "radiolist",
"items" : [ "Pay", "Service" ],
"items" : [ "Pay", "Service", "other" ],
"mandatory" : true
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment