TWebBitBtn ElementClassName Issue

Hi,

Not sure when this stopped working but setting TWebBitBtn.ElementClassName to btn btn-primary no longer works.

Thanks,

Ken

Thanks for reporting.
We have seen the regression and we're working to have this fixed in v1.3.3.0

Timeframe please?

Next week

After upgrading to 1.3.3.0 I am now getting runtime error detailed below which was not happening before. It is very difficult to work with continual problems every time a new version comes out.

TypeError: right-hand side of 'in' should be an object, got undefined

Please provide more details about this error.

With just this error message, I cannot say anything useful to help you.
It does not get as far as any of my code so impossible to debug.

    GetElementBindHandle http://localhost:8000/Bridge/Bridge.js:16400
    UnbindEvents http://localhost:8000/Bridge/Bridge.js:9304
    UnbindEvents http://localhost:8000/Bridge/Bridge.js:16154
    Destroy http://localhost:8000/Bridge/Bridge.js:9814
    Destroy http://localhost:8000/Bridge/Bridge.js:16539
    $create http://localhost:8000/Bridge/Bridge.js:302
    DoStatusCreate http://localhost:8000/Bridge/Bridge.js:17153

The problem is with Optimization again. If it is turned off it runs fine.

When you look in the developer console, don't you have more info/details/context so we can try to pinpoint this one?

Nothing other than what I have alreadyprovided.

With just
"TypeError: right-hand side of 'in' should be an object, got undefined"
I cannot do anything useful. 
I would expect the console can point you to the code line from where this error comes, so please provide either a sample source project with which we can reproduce this or more details on the line of code causing the issue.

It is this javascript that is generated that is causing the problem:

this.GetElementBindHandle = function () {
      var Result = null;
      if (4 in this.FComponentState) {
        Result = window;
        return Result;
      };

When optimization is turned on the javascript is this:

  this.GetElementBindHandle = function () {
      var Result = null;
      if (pas.Classes.TComponentStateItem.csDesigning in this.FComponentState) {
        Result = window;
        return Result;
      };
I don't know what line in my code this is generated from.

This must come from

function TCustomForm.GetElementBindHandle: TJSEventTarget;
in WEBLib.Forms.pas
but I cannot see the same code being generated here.
Are you 100% sure you use the pas2js compiler that we include in TMS WEB Core and don't use an other/older/newer version?
Please verify that ALL old version files are removed and that you do not install any pas2js custom builds retrieved from somewhere else.

Absolutely sure! I always do a complete manual uninstallation before installing a new version.

Then I cannot see why you experience this.
Do you see this with any of our demos?
I would need a sample source app with which I can reproduce this here.

For the 2nd block of code I said "When optimization is turned on the javascript is this:" it should have read turned off.

I understood that correct.
I see similar code here in both cases, yet, there is NO error when running.
Therefore, 1) please compare with our demos  2) provide a sample source app with which we can reproduce this.

Using Chrome instead of Fiefox I get a bit more information:

WEBLib.Forms.pas:1380 Uncaught TypeError: Cannot use 'in' operator to search for '4' in undefined
    at Object.GetElementBindHandle (WEBLib.Forms.pas:1380)
    at Object.UnbindEvents (WEBLib.Controls.pas:3619)
    at Object.UnbindEvents (WEBLib.Forms.pas:1251)
    at Object.Destroy (WEBLib.Controls.pas:1750)
    at Object.Destroy (WEBLib.Forms.pas:1841)
    at Object.c.$create (rtl.js:297)
    at XMLHttpRequest.DoStatusCreate (WEBLib.Forms.pas:2063)
GetElementBindHandle @ WEBLib.Forms.pas:1380
UnbindEvents @ WEBLib.Controls.pas:3619
UnbindEvents @ WEBLib.Forms.pas:1251
Destroy @ WEBLib.Controls.pas:1750
Destroy @ WEBLib.Forms.pas:1841
c.$create @ rtl.js:297
DoStatusCreate @ WEBLib.Forms.pas:2063
load (async)
CreateForm$2 @ WEBLib.Forms.pas:2112
CreateForm @ WEBLib.Forms.pas:2250
$mod.$main @ Bridge.dpr:17
doRun @ rtl.js:141
run @ rtl.js:156
(anonymous) @ index.html:50

  1. please compare with our demos  
    2) provide a sample source app with which we can reproduce this