Hi all!
I'm trying to use the FilterBuilder with a RestDataSource, but in my initial experiments I couldn't make the FilterBuilder send to server a XML with the <startRow></startRow>, <endRow></endRow> and <totalRows></totalRows> elements filled. I searched the API and the only place I saw to set was the ListGrid. My mistake? How can I set up the DataSource and the FilterBuilder to send the page size?
My ui set up code:
My PostBasedRestDataSource:
The initial request:
The filter request. Note the <startRow> element missing:
Thanks in advance!
I'm trying to use the FilterBuilder with a RestDataSource, but in my initial experiments I couldn't make the FilterBuilder send to server a XML with the <startRow></startRow>, <endRow></endRow> and <totalRows></totalRows> elements filled. I searched the API and the only place I saw to set was the ListGrid. My mistake? How can I set up the DataSource and the FilterBuilder to send the page size?
My ui set up code:
Code:
final PostBasedRestDataSource planoDS = new PostBasedRestDataSource();
planoDS.setID("planoDS");
planoDS.setDataURL(GWT.getHostPageBaseURL() + "rs/datasource");
final PostBasedRestDataSource filterDS = new PostBasedRestDataSource();
filterDS.setID("filterDS");
filterDS.setDataURL(GWT.getHostPageBaseURL() + "rs/filter");
final FilterBuilder filterBuilder = new FilterBuilder();
filterBuilder.setFieldDataSource(filterDS);
filterBuilder.setDataSource(planoDS);
final ListGrid grid = new ListGrid();
grid.setWidth100();
grid.setHeight100();
grid.setAutoFetchData(true);
grid.setDataPageSize(50);
grid.setSortField(0);
grid.setDataSource(planoDS);
grid.setFetchDelay(500);
My PostBasedRestDataSource:
Code:
public class PostBasedRestDataSource extends RestDataSource {
public PostBasedRestDataSource() {
OperationBinding fetch = new OperationBinding();
fetch.setOperationType(DSOperationType.FETCH);
fetch.setDataProtocol(DSProtocol.POSTMESSAGE);
OperationBinding add = new OperationBinding();
add.setOperationType(DSOperationType.ADD);
add.setDataProtocol(DSProtocol.POSTMESSAGE);
OperationBinding update = new OperationBinding();
update.setOperationType(DSOperationType.UPDATE);
update.setDataProtocol(DSProtocol.POSTMESSAGE);
OperationBinding remove = new OperationBinding();
remove.setOperationType(DSOperationType.REMOVE);
remove.setDataProtocol(DSProtocol.POSTMESSAGE);
this.setOperationBindings(fetch, add, update, remove);
}
}
Code:
<request> <data> <planoDS/> </data> <dataSource>planoDS</dataSource> <operationType>fetch</operationType> <startRow>0</startRow> <endRow>50</endRow> <sortBy>id</sortBy> <textMatchStyle>substring</textMatchStyle> <componentId>isc_OID_5</componentId> <oldValues></oldValues> </request>
Code:
<request>
<data>
<planoDS constructor="AdvancedCriteria">
<operator>and</operator>
</planoDS>
</data>
<dataSource>planoDS</dataSource>
<operationType>fetch</operationType>
<textMatchStyle>substring</textMatchStyle>
<oldValues></oldValues>
</request>
Thanks in advance!
Comment