Hello, Im attempting to use AdvancedCriteria in my datasource searches.
I need access to the OperatorId.Or OperatorId because I need to be able to do a criteria search that will return multiple records that might not show
up with a normal fetchData(Criteria crit).
I found that with fetchData(Criteria) you cant stack your criteria (Like looking for multiple "FirstName" fields with different names.
this led me to AdvancedCriteria. Im attempting to use it with filterbuilder.
Heres my code
ListGrid lGrid = new ListGrid();
MemberData memberData = new MemberData();
ListGridField listgridrecordidField = new ListGridField("MemberId", "ID");
ListGridField firstNameField = new ListGridField("FirstName", "First Name");
ListGridField lastNameField = new ListGridField("LastName", "Last Name");
lGrid.setFields(listgridrecordidField, lastNameField, firstNameField);
lGrid.setDataSource(memberData.getNewMemberData());
FilterBuilder filterBuilder = new FilterBuilder();
AdvancedCriteria aCriteria1 = new AdvancedCriteria("FirstName", OperatorId.IS_NULL);
filterBuilder.setCriteria(aCriteria1);
filterBuilder.setDataSource(lGrid.getDataSource());
lGrid.filterData()
I went with the OperatorId.IS_NULL route instead of my intended OperatorId.Or since none of my values are NULL and I knew this should allow AdvancedCriteria to work as its the simplest example by not returning anything if the filterbuilder was working.
I found that when I run fetchData() or filterData() (after setting up the
advancedcriteria and adding it to the filterbuilder and setting the filterbuilders datasource to be the datasource attached to the listgrid) my listgrid shows all the data from the datasource, and not an empty result since none of my listgridrecords have a null "FirstName".
My code in eclipse doesnt show AdvancedCriteria to have any errors in the signature, as it did before I got SmartGwt 2.1.
This is the correct way to use AdvancedCriteria, correct? With filterbuilder and then setting the attached datasource to be the datasource for the filterbuilder and then just doing a fetchDate() or filterData()?
If im supposed to use FilterBuilder in a different way can someonehelp me out?
Id really love to get this going, and could use some help.
Sincerely,
thebravedave
I need access to the OperatorId.Or OperatorId because I need to be able to do a criteria search that will return multiple records that might not show
up with a normal fetchData(Criteria crit).
I found that with fetchData(Criteria) you cant stack your criteria (Like looking for multiple "FirstName" fields with different names.
this led me to AdvancedCriteria. Im attempting to use it with filterbuilder.
Heres my code
ListGrid lGrid = new ListGrid();
MemberData memberData = new MemberData();
ListGridField listgridrecordidField = new ListGridField("MemberId", "ID");
ListGridField firstNameField = new ListGridField("FirstName", "First Name");
ListGridField lastNameField = new ListGridField("LastName", "Last Name");
lGrid.setFields(listgridrecordidField, lastNameField, firstNameField);
lGrid.setDataSource(memberData.getNewMemberData());
FilterBuilder filterBuilder = new FilterBuilder();
AdvancedCriteria aCriteria1 = new AdvancedCriteria("FirstName", OperatorId.IS_NULL);
filterBuilder.setCriteria(aCriteria1);
filterBuilder.setDataSource(lGrid.getDataSource());
lGrid.filterData()
I went with the OperatorId.IS_NULL route instead of my intended OperatorId.Or since none of my values are NULL and I knew this should allow AdvancedCriteria to work as its the simplest example by not returning anything if the filterbuilder was working.
I found that when I run fetchData() or filterData() (after setting up the
advancedcriteria and adding it to the filterbuilder and setting the filterbuilders datasource to be the datasource attached to the listgrid) my listgrid shows all the data from the datasource, and not an empty result since none of my listgridrecords have a null "FirstName".
My code in eclipse doesnt show AdvancedCriteria to have any errors in the signature, as it did before I got SmartGwt 2.1.
This is the correct way to use AdvancedCriteria, correct? With filterbuilder and then setting the attached datasource to be the datasource for the filterbuilder and then just doing a fetchDate() or filterData()?
If im supposed to use FilterBuilder in a different way can someonehelp me out?
Id really love to get this going, and could use some help.
Sincerely,
thebravedave
Comment