Hi Isomorphic. I have the following ds descriptor (excerpt shown for brevity):
When I bind the DS to a ListGrid, create/edit a record, and feed a value of 5 for all these fields, the validation passes and the record is saved correctly. But when I use this DS in a server side request, the record is not created because the two validations highlighted above fail. If I remove these two validations from the ds descriptor, records can be correctly added/edited both using the ListGrid or the servlet initiated DSRequest.
The errors I get in SmartGWT's server log are:
The servlet mentioned above is used to process the contents of a file received through an upload operation (declared in a separate DS descriptor and referenced via an operationBinding), which after receiving the uploaded file, parses its contents, and finally tries to create/update records from another DS (the one partially shown above) executing individual server DSRequests for each record found on the file. I already checked the Map<String, Object> record content to make sure that dsRequest.setValues(record) is receiving the correct values (ruling out a parsing error on my part).
Any ideas why this may be happening? At first I thought that maybe $editedRecord wasn't available in the servlet's DSRequest context, but in the ds descriptor I have several other fields that use it for their validations without any problems...
I wan't able to isolate this to a simple test case, but if you need more information, please let me know....
SmartGWT 6.0p 2016-04-12, Chrome 50.0.2661.87 m, Windows 10.
Code:
<field name="buffer_size" required="true"> <title><fmt:message key="bufferbank_bufferSize"/></title> <validators> [B] <validator type="serverCustom"> <serverCondition> <![CDATA[$value >= $editedRecord.minimum_buffer_size]]> </serverCondition> <errorMessage><fmt:message key="bufferbank_bufferSizeInvalid"/></errorMessage> </validator>[/B] </validators> </field> <field name="minimum_buffer_size" required="true"> <title><fmt:message key="bufferbank_minimumBufferSize"/></title> </field> <field name="minimum_replenishment" required="true"> <title><fmt:message key="bufferbank_minimumReplenishment"/></title> <validators> [B] <validator type="serverCustom"> <serverCondition> <![CDATA[($value % $editedRecord.packaging_unit) == 0]]> </serverCondition> <errorMessage><fmt:message key="bufferbank_minimumReplenishmentInvalidMultiplier"/></errorMessage> </validator>[/B] </validators> </field> <field name="packaging_unit" required="true"> <title><fmt:message key="bufferbank_packagingUnit"/></title> </field>
The errors I get in SmartGWT's server log are:
INFO Validation - [builtinApplication.null] Validation error: [
{
minimum_replenishment:{
errorMessage:"Value must be multiple of Packaging Unit."
},
buffer_size:{
errorMessage:"Value must be zero or positive decimal and equal or greater than Minimum Buffer Size."
}
{
minimum_replenishment:{
errorMessage:"Value must be multiple of Packaging Unit."
},
buffer_size:{
errorMessage:"Value must be zero or positive decimal and equal or greater than Minimum Buffer Size."
}
Any ideas why this may be happening? At first I thought that maybe $editedRecord wasn't available in the servlet's DSRequest context, but in the ds descriptor I have several other fields that use it for their validations without any problems...
I wan't able to isolate this to a simple test case, but if you need more information, please let me know....
SmartGWT 6.0p 2016-04-12, Chrome 50.0.2661.87 m, Windows 10.
Comment