PDA

View Full Version : Problem with Remote Filter Grid: Type is not Serialisable



angisad
4 Oct 2011, 5:50 AM
Hi All,

I am trying to create a Remote Filter Grid with GXT but I am having some problems.
My model looks like this



public class MyModel extends BaseModel{


public MyModel()
{}

public MyModel(MyClass c,String caller){
set("myclass",c) ;
set("caller", caller);
}
....
//Setters an getters here
}


public class MyClass implements IsSerialisable{
private String att1="Attribute1";
public MyClass ()
{}
public MyClass (String param )
{att1=param;}
...
}


In the Servlet code, I create a list of MyModel (just like the example in the showcase), but then I get an error message that the type MyClass is not Serialisable even though it implements the interface IsSerialisable.
And of course MyClass is on the client Side.
Can someone tell me what am I missing?

The truth is my class is a lot more complecated than that and It would be very complicated for me to use simple types (String, int, boolean...) instead of using it.

I hope there is a solution to this problem.

Thank you.

sven
4 Oct 2011, 5:53 AM
Add an unsed field to your MyModel class:


private MyClass unusedMyClass;

That should fix it.

angisad
4 Oct 2011, 6:00 AM
Waw, it works. Thanx a million. I spent more than 2 hours trying to fix it.
Is there an explication for this solution?
Thanx a lot again.

sven
4 Oct 2011, 6:01 AM
It tells GWT that this class might get send over RPC, as it cannot find any other reference to it.

raone32
11 Oct 2011, 11:35 AM
I am trying to create a Remote Filter Grid with GXT but I am having some problems.
My model looks like this




roof vents (http://www.roofingexpertsonline.com/)