Hi,
i finally decided to put this problem onto this forum, i know it could be silly, but i m just too new to SmartGwt, really haven't got the idea yet.
As how it's named, DMI is Direct Method Invocation, after some readings, DMI seems to me is not only for data fetching, removing, saving and updating, it can also call server methods from the client to perform some business logic, for example, clear the session to logout an authenticated user, or even something more complex. This understanding is pretty much based on my old experience in GwtExt, in which a RPC call can perform various tasks on the server side. Please tell me if i m right, or wrong?
As described above, i m trying to do some simple examples, like a login, fill in username and password, click on a button, the server side DMI class will decide whether the given information is correct, hence react accordingly. From the SmartGwt/SmartGwtEE Showcase, almost all DMI calls are performed by a ListGrid, or some other components such as a DynamicForm.save, i m wondering how i can invoke a server method using a button, here's some sample code, but it doesn't work for me:
userDmi.ds.xml
client Java
The 'DMI.call(....)' seems like what i wanted, but unfortunately i found the DMI class is not available, i guess it's in the SmartClient library, but isn't smartclient included by SmartGwt? I m getting even more confused, if i m going to use SmartGwt Pro, do i still need to download SmartClient and included it in my project class path? do i need to purchase a license for SmartClient library too?
I think my problem is that i don't get the idea of how SmartGwt works, even i'm pretty familiar with GwtExt, but i really still have lots of questions.
Please help me, i m planning for a new project using SmartGwt, coz i love the concept of getting rid of the redundant client side JavaBean in RPC in GwtExt, but i need to know that SmartGwt is a better choice before i m really putting this technology into our Enterprise project.
Thanks! Your help is sincerely appreciated!
i finally decided to put this problem onto this forum, i know it could be silly, but i m just too new to SmartGwt, really haven't got the idea yet.
As how it's named, DMI is Direct Method Invocation, after some readings, DMI seems to me is not only for data fetching, removing, saving and updating, it can also call server methods from the client to perform some business logic, for example, clear the session to logout an authenticated user, or even something more complex. This understanding is pretty much based on my old experience in GwtExt, in which a RPC call can perform various tasks on the server side. Please tell me if i m right, or wrong?
As described above, i m trying to do some simple examples, like a login, fill in username and password, click on a button, the server side DMI class will decide whether the given information is correct, hence react accordingly. From the SmartGwt/SmartGwtEE Showcase, almost all DMI calls are performed by a ListGrid, or some other components such as a DynamicForm.save, i m wondering how i can invoke a server method using a button, here's some sample code, but it doesn't work for me:
userDmi.ds.xml
Code:
...... <serverObjecct lookupStyle="new" className="au.com.sample.trans.server.TransUserDMI" /> <operationBindings> <binding operationType="fetch" operationId="tryLogin"> <serverObject className="au.com.sample.trans.server.TransUserDMI" serverMethod="tryLogin"/> </binding> </operationBindings>
Code:
IButton buttonLogin = new IButton("Login"); buttonLogin.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { DSRequest request = new DSRequest(); request.setDataSource("userDmi"); request.setOperationId("tryLogin"); // RPCManager.sendRequest(request); **this method doesn't work, it requires changing actionUrl // DMI.call(.....) ** found this from the smartgwtee javadoc, but can't find DMI class } });
I think my problem is that i don't get the idea of how SmartGwt works, even i'm pretty familiar with GwtExt, but i really still have lots of questions.
Please help me, i m planning for a new project using SmartGwt, coz i love the concept of getting rid of the redundant client side JavaBean in RPC in GwtExt, but i need to know that SmartGwt is a better choice before i m really putting this technology into our Enterprise project.
Thanks! Your help is sincerely appreciated!
Comment