I suspect the call that creates the chart is in your presenter. After you
add the widget, you should call it.

Best regards,

Alfredo

On Tue, Feb 21, 2012 at 1:43 AM, Nitheesh Chandran <
[email protected]> wrote:

> Yeah that helped me to display the DialogBox when the user clicks on
> the cell. i have used like this
>
> db.setWidget(new LineView());
>
> Now the DialogBox is displaying but i am creating a chart in the
> LineView() with database records. That chart is not coming. But when i
> simply use by passing a token like this in the AppController (not
> using any click event ,just passing the token "chart" )  ,it works
>
>  if (token.equals("chart")) {
>                                presenter = new
> ChartGenericPresenter(rpcService,eventBus,new
> LineView());
>
>   If i use the above code. The chart will come in the DialogBox. But
> unfortunately i want to display the chart depending on the user event.
> So like you said i used  db.setWidget(new LineView());
>
> And now DialogBox is showing but no chart inside
>
>
>
>
> On Feb 21, 11:16 am, Alfredo Quiroga-Villamil <[email protected]>
> wrote:
> > It seems as if the call:
> >
> > *db.setWidget((IsWidget) new
> ChartGenericPresenter(rpcService,eventBus,new
> > LineView()));*
> >
> > is not accurate. You are passing to a DialogBox, which is ultimately
> > extending SimplePanel, a presenter and not a widget. The flow would be
> more
> > or less as follows:
> >
> > 1. Instantiate the view.
> > 2. Instantiate your presenter.
> > 3. Set the presenter on your view.
> > 4. Add the view to your widget (DialogBox) in this case.
> >
> > Regards,
> >
> > Alfredo
> >
> > On Tue, Feb 21, 2012 at 12:09 AM, Nitheesh Chandran <
> >
> >
> >
> >
> >
> >
> >
> > [email protected]> wrote:
> > > Hello ,
> >
> > > I am working on a MVP project. I want to generate an event when the
> > > user clicks on the FlexTable cell. So using the MVP pattern i have
> > > created a event class and its corresponding handler interface in the
> > > event package. And the following way i fired the event. I want anyone
> > > of you to tell me is this the correct way of generating events and i
> > > am getting exceptions when i am implementing some "what to do" code on
> > > the successful event generation
> >
> > >  The code below shows the event firing when the user clicks on the
> > > cell of the FlexTable
> >
> > >    table.addTableListener(new TableListener() {
> >
> > >                        @Override
> > >                        public void onCellClicked(SourcesTableEvents
> > > sender, int row, int
> > > cell) {
> >
> > >                                eventBus.fireEvent(new ChartEvent());
> >
> > >                                        }
> >
> > >                        });
> >
> > >   Suppose i want to generate a chart when the user clicks on the
> > > cell ,i would be writing the code for that like this
> >
> > >                       eventBus.addHandler(ChartEvent.TYPE, new
> > > ChartEventHandler() {
> >
> > >                        @Override
> > >                        public  void ChartEvent(ChartEvent event) {
> > >                        Window.alert("event created" );
> >
> > >                        DialogBox db=new DialogBox();
> >
> > >                        db.setWidget( (IsWidget) new
> > > ChartGenericPresenter(rpcService,eventBus,new LineView()));
> >
> > >                        db.show();
> >
> > >                        }
> > >                });
> >
> > >         }
> >
> > > Where ChartGenericPresenter is the presenter and LineView() is its
> > > view. I am getting the following exception while i am using this
> >
> > > com.google.gwt.event.shared.UmbrellaException: One or more exceptions
> > > caught, see full set in UmbrellaException#getCauses
> > >    at
> > >
> com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:
> > > 129)
> > >    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:124)
> > >    at
> > > com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:
> > > 116)
> > >    at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:
> > > 172)
> > >    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1321)
> > >    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1277)
> > >    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > >    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > >    at java.lang.reflect.Method.invoke(Unknown Source)
> > >    at
> > > com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
> > >    at
> > > com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
> > >    at
> >
> > >
> com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.jav
> a:
> > > 167)
> > >    at
> >
> > >
> com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingFo
> rReturn(BrowserChannelServer.java:
> > > 326)
> > >    at
> >
> > >
> com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChann
> elServer.java:
> > > 207)
> > >    at
> > >
> com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
> > > 132)
> > >    at
> > > com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
> > > 561)
> > >    at
> > >
> com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:
> > > 269)
> > >    at
> >
> > >
> com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.j
> ava:
> > > 91)
> > >    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
> > >    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
> > >    at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
> > >    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > >    at java.lang.reflect.Method.invoke(Unknown Source)
> > >    at
> > > com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
> > >    at
> > > com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
> > >    at
> >
> > >
> com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.jav
> a:
> > > 167)
> > >    at
> >
> > >
> com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChanne
> lServer.java:
> > > 281)
> > >    at
> >
> > >
> com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChan
> nelServer.java:
> > > 531)
> > >    at
> >
> > >
> com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java
> :
> > > 352)
> > >    at java.lang.Thread.run(Unknown Source)
> > > Caused by: com.google.gwt.event.shared.UmbrellaException: One or more
> > > exceptions caught, see full set in UmbrellaException#getCauses
> > >    at
> > >
> com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:
> > > 129)
> > >    at com.dotentreprise.pulsev1.client.view.SystemStatusDisplay
> > > $1.onCellClicked(SystemStatusDisplay.java:96)
> > >    at com.google.gwt.user.client.ui.ListenerWrapper
> > > $WrappedTableListener.onClick(ListenerWrapper.java:713)
> > >    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.GwtEvent.dispatch(GwtEvent.java:1)
> > >    at
> >
> > >
> com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.ja
> va:
> > > 193)
> > >    at
> >
> > >
> com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus
> .java:
> > > 88)
> > >    at
> > >
> com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:
> > > 127)
> > >    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:124)
> > >    at
> > > com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:
> > > 116)
> > >    at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:
> > > 172)
> > >    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1321)
> > >    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1277)
> > >    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > >    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > >    at java.lang.reflect.Method.invoke(Unknown Source)
> > >    at
> > > com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
> > >    at
> > > com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
> > >    at
> >
> > >
> com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.jav
> a:
> > > 167)
> > >    at
> >
> > >
> com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingFo
> rReturn(BrowserChannelServer.java:
> > > 326)
> > >    at
> >
> > >
> com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChann
> elServer.java:
> > > 207)
> > >    at
> > >
> com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
> > > 132)
> > >    at
> > > com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
> > > 561)
> > >    at
> > >
> com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:
> > > 269)
> > >    at
> >
> > >
> com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.j
> ava:
> > > 91)
> > >    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
> > >    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
> > >    at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
> > >    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > >    at java.lang.reflect.Method.invoke(Unknown Source)
> > >    at
> > > com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
> > >    at
> > > com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
> > >    at
> >
> > >
> com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.jav
> a:
> > > 167)
> > >    at
> >
> > >
> com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChanne
> lServer.java:
> > > 281)
> > >    at
> >
> > >
> com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChan
> nelServer.java:
> > > 531)
> > >    at
> >
> > >
> com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java
> :
> > > 352)
> > >    at java.lang.Thread.run(Unknown Source)
> > > Caused by: java.lang.ClassCastException:
> > > com.dotentreprise.pulsev1.client.presenter.ChartGenericPresenter
> > > cannot be cast to com.google.gwt.user.client.ui.IsWidget
> > >    at com.dotentreprise.pulsev1.client.AppController
> > > $1.ChartEvent(AppController.java:62)
> > >    at
> > >
> com.dotentreprise.pulsev1.client.event.ChartEvent.dispatch(ChartEvent.java:
> > > 22)
> > >    at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
> > >    at
> >
> > >
> com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.ja
> va:
> > > 193)
> > >    at
> >
> > >
> com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus
> .java:
> > > 88)
> > >    at
> > >
> com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:
> > > 127)
> > >    at com.dotentreprise.pulsev1.client.view.SystemStatusDisplay
> > > $1.onCellClicked(SystemStatusDisplay.java:96)
> > >    at com.google.gwt.user.client.ui.ListenerWrapper
> > > $WrappedTableListener.onClick(ListenerWrapper.java:713)
> > >    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.GwtEvent.dispatch(GwtEvent.java:1)
> > >    at
> >
> > >
> com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.ja
> va:
> > > 193)
> > >    at
> >
> > >
> com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus
> .java:
> > > 88)
> > >    at
> > >
> com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:
> > > 127)
> > >    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:124)
> > >    at
> > > com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:
> > > 116)
> > >    at
> >
> > ...
> >
> > read more ยป
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>


-- 
Alfredo Quiroga-Villamil

AOL/Yahoo/Gmail/MSN IM:  lawwton

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to