Browser: Firefox 3.6.6
SmartClient version: Isomorphic SmartClient Framework (SC_SNAPSHOT-2011-01-29/PowerEdition Deployment 2011-01-29)
We're using the DMI validation capability to do field level validation. It seems the DMI code is being called an excessive number of times for each of the fields being validated.
The datasource I'm referring to is defined in XML and has a custom server constructor that we created. The custom server overrides the execute() method.
Four fields are marked for validation using the <validators> tag. Two fields are setup with DMI validators while two others are setup with other types of validators.
Looking at the SmartClient console, I'm seeing that a validation RPC call is made for each of the fields in which validation is requested. That's fine. However, what I'm finding is that for each of these four calls, both DMI objects are being executed. The result is that each of the DMI validator objects is being called four times rather than one. This is a real problem for us since both objects make expensive calls to another server.
The initial call is being done via the saveData() method of a ValuesManager.
Here are the field definitions that include validators (from the datasource definition):
Here's the header from the DataSource definition:
Any thoughts?
Thank you,
Larry
SmartClient version: Isomorphic SmartClient Framework (SC_SNAPSHOT-2011-01-29/PowerEdition Deployment 2011-01-29)
We're using the DMI validation capability to do field level validation. It seems the DMI code is being called an excessive number of times for each of the fields being validated.
The datasource I'm referring to is defined in XML and has a custom server constructor that we created. The custom server overrides the execute() method.
Four fields are marked for validation using the <validators> tag. Two fields are setup with DMI validators while two others are setup with other types of validators.
Looking at the SmartClient console, I'm seeing that a validation RPC call is made for each of the fields in which validation is requested. That's fine. However, what I'm finding is that for each of these four calls, both DMI objects are being executed. The result is that each of the DMI validator objects is being called four times rather than one. This is a real problem for us since both objects make expensive calls to another server.
The initial call is being done via the saveData() method of a ValuesManager.
Here are the field definitions that include validators (from the datasource definition):
Code:
<field name="ISBN" title="ISBN" type="text" length="10" tableName="IPITHDR" canEdit="true" detail="true" menuItem="Description>ISBN"> <validators> <validator type="serverCustom"> <serverObject lookupStyle="new" className="com.islandpacific.gui.server.customDataSource.ISBNValidatorDMI"/> <errorMessage>$ErrorMessage</errorMessage> </validator> </validators> </field>
Code:
<field name="IGTIN" title="GTIN" type="text" length="14" tableName="IPITHDR" canEdit="true" detail="true" defaultValue="" menuItem="Description>GTIN"> <validators> <validator type="serverCustom"> <serverObject lookupStyle="new" className="com.islandpacific.gui.server.customDataSource.GTINValidatorDMI"/> <errorMessage>$ErrorMessage</errorMessage> </validator> </validators> </field>
Code:
<field name="IWHB" title="History from" hint="MMDD" mask="####" type="text" length="4" tableName="IPITHDR" canEdit="true" detail="true" menuItem="Features>Keep History from MMDD"> <validators> <!-- enforces 4 digit MMDD requirement --> <validator type="regexp" expression="([0][1-9]|[1][012])([0][1-9]|[12][0-9]|[3][01])" errorMessage="Invalid MMDD entry." /> </validators> </field>
Code:
<field name="IWHE" title="History to" hint="MMDD" mask="####" type="text" length="4" tableName="IPITHDR" canEdit="true" detail="true" menuItem="Features>Keep History to MMDD"> <validators> <!-- enforces 4 digit MMDD requirement --> <validator type="regexp" expression="(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])" errorMessage="Invalid MMDD entry." /> </validators> </field>
Code:
<DataSource ID="PoItem" dataFormat="iscServer" serverType="sql" webServiceOperations="all" dbName="as400" sparseUpdates="true" tableName="IPPOITM" inheritsFrom="IPPOITM" serverConstructor="com.islandpacific.gui.server.customDataSource.PoItemDS">
Any thoughts?
Thank you,
Larry
Comment