tags:

views:

385

answers:

1

Hi,

I am using PopupPanel and Gwt Canvas for my project. Here when clicked on the canvas-drawing area the popuppanel appears. In my main class i have a private class which extends PopupPanel and this panel is then called in the onModuleLoad(). The code looks something like this:

Button b = new Button("Circle");
        b.addClickHandler(new ClickHandler(){
            @Override
            public void onClick(ClickEvent event) {
                DrawingArea d = new DrawingArea(40, 30);
                Circle c = new Circle(20, 15, 20);
                d.add(c);
                dragController.makeDraggable(d);
                dragController.setBehaviorDragStartSensitivity(1);
                boundaryPanel.add(d, 200, 200 );
                //Diagram dia = new Diagram(boundaryPanel);
               /* Shape s = new Shape(d);
                s.showOnDiagram(diagram);*/
                d.addClickHandler(new ClickHandler(){
                    @Override
                    public void onClick(ClickEvent event) {
                        System.out.println("ERD Circle");
                        Widget w = (Widget)event.getSource();
                        PopUpPanel pop = new PopUpPanel(w);
                        pop.setPopupPosition(w.getAbsoluteLeft() - 150, w.getAbsoluteTop());
                        pop.show();
                    }                   
                });
            }           
        });

Here PopUpPanel is the one that extends PopupPanel. Here the code for PopUpPanel:

private static class PopUpPanel extends PopupPanel{

    Button connect = new Button("Connect");
    Button delete = new Button("Delete");
    Button detail = new Button("Detail");

    public PopUpPanel(final Widget widget){
       super(true);
       VerticalPanel vp = new VerticalPanel();
       vp.add(connect);
       vp.add(delete);
       vp.add(detail);

       setWidget(vp);
    }
}

Now the problem i am facing is:

When i click on the canvas-drawing area PopupPanel appears together with an error. Here are the error details:

[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (Error): Invalid class string


 number: -2147221005
 description: Invalid class string


    at com.google.gwt.user.client.ui.impl.PopupImplIE6.onShow(Native Method)
    at com.google.gwt.user.client.ui.PopupPanel$ResizeAnimation.onInstantaneousRun(PopupPanel.java:257)
    at com.google.gwt.user.client.ui.PopupPanel$ResizeAnimation.setState(PopupPanel.java:180)
    at com.google.gwt.user.client.ui.PopupPanel.setState(PopupPanel.java:1189)
    at com.google.gwt.user.client.ui.PopupPanel.show(PopupPanel.java:794)
    at com.e.r.d.client.ERD1$4$1.onClick(ERD1.java:177)
    at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:54)
    at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:1)
    at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.fireEvent(HandlerManager.java:65)
    at com.google.gwt.event.shared.HandlerManager$HandlerRegistry.access$1(HandlerManager.java:53)
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:178)
    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:52)
    at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
    at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:90)
    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1320)
    at com.google.gwt.user.client.DOM.dispatchEventAndCatch(DOM.java:1299)
    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1262)

Any input would be of great help.

Thank you.

+1  A: 

I got it working. This happens due to missing Microsoft JScript registration. once i registered "regsvr32 jscript.dll" it is working fine. thanks.

sprasad12
Great you got it working :)
Igor Klimer