Client-side code not seeing multiple return types

12 views
Skip to first unread message

Ryan McFall

unread,
May 27, 2012, 7:19:38 AM5/27/12
to Google Web Toolkit
I am trying to use the polymorphism features of GWT 2.4, and am
running into a problem that the client side code is not seeing the
right kind of proxy returned.

I have the following objects:
- A Survey object, which contains a list of SurveyQuestion objects.
There are corresponding RF proxy interfaces declared for both Survey
(ISurvey) and SurveyQuestion (ISurveyQuestion)
- MultipleChoiceQuestion is a subclass of SurveyQuestion, with a
corresponding proxy interface declared (IMultipleChoiceQuestion),
which extends the proxy for SurveyQuestion (ISurveyQuestion)
- My service method is annotated with the @ExtraTypes annotation and
includes the class IMultipleChoiceQuestion

When the server side method that returns a Survey is invoked, the type
of the object in the Survey's list of SurveyQuestion objects is in
fact MultipleChoiceQuestion (instead of SurveyQuestion).

But, the proxy returned on the client is an instance of
ISurveyQuestion, not IMultipleChoiceQuestion, as I expect it to be.

Am I missing something?

Thanks,
Ryan

Ryan McFall

unread,
May 27, 2012, 7:36:12 AM5/27/12
to Google Web Toolkit
I updated my GWT SDK to the most recent version of 2.4, and it seems
to be working now. I was using the January release and updated to the
May release.

Ryan
Reply all
Reply to author
Forward
0 new messages