I am trying to create a ValueProxy
which holds some basic information about a search a user is performing. For some reason GWT wants it to be an EntityProxy but I dont see why (nor does it make sense for this class to be an EntityProxy).
// FilterProxy extends ValueProxy
@ProxyFor(DayFilter.class)
public interface DayFilterProxy extends FilterProxy {
void setFilterValue(Date day);
Date getFilterValue();
}
public class DayFilter extends Filter {
public DayFilter() {
setOperator(FilterOperator.GREATER_THAN_OR_EQUAL);
setField("dateRequested");
}
public void setFilterValue(Date date) {
this.value = date;
}
public Date getFilterValue() {
return value;
}
}
public interface PaginationRequest<T> extends RequestContext {
Request<List<T>> paginate(int offset, int limit, String sortColumn,
boolean isSortAscending, List<FilterProxy> filters);
Request<Integer> count(List<FilterProxy> filters);
}
@Service(value=TripService.class, locator=SchedgyServiceLocator.class)
public interface TripRequest extends PaginationRequest<TripProxy> {
Request<TripProxy> save(TripProxy trip);
}
Within the activity that is sending this back to the server:
// Request is a TripRequest
DayFilterProxy filter = request.create(DayFilterProxy.class);
This results in:
java.lang.AssertionError: com.schedgy.trip.dao.filter.trip.proxy.DayFilterProxy is not an EntityProxy type
at com.google.web.bindery.requestfactory.shared.impl.IdFactory.asEntityProxy(IdFactory.java:66)
at com.google.web.bindery.requestfactory.shared.impl.IdFactory.createId(IdFactory.java:229)
at com.google.web.bindery.requestfactory.shared.impl.IdFactory.allocateId(IdFactory.java:41)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext.create(AbstractRequestContext.java:478)
at com.schedgy.trip.client.activity.TripsActivity.getFilters(TripsActivity.java:56)
Any ideas? Its got to be something obvious that I am just overlooking as I have ValueProxies working elsewhere in the code.
Could it be that your DayFilterProxy is not referenced at all from the RequestContext?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With