sclass HInputField { S id = aGlobalID(), name, text; bool useWebSocket = true; new MapSO params; // for tag !include #1028121 // setField + change() bool requiresWebSocket() { ret useWebSocket; } S html() { ret htextinput(name, text, paramsPlus(params, +id), oninput := !useWebSocket ? null : jsDollarVars([[ document.getElementById($valueID).innerHTML = this.value; if (typeof wsSend !== 'undefined') wsSend(JSON.stringify({sliderValue: {id: $id, value: this.value}})); ]]; } void onWebSocketJSON(Map map) { Map map2 = optCast Map(map.get("inputFieldText")), ret if null; S id = cast map2.get("id"); if (!eq(id, this.id)) ret; S text = cast map2.get("text"); setField(+text); } }