Hi Isomorphic,
please see this minimal testcase. When enabling the setPickListCriteria(), the ComboBoxItem does no longer filter with TextMatchStyle.SUBSTRING, actually it doesn't filter at all.
Best regards,
Blama
Environment:
Client Java:
SQL (Oracle):
T_MODUL.ds.xml:
T_PROJEKT.ds.xml:
please see this minimal testcase. When enabling the setPickListCriteria(), the ComboBoxItem does no longer filter with TextMatchStyle.SUBSTRING, actually it doesn't filter at all.
Best regards,
Blama
Environment:
Code:
Firefox11 Dev Mode v8.2p_2012-08-14/EVAL Deployment 2012-08-14
Code:
package com.smartgwt.sample.client; import com.smartgwt.client.data.Criteria; import com.smartgwt.client.data.Criterion; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.types.OperatorId; import com.smartgwt.client.types.TextMatchStyle; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.ComboBoxItem; import com.smartgwt.client.widgets.form.fields.FormItem; import com.smartgwt.client.widgets.layout.VLayout; import com.google.gwt.core.client.EntryPoint; public class Testcase4 implements EntryPoint { @Override public void onModuleLoad() { VLayout vL = new VLayout() { { setWidth100(); setHeight100(); final DynamicForm testForm = new DynamicForm() { { FormItem nameFI = new FormItem("NAME"); ComboBoxItem prjCBI = new ComboBoxItem("PROJEKT_ID") { { setOptionDataSource(DataSource.get("T_PROJEKT")); setValueField("ID"); setDisplayField("NAME"); setTextMatchStyle(TextMatchStyle.SUBSTRING); //Uncomment the following line to see the bug: //setPickListCriteria(new Criterion("ID", OperatorId.NOT_EQUAL, 1000)); } }; setDataSource(DataSource.get("T_MODUL")); setFields(nameFI, prjCBI); } }; addMember(testForm); } }; vL.draw(); } }
SQL (Oracle):
Code:
DROP TABLE t_modul CASCADE CONSTRAINTS ; DROP TABLE t_projekt CASCADE CONSTRAINTS ; DROP SEQUENCE T_MODUL_ID ; CREATE TABLE t_modul ( id INTEGER NOT NULL, projekt_id INTEGER NOT NULL, name VARCHAR2(10 CHAR) ) ; ALTER TABLE t_modul ADD CONSTRAINT PK_modul PRIMARY KEY ( id ) ; ALTER TABLE t_modul ADD CONSTRAINT UC_t_modul_project_id_name UNIQUE ( projekt_id, name ) ; DROP SEQUENCE T_PROJEKT_ID ; CREATE TABLE t_projekt ( id INTEGER NOT NULL, shortname VARCHAR2(10 CHAR) NOT NULL, name VARCHAR2(50 CHAR) NOT NULL ) ; ALTER TABLE t_projekt ADD CONSTRAINT PK_projekt PRIMARY KEY ( id ) ; ALTER TABLE t_projekt ADD CONSTRAINT UC_t_projekt_shortname UNIQUE ( shortname ) ; ALTER TABLE t_modul ADD CONSTRAINT FK_t_modul_t_projekt FOREIGN KEY ( projekt_id ) REFERENCES t_projekt ( id ) ; CREATE SEQUENCE T_MODUL_ID NOCACHE ORDER ; CREATE OR REPLACE TRIGGER t_modul_BI BEFORE INSERT ON t_modul FOR EACH ROW WHEN(NEW.id IS NULL) BEGIN SELECT T_MODUL_ID.NEXTVAL INTO :NEW.id FROM DUAL; END; / CREATE SEQUENCE T_PROJEKT_ID NOCACHE ORDER ; CREATE OR REPLACE TRIGGER t_projekt_BI BEFORE INSERT ON t_projekt FOR EACH ROW WHEN(NEW.id IS NULL) BEGIN SELECT T_PROJEKT_ID.NEXTVAL INTO :NEW.id FROM DUAL; END; / INSERT INTO T_PROJEKT(SHORTNAME, NAME) VALUES ('1st', 'This includes y.'); INSERT INTO T_PROJEKT(SHORTNAME, NAME) VALUES ('2nd', 'This includes z.'); INSERT INTO T_PROJEKT(SHORTNAME, NAME) VALUES ('3rd', 'This includes z and y.'); COMMIT;
Code:
<DataSource schema="testcase" dbName="Oracle" tableName="T_MODUL" ID="T_MODUL" dataSourceVersion="1" serverType="sql" > <fields> <field primaryKey="true" hidden="true" name="ID" type="sequence"></field> <field name="PROJEKT_ID" title="Projekt" required="true" foreignKey="T_PROJEKT.ID" displayField="PROJEKT_NAME" editorType="selectItem" ></field> <field name="PROJEKT_NAME" hidden="true" required="false" canSave="false" includeFrom="T_PROJEKT.SHORTNAME"></field> <field name="NAME" title="Modulname" required="true" length="10" type="text"></field> </fields> </DataSource>
Code:
<DataSource schema="testcase" dbName="Oracle" tableName="T_PROJEKT" ID="T_PROJEKT" dataSourceVersion="1" serverType="sql" > <fields> <field primaryKey="true" hidden="true" name="ID" type="sequence"></field> <field name="SHORTNAME" title="Kurzname" length="10" type="text" required="true"> <validators> <validator type="isUnique" errorMessage="Jedes Projektkürzel darf nur einmal vergeben werden!"></validator> </validators> </field> <field name="NAME" length="50" type="text" required="true"></field> </fields> </DataSource>
Comment