WebLabel needs major fix

So today, I fought with WebLabel to simply make it appear. I have one on a container that is created dynamically and embedded onto another container. The ones that are created initially by the app do not appear, while ones that are created later do appear. Debugging in the browser to get to the bottom of it, I notice that the invisible ones have height of 0, while the visible ones have expected height proportional to their initial style. This is just part of a whole can of problems associated with multiline = false for WebLabels…

Another problem… set the style of a single line WebLabel to something larger at runtime, it gets chopped to fit vertically into the original line height.

This got me searching because I’m gonna have to implement my own label that doesn’t suck. Nobody vertically centers text like WE does anymore. They use display: table-cell; vertical-align: center. IE9 and later, as well as the rest of browsers support it. Why are we still living in 2012 with an ugly vertical alignment hack that goes horribly wrong in all but textbook examples? References:

http://stackoverflow.com/a/7617018

http://www.w3schools.com/cssref/pr_class_display.asp

In general, I wonder more and more if the best solution is to use only the WebSDK.

JS debugging is a pain. All commands get sent in one go. You cannot step through each line :frowning: that makes working with the SDK tough, imho.

For debugging purposes, add your client side code to a js file that gets downloaded in the HTMLHeader (but only during debugging). that you can put breakpoints on in safari and chrome.

Thank you Greg, good idea. But the code is often mixed with Xojo code (variables …), in several methods, etc… In practice, this is difficult.

Sometimes I deliberately causes a javascript error, so that the framework displays the stack of javascript commands in the browser. But it is not complete nor practical.

In browser,It would be really great if we could have the possibility (in debug mode) to download all the javascript (the one in memory). Able to read clearly all our javascript code of the webPage would be greatly appreciated.

Go look in the beta notes for 2014r2. There’s a new mechanism for delivering javascript for WebControlWrappers. If you’re a beta tester, go check out https://forum.xojo.com/12787-webcontrolwrapper-htmlheader for more information.