WtDesigner icon indicating copy to clipboard operation
WtDesigner copied to clipboard

JavaScript Error

Open pirx08 opened this issue 7 years ago • 8 comments

Hi Juan,

First of all, thanks for all your precious work on this great tool. I am a colleague of @cls-nebadje and am about to continue our current Wt project. For this I have built the WtDesigner on my Ubuntu-16.04 according to #3, i.e.:

  • manually built & installed Wt 3.3.5-rc2
  • manually built WtDesigner (tried both master and develop-uli-less-warnings branches)

Unfortunately I am running into at least one recurring error which I can't seem to get rid of. It is easily reproducible:

  1. start WtDesigner (opening default dummy project)
  2. select wt_root
  3. add a new WSlider
  4. select slider
  5. change slider's maximum value to 100 (or any other number >10)

I then get a JavaScript Alert: Wt internal error; code: undefined, description: Unexpected number '3' and the WtDesigner log shows the following verbose error message: wtDesigner.javascript.err.txt After this trying to save the project naturally fails. Do you have any idea what might be causing this error? Where should I be looking for the culprit? I would greatly appreciate any hints.

Cheers, Rolf

pirx08 avatar Feb 08 '17 14:02 pirx08

Hi Rolf,

I will try to take a look at it this weekend, but in the meanwhile, I would take a closer look to your compilation process, because I quickly tried to reproduce the issue using the latest Windows distribution of WtDesigner and I don´t get any problem:

not_issue

juangburgos avatar Feb 08 '17 15:02 juangburgos

Hi Juan, Thanks for looking into it if you find the time. I'll be searching on my compilation process and scanning through the sources for anything suspicious. Another thing I noticed: if I attempt to change the slider's styleClass to vertical orientation (Wt-slider-v), the widget is displayed rather strangely and if I then refresh the whole project the styleClass suddenly contains Wt-slider-v Wt-slider-h. Does this happen on your WtDesigner too? Maybe this hints to my other slider-issue above. Cheers, Rolf

pirx08 avatar Feb 09 '17 15:02 pirx08

Hi Juan, sorry, I just realized that the slider orientation should be set with WSlider::setOrientation rather than with the styleClass, so this is a different story which includes adding an interface to WSlider's orientation/setOrientation and making sure that the styleClass doesn't contain ambivalent Wt-slider-[vh] due to Wt/PaintedSlider. As to my issue above (maximum value): I'm still searching...

pirx08 avatar Feb 09 '17 18:02 pirx08

Hi,

Were you able to reproduce the issue with the precompiled linux version?

juangburgos avatar Feb 10 '17 15:02 juangburgos

Unfortunately no, since my Ubuntu is running on 32-bit arch:

:~$ arch
i686

Is that a problem when building manually from sources?

pirx08 avatar Feb 10 '17 16:02 pirx08

I am sorry, I was not able to reproduce the error. But since it says it is a javascript error, makes me think that maybe it is related to the resources used in a WtDesigner project. Have you tried overwriting your with the ones from the source code of this project? See if that helps?

juangburgos avatar Feb 12 '17 20:02 juangburgos

Thanks for the tip. Although I've been using the resources from your above mentioned source code all along, I tried overwriting the resources (also from newer wt versions). Unfortunately it doesn't help. I keep on getting Java Script errors when setting Slider maximum to ≠10. My current workaround is to leave it at 10, which at least allows me to save the <project>.wui & ui_<project>.h and then change the range manually within the app. Maybe this will be resolved once we migrate to other wt versions. On the plus side I was now able to review your great WtDesigner code, so maybe I can contribute more in the future. I have added an interface for Slider's orientation & tickPosition, in case you're interested in this patch. Cheers, Rolf

pirx08 avatar Feb 15 '17 08:02 pirx08

Sorry I couldn´t be more helpful. And sure, any contribution is well received, please sent a pull request! Best, J.

juangburgos avatar Feb 15 '17 09:02 juangburgos