Hi Isomorphic,
please see this test case based on 5.1p (v10.1p_2016-06-09) which shows a serverCustom validator problem related to the one you fixed here and a problem, where a hasRelatedRecord-validator tries to search for a null-record and fails.
BuiltInDS.java:
BuiltInDS.html addition:
children.ds.xml:
Testfile.csv:
If you upload the file, it looks like this:
As you can see, the eitherOr Validator was not fired for row 2. This is bug 1.
Now remove all Parent/Fav Items so that it looks like this:
Again the EitherOr-validator is not fired.
After commit, you'll see this log in the developer console:
As you can see, for the rows 1,3,4 you edited, there is a validation error from the EitherOr-validator (OK) and one from the hasRelatedRecord-validator (not OK, this is bug 2). The failure for row 2 is expected.
The SQL fired for the hasRelatedRecord-validator error messages are:
This is wrong, hasRelatedRecord should not fire for a null-entry.
Both these fire-or-not validator problems are related to the one you fixed here.
This is an important one for me.
Best regards
Blama
please see this test case based on 5.1p (v10.1p_2016-06-09) which shows a serverCustom validator problem related to the one you fixed here and a problem, where a hasRelatedRecord-validator tries to search for a null-record and fails.
BuiltInDS.java:
Code:
package com.smartgwt.sample.client; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.Version; import com.smartgwt.client.core.KeyIdentifier; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.util.Page; import com.smartgwt.client.util.PageKeyHandler; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.BatchUploader; import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.layout.VLayout; public class BuiltInDS implements EntryPoint { private VLayout mainLayout; private IButton recreateBtn; public void onModuleLoad() { KeyIdentifier debugKey = new KeyIdentifier(); debugKey.setCtrlKey(true); debugKey.setKeyName("D"); Page.registerKey(debugKey, new PageKeyHandler() { public void execute(String keyName) { SC.showConsole(); } }); mainLayout = new VLayout(20); mainLayout.setWidth100(); mainLayout.setHeight100(); recreateBtn = new IButton("Recreate"); recreateBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { recreate(); } }); mainLayout.addMember(recreateBtn); recreate(); mainLayout.draw(); } private void recreate() { Window w = new Window(); w.setWidth("95%"); w.setHeight("95%"); w.setMembersMargin(0); w.setModalMaskOpacity(70); w.setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")"); w.setTitle("TITLE" + w.getTitle()); w.setShowMinimizeButton(false); w.setIsModal(true); w.setShowModalMask(true); w.centerInPage(); final BatchUploader bu = new BatchUploader(); bu.setWidth(500); bu.setUploadDataSource(DataSource.get("children")); ListGridField name = new ListGridField("Name"); ListGridField parent = new ListGridField("Parent"); ListGridField favItem = new ListGridField("FavItem"); bu.setGridFields(name, parent, favItem); w.addItem(bu); w.show(); } }
Code:
<script src="builtinds/sc/DataSourceLoader?dataSource=batchUpload,supplyItem,animals,employees,children"></script>
Code:
<DataSource xmlns="lmscompany/ds" ID="children" serverType="sql" tableName="foobar"> <fields> <field name="Name" type="text" length="20" required="true" /> <field name="Parent" editorType="ComboBoxItem" importStrategy="display" displayField="Employees_Name" uploadFieldName="Parent" foreignKey="employees.EmployeeId"> <validators> <validator type="serverCustom"> <serverObject lookupStyle="new" className="com.smartgwt.sample.server.listener.EitherOr" /> <errorMessage>$errorMessage</errorMessage> </validator> <validator type="hasRelatedRecord" /> </validators> </field> <field name="Employees_Name" includeFrom="employees.Name" /> <field name="FavItem" editorType="ComboBoxItem" importStrategy="display" displayField="supplyItem_itemName" uploadFieldName="FavItem" foreignKey="supplyItem.itemID"> <validators> <validator type="serverCustom"> <serverObject lookupStyle="new" className="com.smartgwt.sample.server.listener.EitherOr" /> <errorMessage>$errorMessage</errorMessage> </validator> <validator type="hasRelatedRecord" /> </validators> </field> <field name="supplyItem_itemName" includeFrom="supplyItem.itemName" /> </fields> </DataSource>
Code:
"Name","FavItem","Parent" "Joe","Glue UHU Super Glue 3ml","Charles Madigen" "Anna","","" "Sophia","","Ralph Brogan" "Carol","File Half Arch Board Foolscap Black",""
If you upload the file, it looks like this:
As you can see, the eitherOr Validator was not fired for row 2. This is bug 1.
Now remove all Parent/Fav Items so that it looks like this:
Again the EitherOr-validator is not fired.
After commit, you'll see this log in the developer console:
As you can see, for the rows 1,3,4 you edited, there is a validation error from the EitherOr-validator (OK) and one from the hasRelatedRecord-validator (not OK, this is bug 2). The failure for row 2 is expected.
The SQL fired for the hasRelatedRecord-validator error messages are:
Code:
SELECT supplyItem.itemID, supplyItem.itemName, supplyItem.SKU, supplyItem.description, supplyItem.category, supplyItem.units, supplyItem.unitCost, supplyItem.inStock, supplyItem.nextShipment FROM supplyItem WHERE ([B]supplyItem.itemID IS NULL[/B]) SELECT employeeTable.userOrder, employeeTable.Name, employeeTable.EmployeeId, employeeTable.ReportsTo, employeeTable.Job, employeeTable.Email, employeeTable.EmployeeType, employeeTable.EmployeeStatus, employeeTable.Salary, employeeTable.OrgUnit, employeeTable.Gender, employeeTable.MaritalStatus FROM employeeTable WHERE ([B]employeeTable.EmployeeId IS NULL[/B])
Both these fire-or-not validator problems are related to the one you fixed here.
This is an important one for me.
Best regards
Blama
Comment