This is Water version 11.0.0.2627, with Mercury, trying out the Wasm with Code Behind template.
Are some HTML elements not supported?
I tried adding an input type text to the index.html file, but the code behind doesn’t let me access its attributes.
Maybe I’m wrong, but it seems to recognize the input, it just doesn’t know about the “value” attribute. (I’ve also tried “innerHTML” and “innerText” and “class”.)
In case it is relevant, I’ve attached my test project.
Just experimenting, so certainly not an emergency.
Protected Dim WithEvents foo As HTMLInputElement = TryCast(document.getElementById("foo"), HTMLInputElement)
so rthatsa correct; the problem is that this has no significant properties defined…
'''<summary>The HTMLInputElement interface provides special properties and methods for manipulating the options, layout, and presentation of <input> elements.</summary>
<DynamicInterface(GetType(EcmaScriptObject))>
Public Interface [HTMLInputElement]
'''<summary>on: the browser can autocomplete the value using previously stored value</summary>
Property [on] As Dynamic
End Interface
I’ll check if that’s correct or if it should have more… these were auto-generated form the DOM docs.
Ah, the problem seems to be that the properties on an ` element change depending in its type… e.g. HTML DOM Input Button Object
I’ll have to see if and how we can support this… for now, you will have to downcast it to Dynamic and access the properties you expect dynamically at runtime, without string type checking :(.
this works
(foo1 as dynamic).multiple := true;
(foo1 as dynamic).value := "test";
Protected Dim WithEvents foo1 As HtmlInputEmailElement = TryCast(document.getElementById("foo1"), HtmlInputEmailElement)
Protected Dim WithEvents foo2 As HtmlInputTextElement = TryCast(document.getElementById("foo2"), HtmlInputTextElement)