Help: GWT/RF.... client to server communication !!

49 views
Skip to first unread message

laxman lingampally

unread,
May 14, 2012, 11:00:30 PM5/14/12
to google-we...@googlegroups.com
Hi all,

please help me out,

In my project using GWT/RequestFactory , Hibernate with SQL server database.
 
now my problem is Display the Records or Data in client side , please tell me How to get the data from server. 

below client side code.


// here fire method giving compile time error says  The method fire(Receiver<Void>) in the type RequestContext is not applicable for the arguments (new Receiver<NameDataProxy>(){})

1)DemoRF.java
Send a request client to server 

//button clickhandler

nameDataRequest.query().fire(new Receiver<NameDataProxy>() {
@Override
public void onSuccess(final NameDataProxy response) {
System.out.println("success...");
if (response == null) {
//some process
}


@ProxyFor(Contact.class)
2)NameDataProxy having all setter and getter methods
//.............

3) request interface methods 

@Service(Contact.class)
public interface NameDataRequest extends RequestContext {

 // Request<Long> count();
  
  Request<List<NameDataProxy>> findNameData();
  
  Request<List<NameDataProxy>> query();
.......................
.......................................  
}

 below server side code:

3)Contact.java
//here one method
.......

 public static List<Contact> query() {
   //EntityManager em =null;// entityManager();
   try {
    SessionFactory sf = new Configuration().configure().buildSessionFactory();
Session session = sf.openSession();
@SuppressWarnings("unused")
Transaction trans =session.beginTransaction();
Query q2 = session.createQuery("select cus from Contact cus");
@SuppressWarnings("unchecked")
List<Contact> conl = (List<Contact>)q2.list();
conl.size();
          System.out.println( conl.size());
     return conl;
   } finally {
    //conl.close();
   }
 }
........................
.........................

please tell me in my code where is  the mistake or worng.

if you don't mind, send simple web application using GWT/RF sample code for me,


advance thanks.
 

Jens

unread,
May 15, 2012, 4:53:19 AM5/15/12
to google-we...@googlegroups.com
Your query() method returns a List of Proxies, so your receiver should also contain a list of proxies and not a single one.

if you don't mind, send simple web application using GWT/RF sample code for me

Check out the GWT SDK examples like DynaTableRf or MobileWebApp.

-- J.
Reply all
Reply to author
Forward
0 new messages