Hi,
According to the docs for SimpleType:
Alhough, as in test case below and print screen attached, default validators are not replaced by supplied list.
MichalG
1.SmartClient Version: v8.3p_2013-02-26/LGPL Development Only (built 2013-02-26)
2. Firefox 3.6.17
3. -
4. -
5.
6. sample code if applicable
According to the docs for SimpleType:
Code:
setValidOperators public void setValidOperators(OperatorId... operators) throws IllegalStateException Set of search operators valid for this type. If not specified, the inheritsFrom type's operators will be used, finally defaulting to the default operators for the basic types (eg integer). Parameters: operators - validOperators Default value is null Throws: IllegalStateException - this property cannot be changed after the underlying component has been created
MichalG
1.SmartClient Version: v8.3p_2013-02-26/LGPL Development Only (built 2013-02-26)
2. Firefox 3.6.17
3. -
4. -
5.
6. sample code if applicable
Code:
package pl.com.tech4.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.DOM; import com.smartgwt.client.core.KeyIdentifier; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.DataSourceField; import com.smartgwt.client.data.SimpleType; import com.smartgwt.client.types.FieldType; import com.smartgwt.client.types.OperatorId; import com.smartgwt.client.util.KeyCallback; import com.smartgwt.client.util.Page; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.form.FilterBuilder; public class MainEntryPoint implements EntryPoint { public void onModuleLoad() { DOM.getElementById("loadingPicture").removeFromParent(); if (!GWT.isScript()) { KeyIdentifier debugKey = new KeyIdentifier(); debugKey.setCtrlKey(true); debugKey.setKeyName("Y"); Page.registerKey(debugKey, new KeyCallback() { public void execute(String keyName) { SC.showConsole(); } }); } layout(); } private void layout() { SimpleType testSimpleType = new SimpleType("test", FieldType.TEXT); testSimpleType.setValidOperators(OperatorId.EQUALS, OperatorId.NOT_EQUAL); testSimpleType.register(); DataSource ds = new DataSource(); DataSourceField fieldA = new DataSourceField(); fieldA.setName("fieldA"); fieldA.setType(testSimpleType); ds.setFields(fieldA); FilterBuilder fb = new FilterBuilder(); fb.setDataSource(ds); fb.draw(); } }
Comment