So, these methods should be valid then:
table.loadFromSQL(new AsyncCallback()
{
public void onSuccess(Object result)
{
Vector vv = (Vector) result;
int k =0;
int num_rows = vv.size()/5;
int num_cols = 5; // 5 column headers excluding row #
for(int i=1;i<num_rows+1;++i)
{
for(int j=1;j<num_cols+1;++j)
{
t.setText(i, j, (String) vv.get(k));
++k;
}
}
// update row indexes
for(int i=1; i<t.getRowCount(); i++)
{
Integer a = new Integer(i);
t.setText(i, 0, a.toString() );
t.setHTML(i,0, "<b>" + i + "</b>");
}
return;
}
public void onFailure(Throwable caught)
{
return;
}
});
and,
threatBoard.loadFromTable(v, new AsyncCallback()
{
public void onSuccess(Object result)
{
return;
}
public void onFailure(Throwable caught)
{
return;
}
});
I'm getting this error, Unable to load module entry point class
com.packtpub.eise.threatboard.client.ThreatBoard (see associated
exception for ...), when I try to call loadFromSQL() as written.
On Sep 10, 6:06 pm, "Ian Petersen" <[EMAIL PROTECTED]> wrote:
> On Wed, Sep 10, 2008 at 4:56 PM, Kevin <[EMAIL PROTECTED]> wrote:
> > "For the same reason, asynchronous methods do not have return types;
> > they must always return void."
>
> > So, to use a method with an RPC, am I just doing the following?
>
> I think the problem you're having is that you expect a method to
> return its result directly, rather than via a callback. RPC in GWT is
> asynchronous, which means that, when the client side of the invocation
> is finished, there isn't a result yet--you're still waiting for the
> server to compute a result and return it. That's the reason for the
> AsyncCallback--you need to pass in an event handler that can deal with
> the server's result when the client receives it.
>
> I'm not sure if it'll help because you might not be in the target
> audience, but try
> readinghttp://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...
> and see if it makes things any clearer.
>
> Basically, RPCs return their values on the client by invoking the
> onSuccess method of the AsyncCallback you pass in when you invoke the
> RPC. Unless you're into deep magic, there's nothing useful for an RPC
> to return at the moment that you invoke it, which is why they all
> return void.
>
> On the server side, things are a little different. From the server's
> perspective, RPC is synchronous--the server receives a request, it
> computes the result, and then replies with that result. That's why
> the the RemoteServiceServlet implementation you write must implement
> the non -Async service interface. So, on the server, you just
> implement the RPC method like any other method--take in some
> arguments, compute a result, and return it.
>
> HTH,
> Ian
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---