Non editable AdvEdit bug HTML5

Hi Bart,

Add a TTIWAdvEdit component to a farm.
Set its editable value to false;
Set is NonEditableAsLabel to true; { Default }

Set the server controller doc type to <!doctype html5>
Put a button on the form and set the onAsyncClick to set the test of the control to a new value.
Java script error occurs in all browsers.
There is no element named HTMLName to work with in this situation.

Solution for review IWTMSCtrls.pas

function TTIWAdvEdit.RenderAsync(
  AContext: TIWBaseHTMLComponentContext): TIWXMLTag;
begin
  if (not Editable) and NonEditableAsLabel then
    GGetWebApplicationThreadVar.CallBackResponse.AddJavaScriptToExecute('<![CDATA[document.getElementById("'
      + HTMLName + 'DIV").firstChild.innerHTML = "' + Text + '";]]>')

{ML!! added else }
  else
   begin
      if (not ReadOnly) then
        GGetWebApplicationThreadVar.CallBackResponse.AddJavaScriptToExecute('<![CDATA[document.getElementById("'
          + HTMLName + '").readOnly = false;]]>')
      else
        GGetWebApplicationThreadVar.CallBackResponse.AddJavaScriptToExecute('<![CDATA[document.getElementById("'
          + HTMLName + '").readOnly = true;]]>');

      if (Editable) and (Enabled) then
        GGetWebApplicationThreadVar.CallBackResponse.AddJavaScriptToExecute('<![CDATA[document.getElementById("'
          + HTMLName + '").disabled = false;]]>')
      else
        GGetWebApplicationThreadVar.CallBackResponse.AddJavaScriptToExecute('<![CDATA[document.getElementById("'
          + HTMLName + '").disabled = true;]]>');

      //Fixed: does not work when control is inside a hidden region
      //visibility is handled by the base class
    //  if (Visible) then
    //    GGetWebApplicationThreadVar.CallBackResponse.AddJavaScriptToExecute('<![CDATA[document.getElementById("'
    //      + HTMLName + 'DIV").style.visibility = "visible";]]>')
    //  else
    //    GGetWebApplicationThreadVar.CallBackResponse.AddJavaScriptToExecute('<![CDATA[document.getElementById("'
    //      + HTMLName + 'DIV").style.visibility = "hidden";]]>');
{ML!! added }
   end;
  GGetWebApplicationThreadVar.CallBackResponse.AddJavaScriptToExecute('<![CDATA[document.getElementById("'
    + HTMLName + 'DIV").style.top = "' + IntToStr(Top) + 'px";]]>');

  Result := inherited RenderAsync(AContext);
end;

Only fails with the Doc Type set.

Mike.

Hi Mike,


Thank you for your feedback.
This issue has now been fixed.
The update will be available with the next release of the TMS IW Component Pack.