Ok, solved my immediate problem, the ContactDetailId needs to have a
no argument constructor also.

public class ContactDetailId implements IsSerializable{
        private String id;
        public ContactDetailId(){
        }
        public ContactDetailId(String id){
                this.id = id;
        }
        public String getId(){
                return id;
        }
}

On Feb 13, 6:02 pm, Michael Dausmann <[email protected]> wrote:
> Hi
>
> Trying to build out the Ray Ryan best practices sample in GWT 2.0 ,
> having trouble with the action(command)/response objects, containing
> array list instances.  This is Ray's sample........
>
> package com.play.client;
>
> import java.util.ArrayList;
>
> public class GetDetails implements Action<GetDetailsResponse> {
>         private final ArrayList<ContactDetailId> ids;
>
>         public GetDetails(ArrayList<ContactDetailId> ids){
>                 this.ids = ids;
>         }
>
>         public ArrayList<ContactDetailId> getIds(){
>                 return ids;
>         }
>
> }
>
> This is my latest try..........
>
> public class GetDetailsAction implements Action<GetDetailsResponse>,
> IsSerializable {
>         private ArrayList<ContactDetailId> ids;
>
>         public GetDetailsAction(){
>         }
>
>         public GetDetailsAction(ArrayList<ContactDetailId> ids){
>                 this.ids = ids;
>         }
>
>         public ArrayList<ContactDetailId> getIds(){
>                 return ids;
>         }
>
> }
>
> public class ContactDetailId implements IsSerializable{
>         private String id;
>         public ContactDetailId(String id){
>                 this.id = id;
>         }
>         public String getId(){
>                 return id;
>         }
>
> }
>
> To Explain my changes, I have:-
>
> * Changed the name because I felt like it
>
> * Added a no-parameter constructor because  "[ERROR] [testgwt]
> com.play.client.Action<T> has no available instantiable subtypes.
> (reached via com.play.client.Action<T>)"
>
> * Removed the final modifier from the id's intance member because
> '[WARN] [testgwt] Field 'private final
> java.util.ArrayList<com.play.client.ContactDetailId> ids' will not be
> serialized because it is final'
>
> My sample runs but I now get a
> com.google.gwt.user.client.rpc.SerializationException when I try to
> pass an action instance via RPC as per the talk...
>
> Any Clues?  Have I missed some embarrassing and obvious point? All of
> the 'reference' implementations pass simple types and skirt the
> ArrayList thing.
>
> Michael

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