Hi Daniel. 

I'm on my mobile, so my response will be short.

Welcome!

When you get the two versions, do you have a local server running that could be 
returning one of them? I think you're getting a pyjd instance and a pyjs 
instance.

I'm not at my computer now, but I think your "pyjd.setup" line is giving you 
one instance, and your "p.onModuleLoad()" is giving you the other.

HTH
Robert

Daniel Gonzalez <[email protected]> wrote:

>Hello there,
>
>This is my first post to this list, so I hope I do not break any rules 
>here. I am just testing pyjamas. I have started with the HelloWorld example 
>and slightly modified to get a feeling of how difficult it is to create 
>layouts with pyjamas. So far I am very satisfied.
>
>Nevertheless I have been hitting a very strange situation which I do not 
>know how to solve: my applicatio shows as expected when I run it with 
>pyjamas desktop, but it the browser the layout is duplicated. This means 
>that I see my layout twice, one instance below the other. I am not doing 
>anything special in my little application to have a double instance of my 
>layout. The first instance appears immediately, the second slightly later. 
>I am inclined to think that this has something to do with the cached html 
>in the output directory, since visually it correlates with the timing when 
>my apache logs and the chrome network inspector show me that the requests 
>of those cache files are performed. But I do not understand why this 
>happens, and what I can do to get rid of these problems.
>
>The examples which come with pyjamas do not show this wrong behaviour.
>
>Here is my code:
>
>import pyjd # this is dummy in pyjs.
>from pyjamas.ui.RootPanel import RootPanel
>from pyjamas.ui.HTML import HTML
>from pyjamas import Window
>
>VERSION = "AAAA"
>
>class Portal:
>
>    def onModuleLoad(self):
>        Window.enableScrolling(False)
>        Window.setMargin("0px")
>        version = HTML("Version:" + VERSION)
>        RootPanel().add(version)
>
>if __name__ == '__main__':
>    pyjd.setup("./public/Portal.html")
>    p = Portal()
>    p.onModuleLoad()
>    pyjd.run()
>
>What could be going on?
>
>Thanks and regards,
>
>Daniel Gonzalez

Reply via email to