Closed shellscape closed 12 years ago
If we take CheckBox as an example, setting any of the following properties:
Will cause the CheckBox to render a span.
Would it be a big change to serialize the widget name to json, that would work for any conceivable scenario. Otherwise you'd have to handle both cases (data-ui-widget on the span or on the input element).
Original reporter confirms fixed with changes for 0.9.1.
asp:RadioButton and asp:CheckBox.
The server control is assigning the widget name to an attribute of the web server control:
targetControl.Attributes["data-ui-widget"] = Widget.WidgetName;
On the client the widget name is taken from the rendered element:
var element = $('#' + id), widgetName = element.attr('data-ui-widget');
This works in most cases except for the RadioButton and CheckBox server controls. The <asp:RadioButton> and <asp:CheckBox> will be rendered as <input id="xx" type="xx">xxx</input><label for="xxx" />. If you assign an attribute to these server controls it renders:
<span> <input id="xx" type="xx">xxx</input><label for="xxx" /></span>.
Herein lies the problem, the <span> is the guy getting the attribute and the client code assumes the attribute is on the <input> element.