RequestFactory and populate form field with dynamic data

96 views
Skip to first unread message

ungarida

unread,
Jun 29, 2011, 9:44:21 AM6/29/11
to Google Web Toolkit
Hi all,
I'm studying new RequestFactory framework and I have a big doubt.
If the RequestFactory is stricly associated with a single Entity,
which is the best way transmit dynamic data to populate form fields
with default values?

For example I want to fill a drop down list, I can not use
RequestFactory to load all data. Should I use RPC?

Thomas Broyer

unread,
Jun 29, 2011, 10:27:06 AM6/29/11
to google-we...@googlegroups.com
Yes you can, what makes you think it's not possible?

You must be misunderstanding something, but it's hard to tell what exactly. 

ashwin....@gmail.com

unread,
Jun 29, 2011, 10:26:46 AM6/29/11
to google-we...@googlegroups.com
you should be able to dynamically populate a drop list using requestFactory. Once you fetch the data from the server, you can update your list.

The only instance where you would have to build a custom widget is when you want to dynamically populate a SelectionCell with your dynamic data. For that you can refer to the following link


Thanks
Ashwin


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


Elhanan Maayan

unread,
Jun 29, 2011, 2:32:11 PM6/29/11
to google-we...@googlegroups.com
i believe to treat rf api , is to first think about how would do it with normal java dao, and persistence api, then begin to translate them to rf api's becouse that's basically what it tries to do.

by persistence api, i mainly thinkking about DAO's classes, where each DAO usually revolves around a single entity and all of them extend one single Abstract class which usually has single entity FUD api's (Find,Update,Delete).


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

ungarida

unread,
Jun 30, 2011, 1:55:08 AM6/30/11
to Google Web Toolkit

You are right, there is a misunderstanding. I try to complete my
question with an example.
My problem is when you want to do a drop down list of cities for a
form of a person entity.
I mean, the problem is not about how to dynamically update a form, it
is about where have I to put data that is not strictly part of an
entity and how have I to get this data to populate the form?

On Jun 29, 4:27 pm, Thomas Broyer <t.bro...@gmail.com> wrote:e

Thomas Broyer

unread,
Jun 30, 2011, 5:20:48 AM6/30/11
to google-we...@googlegroups.com
It's really no different from GWT-RPC, if you're more comfortable with it. The main difference is that you can push several things in a RequestContext before firing it, making a "batch request". The other major difference is that changes to proxies have to be made in a RequestContext, after you edit() them; that way, when you fire(), only the changes you made are sent across the write, not the whole object, only the diff.

Here, you'll create a RequestContext out of your RequestFactory, enqueue an invocation to get the values from the server and fire() the whole thing. In most cases, it'll be a different RequestContext instance than the one you get your PersonProxy from, but it depends how you organize your code. It'll however have to be a different context instance than the one you edit() the PersonProxy in!
Reply all
Reply to author
Forward
0 new messages