Client freezes when using widgetset

Hi - I have a problem where the client-side application running in the web browser client freezes (stops responding to input) when I attempt to use a widgetset. Once the client app has frozen, none of the tabs respond to mouse clicks and a blank empty tab is displayed.

The application consists of three Tabs in a TabSheet. The first tab has a search results list (Table) of people. On the second tab is a data form to edit one person and on the third tab is a chart from the VaadinVisualizations add-on that just displays some static data and is not integrated with anything else.

When I include the widgetset by uncommenting the following in the web.xml the chart works but the data form doesn’t

    <init-param>
        <param-name>widgetset</param-name>
        <param-value>my.example.MyExampleWidgetSet</param-value>
    </init-param>

When I comment out the widgetset parameter the data form works but the chart doesn’t (which is understandable).

There aren’t any exceptions in the server log and I’ve tried switching on Firebug console logging from within the browser but nothing appears there (but I’ve also not really used Firebug much either).

I’ve tried building a separate test application consisting of Tabs, Charts and Forms but it seems to work okay.

Can anyone suggest how I might go about investigating this problem please?

I’ve done some more work on this issue but I’m still not able to solve it. I found the built-in support for a Vaadin debug window with ?debug on the end of the URL and that threw up the following error;

com.google.gwt.core.client.JavaScriptException: (TypeError): c.getBoxObjectFor is not a function stack: os([object HTMLHtmlElement]
,[object HTMLDivElement]
)
@http://localhost:8080/MyVaadinWebApp/VAADIN/widgetsets/my.example.MyExampleWidgetSet/7350D5D21DAC21FEA13F9735B3C88E43.cache.html:4127 ns([object HTMLDivElement]
)
@http://localhost:8080/MyVaadinWebApp/VAADIN/widgetsets/my.example.MyExampleWidgetSet/7350D5D21DAC21FEA13F9735B3C88E43.cache.html:2308 Fsb([object HTMLDivElement]
)

…but that doesn’t mean anything to me.

Also by a process of elimination I was able to isolate the issue occurring to the following bit of code. If I uncomment the lines that add an empty Panel() to the HorizontalLayout and the widgetset is being used from the web.xml file then the problem occurs.


    public HorizontalLayout getAddressPanel() {
        if (addressPanel == null) {
            addressPanel = new HorizontalLayout();
            //addressPanel.setSpacing(true);

            //Label label = new Label("Hello there");
            //addressPanel.addComponent(label);

            Panel p1 = new Panel();
            //Panel p2 = new Panel();

            //p1.setCaption("Physical Address");
            //p2.setCaption("Postal Address");
            //p1.addComponent(getPhysicalAddressForm());
            //p2.addComponent(getPostalAddressForm());

// Problem occurs if p1 is added to addressPanel
            addressPanel.addComponent(p1);
            //addressPanel.addComponent(p2);
        }
        return addressPanel;
    }

But then I’m also not able to replicate the problem in a different smaller test webapp away from the main application so there’s probably something else going on.

I’m a bit stuck on this and any help would be appreciated :slight_smile:

Client-side freezing sounds like a very unusual problem. How has it frozen, is the indicator rolling in the upper-right corner of the page? If it is, the problem is probably server-side.

It doesn’t really make sense why your example code doesn’t work, so the problem must be somewhere else.

You could try hitting “analyze layouts” in the debug window. Well, if the app is completely (?) frozen, that could be hard.

As generic instructions, check that the widget set is properly compiled and to the proper folder (under VAADIN/widgetsets), and that it’s loaded properly (with Firebug). Also check with Firebug that themes are loaded properly. Stop server, clean up server, refresh project, start again.

I have seen this sometimes and usually it means that your widgetset is compiled only for a given browser (user.agent) and you are using another browser. For instance compiling the widgetset for “gecko” which is Firefox1.0 and earlier and trying to run it in Firefox 3.6 will cause this error (you should use “gecko1_8”).

Yes - that solved it!

The user.agent was set to value=“gecko” and when I comment out that line it works. It also works, or doesn’t work in the separate test application as well.

The reason I was using gecko though was because of the documentation in example/template .gwt.xml file that I got when I used the Maven create archetype to create the project that says Gecko is the right value for Firefox 3.


     The value gecko is used for Firefox 3 and later, gecko1_8 is for
     Firefox 2 and safari is used for  webkit based browsers including
     Google Chrome.
    -->
    <!--<set-property name="user.agent" value="gecko"/>--> 

It looks like the source code templates for the maven archetypes need to be updated because gecko is not the right value for Firefox 3.

  • Richard.