Thanks for the response Gabriel... it's the 1st option that I'm
looking for. Generating HTML is not an option for me, since each of my
widgets need to be self-contained components. So, the 1st option is
the way to go for me.

But this is where my problem starts... I'd love to use reflection to
populate the widgets. I.e for each getters in my DTO, I try to invoke
the corresponding setter in the widget (if exists). E.g.: If my
ButtonDTO has a getHeight(), I'd check if the Button widget has a
setHeight(). If so, I'd call setHeight() of the Button widget with the
value of buttonDTO.getHeight().

The easiest way to do this is through reflection, so that I won't have
to do the above manually for each property. Of course some values
cannot be set in this manner... that has to be dealt in the normal
way.

So, if I follow the approach that you mentioned as option 1, I won't
be able to use reflection, right? Any workarounds?

Thanks again,
Arshad

On 5/25/11, Gabriel <guz...@gmail.com> wrote:
> Hi,
>
> I can think of two options to implement what you want:
> 1) On the server side generate DTOs that represent the UI structure
> and on the client side read them and build the UI accordingly.
> 2) Generate pure HTML on the server and use it as the value of an HTML
> widget.
>
> The choice depends on what exactly you need from the client side. You
> should minimize the use of widgets as much as possible, and use them
> only if you need to capture events. Otherwise it is recommended to use
> HTML.
>
> Gabriel
>
> On May 25, 9:12 am, Arshad <arshadnadh...@gmail.com> wrote:
>> Hi all,
>>
>> I'm pretty new to GWT, so please bear... Coming from a Struts
>> background, GWT concepts takes a lot of getting used to :)
>>
>> I have a requirement of defining a user interface in a custom XML
>> template, process it to generate a technology independent generic
>> component tree, and use this tree to generate various different user
>> interfaces (e.g. Swing, GWT, JSF, etc...). To get this going, I make
>> use of reflection to transfer values from the generic component to the
>> Swing/GWT/JSF component.
>>
>> I'm in the process of developing the GWT part, and feel like theirs
>> two ways of approaching this:
>> 1. Do only the XML processing in the server side. The client makes an
>> RPC call and retrieves the generic component tree in to the client
>> side in order to generate the GWT widgets. This doesn't seem to be an
>> option since GWT doesn't support reflection on the client side.
>>
>> 2. Do both the XML processing and the GWT widget generation on the
>> server side. The client makes an RPC call and retrieves the generated
>> GWT widgets. This also doesn't seem to be possible... may be because
>> it the widgets are not serializable?
>>
>> I would really appreciate any input regarding this. Is there anyway I
>> can generate the GWT widgets on the server side and retrieve it from
>> the client side? Or is there any other way I can approach this
>> problem?
>>
>> Thanks in advance,
>> Arshad
>
> --
> 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-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

-- 
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-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to