Announcement

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

    DataSource does not recognize default titleField if uppercased

    Hi,

    According to http://www.smartclient.com/smartgwt/...etTitleField(), if I do specify a titleField on a DataSource, it looks for fields named "title", "label", "name", and "id" in that order.

    I have a field name "NAME", and it's not identified as title. If I change the field name to lowercase, it is recognized. Would it be possible to detect title fields case insensitively?

    (Tested with nighly 02.17)

    Thank you for your help:

    Csillag

    #2
    Good idea. We've made this change

    Thanks
    Isomorphic Software

    Comment


      #3
      On a similar note, I had an issue with TreeGrid and RestDataSource when using setUseAllDataSourceFields(true) and automatic Tree field detection:

      Code:
      treeGrid.setUseAllDataSourceFields(true);
      the datasource definition:

      Code:
              DataSourceTextField idField = new DataSourceTextField("_id", "ID");
              idField.setPrimaryKey(true);
              idField.setCanEdit(false);
              DataSourceTextField parentCategoryId = new DataSourceTextField("parentId", "Parent category");
              parentCategoryId.setForeignKey("._id");
              parentCategoryId.setHidden(true);
              parentCategoryId.setRootValue((String) null);
              parentCategoryId.setCanEdit(false);
              DataSourceTextField title = new DataSourceTextField("title", "Title");
              ....

      The title field appeared in the grid *twice*, once as a tree field, and as a regular column. The only way I got rid of this behavior was explicitly assigning a TreeGridField to the grid:
      Code:
          TreeGridField tgf = new TreeGridField("title", "Title");
          treeGrid.setFields(tgf);
      This isn't a major issue, since I have already found the above workaround, but annoying inconsistency nevertheless.

      regards,
      Andrius J.

      Comment


        #4
        Originally posted by Isomorphic
        Good idea. We've made this change
        It's now working fine. (Tested with nightly 02.23)

        Thank you.

        Comment


          #5
          One more question.

          Currently, if no titleField is specifies, an there is no field with the specified names, the first field is made titleField.

          How about changing this behavior so that the first non-hidden field is made titleField?

          (Making a hidden field title does not make much sense in most use cases.)

          Thank you:

          Csillag

          Comment

          Working...
          X