possible bug ? - Forum

Forum Navigation
You need to log in to create posts and topics.

possible bug ?

Hi @luishp

When I use SetObjectStyle "cT1" "font-size" "10pt"  (cT1 is a container)

I receive this error :

TypeError: $App.NAB[objId].css is not a function
SetObjectStyle http://localhost/MeleeTournante_MS-Web/js/main.js:1
Tour1_pageenter http://localhost/MeleeTournante_MS-Web/js/main.js:3
Angular 5
<anonymous> http://localhost/MeleeTournante_MS-Web/js/main.js:1
Angular 9
GotoPageNum http://localhost/MeleeTournante_MS-Web/js/main.js:1
GotoPage http://localhost/MeleeTournante_MS-Web/js/main.js:1
pbT1_click http://localhost/MeleeTournante_MS-Web/js/main.js:3
Angular 5
jQuery 8
Angular 28
jQuery 13
angular.min.js:129:202

 

@phil78 whenever you find a problem like that one please try to isolate it:

  1. Create a new app
  2. Add a Container object
  3. Add a Button object
  4. Add this code to the Button "click" event:
SetObjectStyle "Container1" "font-size" "10pt"

Works. So it's not a bug but something related to your own app.

I agree with this and have worked around the problem, but I can't understand why this type of expression is context-dependent. In the same way, I had a crash with a the code MoveObject  “cDureeRestant” -110 130 which is used on 5 pages in exit and which went into error without me understanding why on the first page even though it had been working for 2 years. I commented the line and compiled it was ok, then I uncommented and recompiled without getting the error.

@phil78 the only way to know what's happening in your applicacion is to take a look carefully to any error messages and/or use the included tools to watch them.

1) Try, Catch commands.
2) neoConsole Plugin.
3) Web Browser Console (F12)

In the specific case you comment, probably the object doesn't exist yet at the moment of trying to move it. But it's impossible to say without more information.