Announcement

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

    Tabbing in SmartGWT grid

    Hi Team,

    We are facing a issue in smartGWT grid. When we tab on grid records, it maintain proper sequence in a row but when it switch from one row to another , tabbing goes to last cell of next row. It is not happening always but sometimes. We tried setting tabindex , and also set property : prepsGrid.setRowEndEditAction(RowEndEditAction.NEXT);

    Sample code :

    private ListGrid createPrepsGrid(int brandId) {
    prepsGrid = new ListGrid();
    prepsGrid.setCanEdit(true);
    prepsGrid.setSelectionType(SelectionStyle.SINGLE);
    prepsGrid.setSelectionAppearance(SelectionAppearance.ROW_STYLE);
    prepsGrid.setShowFilterEditor(false);
    prepsGrid.setRowEndEditAction(RowEndEditAction.NEXT);
    prepsGrid.setShowHeader(true);
    prepsGrid.setID(test);
    prepsGrid.setRowEndEditAction(RowEndEditAction.NEXT);
    prepsGrid.setDataSource(testds)
    prepsGrid.setFields(getProjectListGridFields(prepsGrid.getDataSource(), prepsGrid));

    return prepsGrid;
    }
    public static ListGridField[] getProjectListGridFields(DataSource dataSource, ListGrid listGrid) {
    listGrid.setDataSource(dataSource);
    final List<ListGridField> listGridFields = new ArrayList<>();
    if (dataSource != null) {
    for (final DataSourceField dsField : dataSource.getFields()) {
    listGridFields.add(getValuePickerListGridField(dsField));

    }
    }
    return listGridFields.toArray(new ListGridField[0]);
    }
    public static ListGridField getValuePickerListGridField(final DataSourceField dsField) {
    return getListGridField(dsField.getName(), dsField.getTitle(), dsField.getHidden(), dsField.getCanEdit());
    }
    private static ListGridField getListGridField(final String name, final String title, final Boolean hidden, final Boolean canEdit) {
    final ListGridField listGridField = new ListGridField(name, title);
    listGridField.setHidden(hidden);
    listGridField.setCanEdit(canEdit);
    }

    TestDs :
    <DataSource ID="TestDs" schemaBean="TESTDTO">
    <fields>
    <field name="feild1" align="center" primaryKey="true" hidden="true"/>
    <field name="feild2" align="center" hidden="true"/>
    <field name="feild13" align="center" required="true" baseStyle="hdwprepfield " width="10%" />
    <field name="feild14" align="center" width="10%" title="Deadlock"/>
    <field name="feild15" align="center" baseStyle="hdwprepfield " width="11%" title="Code" />
    </fields>

    Kindly Let us know if you are able to reproduce this issue. Or kindly suggest the alternate tabbing approch to resolve theissue. Thanks in advance.
    Last edited by preeti_kanyal; 29 Jun 2020, 20:58.

    #2
    This code is not runnable as is, and also note that properties such as width, baseStyle and align are not valid in a DataSource. Please provided a corrected and complete test case that has been tested against the latest patched build, and also include your version and the browser(s) affected.

    Comment


      #3
      We are using smartGWT version : 6.1-p20190721
      Also, It is happening in chrome 83.0.4103.116 as well as IE 11.

      private ListGrid createPrepsGrid(int brandId) {
      prepsGrid = new ListGrid();
      prepsGrid.setCanEdit(true);
      prepsGrid.setSelectionType(SelectionStyle.SINGLE);
      prepsGrid.setSelectionAppearance(SelectionAppearance.ROW_STYLE);
      prepsGrid.setShowFilterEditor(false);
      prepsGrid.setRowEndEditAction(RowEndEditAction.NEXT);
      prepsGrid.setShowHeader(true);
      prepsGrid.setID(test);
      prepsGrid.setRowEndEditAction(RowEndEditAction.NEXT);
      prepsGrid.setDataSource(testds)
      prepsGrid.setFields(getProjectListGridFields(prepsGrid.getDataSource(), prepsGrid));

      return prepsGrid;
      }
      public static ListGridField[] getProjectListGridFields(DataSource dataSource, ListGrid listGrid) {
      listGrid.setDataSource(dataSource);
      final List<ListGridField> listGridFields = new ArrayList<>();
      if (dataSource != null) {
      for (final DataSourceField dsField : dataSource.getFields()) {
      listGridFields.add(getValuePickerListGridField(dsField));

      }
      }
      return listGridFields.toArray(new ListGridField[0]);
      }
      public static ListGridField getValuePickerListGridField(final DataSourceField dsField) {
      return getListGridField(dsField.getName(), dsField.getTitle(), dsField.getHidden(), dsField.getCanEdit());
      }
      private static ListGridField getListGridField(final String name, final String title, final Boolean hidden, final Boolean canEdit) {
      final ListGridField listGridField = new ListGridField(name, title);
      listGridField.setHidden(hidden);
      listGridField.setCanEdit(canEdit);
      return listGridField;
      }

      TestDs :
      <DataSource ID="TestDs" schemaBean="TestDTO">
      <fields>
      <field name="feild1" align="center" primaryKey="true" hidden="true"/>
      <field name="feild2" align="center" hidden="true"/>
      <field name="feild13" align="center" required="true"/>
      <field name="feild14" align="center" title="Deadlock"/>
      <field name="feild15" align="center" title="Code" />
      </fields>

      Comment


        #4
        OK, looks like you've done some, but not all of the required actions:

        1. test case still not runnable: references a DTO, no data, still has invalid align properties. Also, when posting code, use CODE tags with hard brackets to avoid all indentation being lost

        2. not tested against latest patched build, or didn't report that

        3. make sure you have tested in a blank project, no customizations, not even a custom skin (previous test case clearly required an external style sheet)

        4. let us know if, for you, there are browsers that are not affected

        5. let us know the OS you're testing on

        Comment

        Working...
        X