Why in code are removeAttribute maxLength and size?
Hello, I trying parsing forms generated in other software but I have some problems with some custom attributes. I have that code:
<xf:input
_bind="ID11"
ref="wnio:ID11" xxforms:size="10">
<xf:label>
<span/>
</xf:label>
</xf:input>
or
<xf:textarea
_bind="ID27"
ref="wnio:ID27"
xxforms:cols="107" xxforms:rows="3">
<xf:label>
<span/>
</xf:label>
</xf:textarea>
and namespace:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
And attributes with xxforms:size xxforms:cols or xxforms:rows are not parsed, so fields havent proper size. How to do it right way? Currently i have removed "xxforms" namespaces so in textarea case it works like a charm, but for input[type=text] attribue "size" was removed by JavaScript. There are lines
var max = type.getMaxLength();
if (max) {
input.maxLength = max;
} else {
input.removeAttribute("maxLength");
}
var length = type.getDisplayLength();
if (length) {
input.size = length;
} else {
input.removeAttribute("size");
}
Why do you remove that attributes? Why not only set size/maxlength when necessary?
Greetings
Hello, With XSLTForms, XForms controls are driven by data types which can be defined by a schema or binds. This allows a versatile approach where the same input can be rendered very differently depending on current data type.
Orbeon has its own extensions which can be set using the xxforms namespace. I'm afraid that allowing formatting attributes directly at control level is a pragmatic approach but not a restrictive one...