So, on the client side, getMyVector takes in "Vector result." Once I
get this input I can update my table and sucessfully load from the
database.
How do I get this input? That's my main struggle - the client's
supposed to talk to the database via an RPC, however I don't know how
to get "Vector result" as an input since I can't even call database
from the client side.
Thanks! Your help is really taking me along.
On Sep 10, 5:18 pm, "Jeremiah Elliott" <[EMAIL PROTECTED]> wrote:
> well,
> you should have three files -
> 1 tableService.java
> this is an interface that extends RemoteService.
> the methods here can return anything you want - for instance
>
> public Vector getMyVector(Vector input); // just an example - I dont'
> know how your app works
>
> 2 tableServiceAsync.java interface, doesnt' extend anything
> all methods must return void. the method name must match the
> non-async method above: i.e.:
>
> void getMyVector(Vector input, AsyncCallback);
>
> 3: whateEverYouCallYourImplementation.java
> This is the server side stuff where you actually query your db. you
> should have this class referenced in your xml file
> this is not an interface all you query / update /delete is here
>
> public Vector getMyVector(Vector input){
> ...
> return myNewVector;
>
> }
>
> Not sure if that helps or not
>
> Your above code:
> public void onSuccess(Object result)
> {
> return;
> }
>
> can actually be
> public void onSuccess(Vector result)
> {
> //... process the vector in the client
> }
>
>
>
> On Wed, Sep 10, 2008 at 3:56 PM, Kevin <[EMAIL PROTECTED]> wrote:
>
> > The following text is what I got from GWT's RCP notes, <http://
> > code.google.com/webtoolkit/documentation/
> > com.google.gwt.doc.DeveloperGuide.RemoteProcedureCalls.html>
>
> > "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?
>
> > in .../client/table.java
>
> > public void Request() /* Makes RPC */
> > {
> > table = (tableServiceAsync)GWT.create(tableService.class);
> > ServiceDefTarget endpoint = (table)threatBoard;
> > endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() +
> > "table");
> > }
>
> > public void onModuleLoad() {
>
> > ...
>
> > // call loadFromTable using RPC
>
> > threatBoard.loadFromSQL(new AsyncCallback()
> > {
> > public void onSuccess(Object result)
> > {
> > return;
> > }
> > public void onFailure(Throwable caught)
> > {
> > return;
> > }
> > });
>
> > // all business logic is in .../server/tableImpl
>
> > I'm lost, please guide me.
>
> > Thanks
>
> > On Sep 10, 4:46 pm, "Jeremiah Elliott" <[EMAIL PROTECTED]> wrote:
> >> Why make the rpc return void? Just have it return your collection.
>
> >> On Wed, Sep 10, 2008 at 3:17 PM, Kevin <[EMAIL PROTECTED]> wrote:
>
> >> > Hi,
>
> >> > I created a GWT FlexTable, "table", and a SQL database, "database".
> >> > The table adds a row of editable cells and removes a specified row. I
> >> > wrote two functions: loadFromSQL and loadFromTable. The first copies
> >> > what's in the database to the table. The latter copies what's in the
> >> > table to the database.
>
> >> > I tried to use SQL commands in my java driver under the "client"
> >> > directory, however no SQL support is available. After that I knew I'd
> >> > have to use RPC's. So, basically my question is, how to implement my
> >> > static database class from an RPC?
>
> >> > Assuming GWT supported SQL, I'd type v = D.loadFromSQL(); (assume
> >> > loadFromSQL outputs a vector). Then I'd parse v, filling up the
> >> > table.
>
> >> > With the RPC's, I don't know what should be returned when using a
> >> > "void" async method.
>
> >> > Please give me some guidance.
>
> >> > Thanks,
> >> > Kevin- Hide quoted text -
>
> >> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---