Announcement

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

  • validator.dependentFields attribute doesn't split field names

    SmartClient Version: v11.1p_2019-03-09/Enterprise Deployment (built 2019-03-09)

    Hello, I've just noticed that when the dependentFields attribute contains more than one field name, like this:

    Code:
            <field name="ID_LUOGO_SITO_FK" type="integer" foreignKey="ANAG_SITI_LUOGHI.ID_REC" required="true">
                <validators>
                    <validator type="serverCustom" dependentFields="DATA_INIZIO,DATA_FINE,STATUS"
                               errorMessage="Impossibile prenotare la sala, risulta giÓ occupata.">
                        <serverObject lookupStyle="new" className="com.juve.jtc.PrenotazioniSaleDMI"/>
                    </validator>
                </validators>
            </field>
    in the DMI validator the record variable contains an attribute with name = 'DATA_INIZIO,DATA_FINE,STATUS', see screenshot from Intellij debugger:

    Click image for larger version

Name:	Schermata 2019-03-12 alle 12.19.39 PM.png
Views:	1
Size:	11.3 KB
ID:	257141

    so it seems that the value of the dependentFields attribute is not split.

    the alternative syntax is working:

    Code:
            <field name="ID_LUOGO_SITO_FK" type="integer" foreignKey="ANAG_SITI_LUOGHI.ID_REC" required="true">
                <validators>
                    <validator type="serverCustom">
                        <dependentFields>
                            <dependentField>DATA_INIZIO</dependentField>
                            <dependentField>DATA_FINE</dependentField>
                            <dependentField>STATUS</dependentField>
                        </dependentFields>
                        <errorMessage>Impossibile prenotare la sala, risulta giÓ occupata.</errorMessage>
                        <serverObject lookupStyle="new" className="com.juve.jtc.PrenotazioniSaleDMI"/>
                    </validator>
                </validators>
            </field>

  • #2
    Although it's a reasonable guess at syntax, we don't actually document that a comma-separated list of field names should work. Instead, what you called the "alternate syntax" is the standard way to represent multiple values in XML (see dsField.multiple). Are we missing someplace that we showed the comma-separate string version in the forums or in an example?

    Even if not doc'd, it is a reasonable guess at the syntax, and we'll look at making that work as well in future versions.

    Comment


    • #3
      Hi claudiobosticco,

      I struggled with the same problem, but the docs and forums say what Isomorphic is saying, see here for my problem and here for the docs. Here this is discussed in general.

      Best regards
      Blama

      Comment


      • #4
        Well, it turns out that I was convinced to have already used in the past that syntax with multiple fields, but I was wrong, in my codebase I've got only one field in every dependentFields declaration.

        Blama thanks for the links.

        And yes, it would be nice to have the shorthand syntax also in this case.

        Comment

        Working...
        X