You could also try to generate the needed HTML on your server and send
it to your client. On your client you could put that HTML into a
custom Widget via setInnerHTML. This custom Widget can overwrite
onBrowserEvent if you need some basic event handling for your
generated HTML.
We did something like this for generating questionnaires on the server
(questionnaires are defined through xml and stored in a db) and
intercepting events whenever a user interacts with a checkbox/
radiobutton/textbox.
We primarily did this because of IE's poor performance. If you use any
other browser then I would also send some sort of custom data object
to the client and use this object to build the UI.

On 13 Jan., 17:48, Jack <[email protected]> wrote:
> Hi all.
> I'm using GWT 2.0
>
> In my application I have to render on the browser an html form with a
> lot of input widgets such as textfield, checkbox, and so on.
> The exact composition of such widgets is stored in a database; in
> other words I don't know how the form must look like a-priori, but I
> need to build it dynamically based on what's stored in the db.
>
> I'm trying to follow this approach: the client send and RPC request to
> the server side of the application through a method that returns a
> VerticalPanel, like this:
>
> public class MyServiceImpl extends RemoteServiceServlet implements
> MyService {
>     public VerticalPanel getMyForm() {
>         VerticalPanel pan = new VerticalPanel();
>         ...
>         pan.add( new TextBox(...) )
>         ...
>         return pan;
>     }
>
> }
>
> This approach leads me to this error at compilation-time:
> [ERROR] com.google.gwt.user.client.ui.VerticalPanel is not assignable
> to 'com.google.gwt.user.client.rpc.IsSerializable' or
> 'java.io.Serializable' nor does it have a custom field serializer
> (reached via com.google.gwt.user.client.ui.VerticalPanel)
> [ERROR] com.google.gwt.user.client.ui.VerticalPanel has no available
> instantiable subtypes. (reached via
> com.google.gwt.user.client.ui.VerticalPanel)
>
> How can I workaround this problem, or what approach should I follow ?
> Thank you
> Jack

-- 
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.

Reply via email to