Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

SmartGWT-Mobile - Runtime Error

$
0
0
1. I am running http://www.smartclient.com/builds/SmartGWT.mobile/1.0d/LGPL/2014-03-07

2. Chrome Browser Version 33.0.1750.154 m & Firefox 26
GWT Version 2.6.0

3 & 4. Not a server-side problem

5. Error messages

Code:

        [ERROR] [helloworld] - Errors in 'jar:file:/C:/Users/helloworld/Documents/My%20Software/smartgwt-mobile-1.0/smartgwt-mobile.jar!/com/smartgwt/mobile/client/SmartGwtMobileEntryPoint.java'
                [ERROR] [helloworld] - Line 118: Referencing method 'com.google.gwt.user.client.DOM.getEventListener(Lcom/google/gwt/user/client/Element;)': unable to resolve method
        [ERROR] [helloworld] - Unable to find type 'com.smartgwt.mobile.client.SmartGwtMobileEntryPoint'
                [ERROR] [helloworld] - Hint: Previous compiler errors may have made this type unavailable
                [ERROR] [helloworld] - Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
        [ERROR] [helloworld] - Errors in 'jar:file:/C:/Users/helloworld/Documents/My%20Software/smartgwt-mobile-1.0/smartgwt-mobile.jar!/com/smartgwt/mobile/client/widgets/Canvas.java'
                [ERROR] [helloworld] - Line 122: Referencing field 'com.google.gwt.user.client.impl.DOMImplStandard.dispatchCapturedEvent': unable to resolve field
                [ERROR] [helloworld] - Line 123: Referencing field 'com.google.gwt.user.client.impl.DOMImplStandard.dispatchCapturedEvent': unable to resolve field
                [ERROR] [helloworld] - Line 125: Referencing field 'com.google.gwt.user.client.impl.DOMImplStandard.dispatchCapturedEvent': unable to resolve field
                [WARN] [helloworld] - Line 133: Referencing deprecated field 'com.google.gwt.user.client.impl.DOMImplStandard.dispatchEvent'
                [WARN] [helloworld] - Line 134: Referencing deprecated field 'com.google.gwt.user.client.impl.DOMImplStandard.dispatchEvent'

6. sample code if applicable

Code:

package com.helloworld.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.smartgwt.mobile.client.widgets.Button;
import com.smartgwt.mobile.client.widgets.Dialog;
import com.smartgwt.mobile.client.widgets.Panel;
import com.smartgwt.mobile.client.widgets.ScrollablePanel;
import com.smartgwt.mobile.client.widgets.events.ClickEvent;
import com.smartgwt.mobile.client.widgets.events.ClickHandler;
import com.smartgwt.mobile.client.widgets.layout.NavStack;
import com.smartgwt.mobile.client.widgets.toolbar.ToolStrip;
import com.smartgwt.mobile.client.widgets.toolbar.ToolStripButton;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class HelloWorld implements EntryPoint {
    // handles application pages history and transitions
    private NavStack navigationStack;

    /**
    * This is the entry point method.
    */
    public void onModuleLoad() {
        navigationStack = new NavStack(getColorsView());
        RootLayoutPanel.get().add(navigationStack);
    }

    public Panel getColorsView() {
        Panel panel = new ScrollablePanel("Colors");
        String[] colors = new String[]{ "blue", "red", "yellow", "green", "gray", "white", "black", "pink", "brown" };
        for (int i = 0; i < 50; i++) {
            String color = colors[(int) (Math.random() * colors.length)];
            Button button = new Button(color);
            button.setTintColor(color);
            button.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    navigationStack.push(getSportsView(((Button)event.getSource()).getTitle()));
                }
            });
            panel.addMember(button);
        }
        return panel;
    }

    public Panel getSportsView(String color) {
        Panel panel = new ScrollablePanel("Sports");
        String[] sports = new String[]{ "Baseball", "Basketball", "Football", "Hockey", "Volleyball" };
        for (int i = 0; i < 20; i++) {
            String sport = sports[(int) (Math.random() * sports.length)];
            ToolStripButton button = new ToolStripButton(sport);
            button.setInheritTint(true);
            button.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    String sportName = ((ToolStripButton)event.getSource()).getTitle();
                    Dialog dialog = new Dialog("Do you like " + sportName + "?");
                    dialog.setButtons(Dialog.YES, Dialog.NO);
                    dialog.show();
                }
            });
            ToolStrip toolbar = new ToolStrip();
            toolbar.setTintColor(color);
            toolbar.addMember(button);
            panel.addMember(toolbar);
        }
        return panel;
    }
}

Posts with incomplete information are much more likely to be ignored.

Viewing all articles
Browse latest Browse all 4756

Trending Articles