PDA

View Full Version : PagingLoadConfig SerializationException



TrojanMyth
27 Nov 2011, 1:28 AM
Dear All;

I want to use LoadFilter class with PagingLoadConfig. I want to make external data filter with LoadFilter class.

When i am making these following codes there is no request and Loader is making SerializationExeption.




public class LoadFilter implements Serializable { private String fieldName=""; private Object Value; private Object Value2; private List<Object> Values; private String Operator=""; private FilterType FType; private FilterType Type; private boolean FieldNull = false; private boolean Not = false; private boolean Between;
public LoadFilter() { }
public boolean isFieldNull() { return FieldNull; }
public void setFieldNull(boolean FieldNull) { this.FieldNull = FieldNull; }
public org.ucgendigital.web.j3gengwt.ui.client.data.FilterType getFilterType() { return FType; }
public void setFilterType(org.ucgendigital.web.j3gengwt.ui.client.data.FilterType FilterType) { this.FType = FilterType; }
public boolean isNot() { return Not; }
public void setNot(boolean Not) { this.Not = Not; }
public String getOperator() { return Operator; }
public void setOperator(String Operator) { this.Operator = Operator; }
public org.ucgendigital.web.j3gengwt.ui.client.data.FilterType getType() { return Type; }
public void setType(org.ucgendigital.web.j3gengwt.ui.client.data.FilterType Type) { this.Type = Type; }
public Object getValue() { return Value; }
public void setValue(Object Value) { this.Value = Value; }
public Object getValue2() { return Value2; }
public void setValue2(Object Value2) { this.Value2 = Value2; }
public List<Object> getValues() { return Values; }
public void setValues(List<Object> Values) { this.Values = Values; }
public String getFieldName() { return fieldName; }
public void setFieldName(String fieldName) { this.fieldName = fieldName; }
public boolean isBetween() { return Between; }
public void setBetween(boolean Between) { this.Between = Between; } }



public enum FilterType implements Serializable { IN,LIKE,AND,OR }



PagingLoadConfig p = (PagingLoadConfig)loadConfig; List<LoadFilter> l = new ArrayList<LoadFilter>();
LoadFilter f = new LoadFilter();
f.setFieldName("some_field");
f.setOperator("=");
f.setValue(1);
f.setType(FilterType.AND);
l.add(f);
p.set("filters",l); CommonSERVICE.getFormTypes(p, callback);

Colin Alworth
28 Nov 2011, 4:32 PM
You need to indicate the the RPC code that this new object can be sent over the wire. Two ways you can do this (off the top of my head):

Subclass PagingLoadConfig. This has the added benefit that you can then add a getter/setter for this field instead of relying on the get(String) method
Move this set of filter data to another param in the RPC method.