On Monday, June 18, 2012 8:37:39 AM UTC+2, C Anthony Risinger wrote:
>
> On Sun, Jun 17, 2012 at 11:28 AM, Daniel Gonzalez <gonva...@gmail.com> 
> 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. 
>
> [...] 
>
> > What could be going on? 
>
> what Rob said is almost certainly what's happening, though i don't 
> think onModuleLoad() is causing issue: try removing `bootstrap.js` 
> from your `Portal.html` file ... this file is only used by the 
> translated/pyjs version, the native runtimes (ie. pyjd) simply 
> manipulate the DOM directly. 
>
> the cache files are not even used in the native runners -- the fact 
> that you are loading them means a pyjs instance is running where it 
> shouldn't be. 
>
> -- 
>
> C Anthony 
>

Thanks anthony

Just to clarify: the problems are in the browser, not in pyjamas desktop.
And yes, your hint was correct. Removing the public/Portal.html got rid of 
the issue (just removing the bootstrap.js line was not enough)
I am a bit worried that I will need that file in the future. Currently pyjs 
is doing a good job including my public/Portal.css in the generated 
output/Portal.html file, but I am not sure if other custom CSSs will be 
also included automatically. Besides, it could be that I need some custom 
javascript, so that the public/Portal.html file will be necessary.

In a related note, I have seen that pyjsbuild is cluttering the 
output/Portal.html file:

<script type="text/javascript" src="bootstrap.js"></script>
<iframe id="__pygwt_historyFrame" style="display:none;"></iframe>
<script type="text/javascript" src="bootstrap.js"></script>
<iframe id="__pygwt_historyFrame" style="display:none;"></iframe>
<script type="text/javascript" src="bootstrap.js"></script>
<iframe id="__pygwt_historyFrame" style="display:none;"></iframe>

This has no effect apart from slowing down the loading of my application. 
The only solution I have found is to delete the output/Portal,html file 
each time before calling pyjsbuild.

BR,
Daniel

Reply via email to