Announcement

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

  • SimpleType to outsource more than validation/display?

    Hi Isomorphic,

    I have a short question regarding SimpleType. Searching the forums I found:
    http://forums.smartclient.com/showth...28247&p=111423 which says (...) that have common validation, formatting and other similar behaviors.

    My case is the following. I make heavy use of FKs and have many fields like
    Code:
    <field foreignKey="T_CAMPAIGN.ID" name="CAMPAIGN_ID" displayField="CAMPAIGN_NAME" title="Campaign" type="integer" required="true"></field>
    .

    Is it possible to put these information in a .type.xml file as well and reference it via
    Code:
    <field name="CAMPAIGN_ID" type="myTypeName"></field>
    ?

    Or is the Simple Type system more about display and validation?

    Thanks,
    Blama

  • #2
    This can be done via simpleType.fieldProperties.

    Comment


    • #3
      Hi Isomorphic,

      this doesn't work for me. Should it?

      V_LEAD_UNFINISHED.ds.xml
      Code:
      <field name="CREATED_BY" type="createdByType"></field>
      <field name="CREATED_BY_NAME" type="createdByNameType"></field>
      createdByType.type.xml
      Code:
      <SimpleType name="createdByType" inheritsFrom="text" foreignKey="V_USER_CREATED_BY.ID" displayField="CREATED_BY_NAME" title="Erstellt von"
      	type="int">
      </SimpleType>
      createdByTypeName.type.xml
      Code:
      <SimpleType name="createdByNameType" inheritsFrom="text" includeFrom="V_USER_CREATED_BY.SURNAME" hidden="true">
      </SimpleType>
      project.html
      Code:
      DataSourceLoader?dataSource=createdByNameType, createdByType, V_LEAD_UNFINISHED, ...
      I get a SQL-error saying "V_LEAD_UNFINISHED"."CREATED_BY_NAME": invalid identifier. Also the SQL doesn't include the join it had when all the type.xml attributes were directly in the ds.xml field.
      The order in which I load the types in DSLoader does not change the outcome.

      Is the simpleType system supposed to support this kind of usage?

      Best regards,
      Blama

      Comment


      • #4
        ?

        Well, there's no use of fieldProperties anywhere in there, so no, it should not work.

        Comment


        • #5
          Hi Isomorphic,

          thanks for the fast answer. What exactly do you mean by fieldProperties?
          Code:
          <SimpleType name="createdByType" inheritsFrom="text">
          	<(f|F)ieldProperties foreignKey="V_USER_CREATED_BY.ID" displayField="CREATED_BY_NAME" title="Erstellt von" type="int"></(f|F)ieldProperties>
          </SimpleType>
          does not change anything for me (applied in both type.xml files)

          Best regards,
          Blama

          Comment


          • #6
            Hello Blama,
            We checked this issue. Field fieldProperties works fine in your example (checked on nightly and 4.0). Please check that you loaded type description e.g. using loadDS tag or DataSourceLoader servlet as you do for all datasources. If you still have the issue
            please tell us what exact version of smartgwt library do you use.

            Regards
            Isomorphic Software

            Comment


            • #7
              @All finding this thread via search: This thread is related.

              Comment

              Working...
              X