Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • Isomorphic
    replied
    There was an issue, fixed a couple of months ago, where certain special characters might not appear in a hover. Retest with the latest and you should see this corrected.

    However as far as the initial, seemingly unrelated report of validators being applied to the wrong field, this report is still unique amongst all users ever, and we don't have a speculation as to the cause.

    Leave a comment:


  • agalataud
    replied
    I double checked that what is loaded on client is not loaded from cache.
    Just now, I've been able to reproduce the problem on a dev environment, using an i18n language pack containing lot of accented and special characters (french).

    The key-value pair in this bundle is:
    Code:
    validator.code=Charactères invalides, espace, et charactères accentués
    In the logs, I get something that looks valid:
    Code:
    === 2014-06-10 14:34:53,878 [0-11] INFO  Validation - [builtinApplication.businessUnit_validate] Validation error: [
        {
            CODE:{
                errorMessage:"Charactères invalides, espace, et charactères accentués"
            }
        }
    ]
    However in the screen, the message is: "Charactères invalides, espace, et charactères accentués.
    Charactères invalides"

    Part of the value is repeated. In some cases, I have the value repeated 3 times, fully.

    Could it be that values in i18n bundles are not XML/JS escaped in SmartGWT when dealing with validators?

    Leave a comment:


  • Blama
    replied
    Hi Antoine,

    that's one for Isomorphic.

    But what you can do, as the regex is a client side validator: When you experience the error on a client in FF, hit F12 and examine the reply of the DataSourceLoader-Servlet called at startup.
    You might have to use FF with F12-tools open all the time or use some other way to get to the reply-content. If you see a reply for your DS-Id not matching your .ds.xml, there is definitely something wrong.

    What could be the reason is caching. I remember getting weird errors like yours (more not matching field definitions than validators) a long time ago. I think these were introduced by the browser caching the DataSourceLoader result which then in return did not match what the server thought the client was using.
    So please make sure that your GET to DataSourceLoader is always a real HTTP 200, no 304 and not served from cache.

    Best regards,
    Blama
    Last edited by Blama; 10 Jun 2014, 08:36.

    Leave a comment:


  • agalataud
    replied
    Hi,

    We still have the problem from time to time. I found the issue disappears when application is restarted, making me think validators retrieved from ds.xml on server side get messed up at some point. When problem occurs, all clients are impacted, no matter if we clean client cache.

    So far, I haven't been able to reproduce it in development mode, only on a compiled and deployed application. There is nothing in logs like an exception or something related to an error when DS are loading.

    Following is the DS declaration for which the problem has appeared today:
    Code:
    <DataSource
        ID="cif_document"
    	useAnsiJoins="true"
    	serverType="sql"
    	tableName="CIF_DOCUMENT"
    	serverConstructor="com.fircosoft.cdb.fatca.server.DocumentDataSource"
    	audited="true"
    	titleField="REFERENCE"
    >
        <fields>
        	<field name="ID" type="sequence" sequenceName="SQ_CIF_DOCUMENT" hidden="true" primaryKey="true" />
            <field name="CUSTOMER_ID" type="integer" hidden="true" />
            <field name="TYPE_ID" type="integer" foreignKey="cif_document_type.ID" hidden="true" required="true" />
            <field name="TYPE" type="text" includeFrom="cif_document_type.NAME" />
            <field name="REFERENCE" type="text" required="true" length="64"/>
            <field name="COUNTRY_ID" type="integer" foreignKey="geo_country.ID" hidden="true" required="true" />
            <field name="COUNTRY" type="text" includeFrom="geo_country.NAME" />
            <field name="ISSUE_DATE" type="date" />
            <field name="EXPIRY_DATE" type="date" />
            <field name="DESCRIPTION" type="text" length="1024"/>
            <field name="ATTACHMENT_ID" type="integer" foreignKey="attachment.ID" hidden="true" joinType="outer" />
            <field name="ATTACHMENT_CREATED" type="creatorTimestamp" includeFrom="attachment.CREATED" />
            <field name="ATTACHMENT_CREATED_BY" type="integer" includeFrom="attachment.CREATED_BY" />
            <field name="ATTACHMENT_FILENAME" type="text" includeFrom="attachment.ATTACHMENT_FILENAME" />
            <field name="ATTACHMENT_FILESIZE" type="integer" includeFrom="attachment.ATTACHMENT_FILESIZE" />
            <field name="CREATED" type="creatorTimestamp" title="$created" />
            <field name="CREATED_BY" type="integer" title="$createdBy" />
            <field name="UPDATED" type="modifierTimestamp" title="$updated" />
            <field name="UPDATED_BY" type="integer" title="$updatedBy" />
        </fields>
    A custom validator is applied on DESCRIPTION field, while no such validator is declared in the DS (but in another DS).
    See screenshot attached.

    Regards
    Antoine
    Attached Files

    Leave a comment:


  • Blama
    replied
    Hi agalataud,

    the error is shown for field1 ("CODE") together with the error message from field1 ("CODE"). So no mismatch there IMO.

    Please note that your regex has no valid syntax (at least in Notepad++).

    Most likely it should be ^[A-Za-z0-9\-_//,\.]*$ or ^[A-Za-z0-9\-_//,\\\.]*$ in order to match your test-string "TEST/\".

    Best regards,
    Blama

    Leave a comment:


  • Isomorphic
    replied
    No, there's nothing obviously wrong with the validator definitions.

    Sorry, we've never seen an issue like this and we have no theory as to how a framework issue could cause this - there's nothing more we can do unless you can provide a way to reproduce it.

    Leave a comment:


  • agalataud
    started a topic Validator called on the wrong field

    Validator called on the wrong field

    Hi,

    We're currently running SmartGWT Power edition 4.1 (v9.1p_2014-03-16/PowerEdition Deployment 2014-03-16).
    One of our test site is suffering a problem that we're not able to reproduce on all other sites, neither in gwt dev mode.

    The problem is with a form validation on a datasource that contains 2 fields with 2 validators each. When validating the form, regexp validator of the 2nd field is applied to the 1st.

    This is clear when we test 2 invalid values handled by each regexp validator: error messages from field 1 validator and from field 2 validator are shown. See screenshot in attachment.

    Definition of the validators in ds.xml:
    Code:
    <field name="CODE" type="text" title="$code" escapeHTML="true" length="16" required="true">
      <validators>
    	<validator type="isUnique" criteriaFields="DELETED" requiresServer="true" errorMessage="This code is already used."/>
    	<validator type="regexp" expression="^[A-Za-z0-9-_//,\.]*$" errorMessage="Invalid characters : space, (&gt;&lt;\ and accented characters"/>
      </validators>
    </field>
    <field name="NAME" type="text" title="$name" escapeHTML="true" required="true" length="32">
      <validators>
    	<validator type="isUnique" criteriaFields="DELETED" requiresServer="true" errorMessage="This name is already used."/>
    	<validator type="regexp" expression="^[^&gt;&lt;/\\]*$" errorMessage="Invalid characters (&gt;&lt;/\"/>
      </validators>
    </field>
    Is there something incorrect in the validators declaration?

    Thanks for your help in advance
    Regards
    Antoine
    Attached Files
Working...
X