Hello,
I am using list grid with fetch mode basic I want filtering using AdvancedCriteria but I am getting error as Can't get Result Set
I am attaching a text file which includes client code and my DS file
Client code
display.getTextItem().addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
String input = (String) event.getValue();
GWT.log("Value is" + input);
display.getProjectDetailsGrid().getDataSource().setClientOnly(true);
//display.getProjectDetailsGrid().invalidateCache();
AdvancedCriteria criteria = new AdvancedCriteria(OperatorId.CONTAINS,
new Criterion[] { new Criterion(DataSourceConstant.PROJECT_CODE, OperatorId.CONTAINS, input)});
display.getProjectDetailsGrid().filterData(criteria);
};
});
}
final DataSource datasource = DataSource.getDataSource(projectList);
final ListGrid listGrid = new ListGrid();
listGrid.setID(IDsConstant.PROJECT_DETAIL_GRID);
listGrid.setStyleName("cowListGrid");
listGrid.setDataFetchMode(FetchMode.BASIC);
listGrid.setSelectionType(SelectionStyle.MULTIPLE);
listGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);
listGrid.setDataSource(datasource);
listGrid.setFields(getProjectListGridFields());
return listGrid;
Projects.ds.xml
<DataSource ID="Projects" beanClassName="com.assaabloy.cow.shared.dto.ProjectGridDto"
serverType="hibernate" configBean="cowSessionFactory" lookupStyle="spring"
beanFactory="org.springframework.beans.factory.BeanFactory"
autoDeriveSchema="false" xmlns:fmt="WEB-INF/">
<fields>
<field name="projectId" type="int" primaryKey="true" />
<field name="projectCode" type="text" required="true" />
<field name="projectDesc" type="text" required="true" />
<field name="ppof" type="boolean" />
</fields>
<operationBindings>
<binding operationType="fetch">
<customSQL>
SELECT p.PROJECT_ID as projectId, p.PROJECTCODE as
projectCode, p.PROJECTDESCRIPTION as projectDesc,p.PPOF as ppof FROM PROJECTS p
WHERE
p.COMPANY_ID= $values.companyId and p.del=0
</customSQL>
</binding>
{
dataSource:"Projects",
operationType:"fetch",
componentId:"project_detail_grid",
data:{
operator:"contains",
criteria:[
{
fieldName:"projectCode",
operator:"contains",
value:"D"
}
]
},
textMatchStyle:"substring",
resultSet:[ResultSet ID:isc_ResultSet_0 (dataSource: Projects, created by: project_detail_grid)],
callback:{
caller:[ResultSet ID:isc_ResultSet_0 (dataSource: Projects, created by: project_detail_grid)],
methodName:"fetchRemoteDataReply"
},
willHandleError:true,
showPrompt:true,
prompt:"Finding Records that match your criteria...",
oldValues:{
operator:"contains",
criteria:[
{
fieldName:"projectCode",
operator:"contains",
value:"D"
}
]
},
requestId:"Projects$6271",
internalClientContext:{
requestIndex:2
},
fallbackToEval:false,
dataFetchMode:"basic",
lastClientEventThreadCode:"INP6",
bypassCache:true,
dataProtocol:"getParams"
}
{
affectedRows:0,
data:"could not extract ResultSet",
invalidateCache:false,
isDSResponse:true,
queueStatus:-1,
status:-1
}
I am using list grid with fetch mode basic I want filtering using AdvancedCriteria but I am getting error as Can't get Result Set
I am attaching a text file which includes client code and my DS file
Client code
display.getTextItem().addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
String input = (String) event.getValue();
GWT.log("Value is" + input);
display.getProjectDetailsGrid().getDataSource().setClientOnly(true);
//display.getProjectDetailsGrid().invalidateCache();
AdvancedCriteria criteria = new AdvancedCriteria(OperatorId.CONTAINS,
new Criterion[] { new Criterion(DataSourceConstant.PROJECT_CODE, OperatorId.CONTAINS, input)});
display.getProjectDetailsGrid().filterData(criteria);
};
});
}
final DataSource datasource = DataSource.getDataSource(projectList);
final ListGrid listGrid = new ListGrid();
listGrid.setID(IDsConstant.PROJECT_DETAIL_GRID);
listGrid.setStyleName("cowListGrid");
listGrid.setDataFetchMode(FetchMode.BASIC);
listGrid.setSelectionType(SelectionStyle.MULTIPLE);
listGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);
listGrid.setDataSource(datasource);
listGrid.setFields(getProjectListGridFields());
return listGrid;
Projects.ds.xml
<DataSource ID="Projects" beanClassName="com.assaabloy.cow.shared.dto.ProjectGridDto"
serverType="hibernate" configBean="cowSessionFactory" lookupStyle="spring"
beanFactory="org.springframework.beans.factory.BeanFactory"
autoDeriveSchema="false" xmlns:fmt="WEB-INF/">
<fields>
<field name="projectId" type="int" primaryKey="true" />
<field name="projectCode" type="text" required="true" />
<field name="projectDesc" type="text" required="true" />
<field name="ppof" type="boolean" />
</fields>
<operationBindings>
<binding operationType="fetch">
<customSQL>
SELECT p.PROJECT_ID as projectId, p.PROJECTCODE as
projectCode, p.PROJECTDESCRIPTION as projectDesc,p.PPOF as ppof FROM PROJECTS p
WHERE
p.COMPANY_ID= $values.companyId and p.del=0
</customSQL>
</binding>
{
dataSource:"Projects",
operationType:"fetch",
componentId:"project_detail_grid",
data:{
operator:"contains",
criteria:[
{
fieldName:"projectCode",
operator:"contains",
value:"D"
}
]
},
textMatchStyle:"substring",
resultSet:[ResultSet ID:isc_ResultSet_0 (dataSource: Projects, created by: project_detail_grid)],
callback:{
caller:[ResultSet ID:isc_ResultSet_0 (dataSource: Projects, created by: project_detail_grid)],
methodName:"fetchRemoteDataReply"
},
willHandleError:true,
showPrompt:true,
prompt:"Finding Records that match your criteria...",
oldValues:{
operator:"contains",
criteria:[
{
fieldName:"projectCode",
operator:"contains",
value:"D"
}
]
},
requestId:"Projects$6271",
internalClientContext:{
requestIndex:2
},
fallbackToEval:false,
dataFetchMode:"basic",
lastClientEventThreadCode:"INP6",
bypassCache:true,
dataProtocol:"getParams"
}
{
affectedRows:0,
data:"could not extract ResultSet",
invalidateCache:false,
isDSResponse:true,
queueStatus:-1,
status:-1
}
Comment