Weblabels not showing when browser is Firefox and Webapp in iFrame

Only on Firefox (OSX Version 41.0.2) and only when the Webapp is called within an iFrame, then Weblabels are not shown at startup.

Weblabels do show up when the webapp is called alone, that is : not in an iFrame.
They also show up, when I click Next and then Back to the previous panel.

I have tried workarounds like described here, without success:
https://forum.xojo.com/20132-xojo-2015-r1-weblabel-in-dialog-no-display

I have a SetLanguage method where the labels are localized. It works on Safari and on all browsers on Windows (as far as I can see), but not correctly with OSX Firefox.

Has anybody seen such a thing and found a workaround?

Form, as seen on OSX Firefox after startup:

Form after user clicked Next and then Back to this screen:

Maybe the same workaround as what works on WebDialogs for me : use a WebLabel. The main inconvenient is that you won’t be able to webstyle the text attributes and will have to do that in Paint. But background color and borders work just fine. For what you posted, it should do.

Thanks Michael! Unfortunately I do not yet understand what you meant with “Use a WebLabel”, because that is what I am using. Could you elaborate on this?

Sorry. Lapsus. I meant “Use a WebCanvas”.

Oh, I see …

This is one of these piffed moments.

How many times have I seen that in the past years? You know: one spends many hours on implementing something based on the IDE built-in functionality, only to find out that it is working ALMOST. Which is good for nothing.

Then you have to start from scratch and write replacement code, custom controls etc. In this case a canvas based version of a weblabel. This is so NOT COOL.

Don’t be just a “Pienze” (whiner?). That’s the joy of developing software. :slight_smile:

[quote=224411:@Oliver Osswald]Oh, I see …

This is one of these piffed moments.

How many times have I seen that in the past years? You know: one spends many hours on implementing something based on the IDE built-in functionality, only to find out that it is working ALMOST. Which is good for nothing.

Then you have to start from scratch and write replacement code, custom controls etc. In this case a canvas based version of a weblabel. This is so NOT COOL.[/quote]

The WebLabel flakiness is indeed annoying. Between unreliable in WebDialogs and now in iFrame, that is strange of a rather banal HTML control.

Have you tried looking at the DOM with the browser developer tools ? If for some reason the text is not present, a rather simple JavaScript could probably remedy that.

You may want to try that :

Sub Shown() dim js as string js = js + "var mylabel= document.getElementById('"+Me.ControlID+"');" js = js + "var myp= mylabel.getElementsByTagName('p');" js = js + "myp[0].innerHTML='"+Me.Text+"';" self.ExecuteJavaScript(js) End Sub

Hopefully the show event fires in the WebLabel.

C’mon guys - railing is just how men celebrate the bravery to take all this :wink:

@Michel Bujardet : A quick first try of your JavaScript did not help so far, but I still have to investigate further. Thank you Michel, your help is great and very appreciated! You must be some kind of code-bodhisattva :slight_smile:

I just discovered a workaround which seems really weird to me: set the WebLabel to Multiline and it shows up on startup also in a Firefox browser!

Another way to ensure Weblabels will display at startup, even in an iFrame, which is working for me:

In the WebPage1.Shown Event Handler I first set the .visibility of all Weblabels to False, do some other initialisation and then set .visibility back to True.

[quote=224456:@Oliver Osswald]C’mon guys - railing is just how men celebrate the bravery to take all this :wink:

@Michel Bujardet : Thank you Michel, your help is great and very appreciated! You must be some kind of code-bodhisattva :)[/quote]

Having been a practicing buddhist since age 17 (when it had not become yet fashionable) I am very honored, but it will probably take a while before I attain that stage, even with Mahayana :wink:

That is exactly the workaround used for missing WebLabels on WebDialogs.

BTW I just tried to reproduce the issue displaying a web app locally within an iFrame in FireFox 41.02 on Mac, and sure enough, WebLabels display very nicely… Like a TV working just fine at the repair shop…