Announcement

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

    setTabIndex problem with ListGrids in SGWT 3.0

    Hi Isomorphic,

    we are setting the tab index in some parts of our GUI.
    It seems that starting with SGWT 3.0 the set index is not applied to ListGrids (GridBody) anymore.

    I have downloaded the officially released SGWT 3.0 LGPL, cleared the cache and recompiled.

    You can check it with the code sample below.
    The tab traversal should be: TextItem >> ListGrid (GridBody) >> CechkBoxItem >> Button. But the index I have set to the ListGrid is not used. Instead it is automatically set to "1203", which puts the ListGrid at the end of the tab cycle.

    Code:
    private void testTabIndex() {
    		VLayout vLayout = new VLayout();
    		vLayout.setWidth(400);
    		vLayout.setHeight(200);
    		vLayout.setMembersMargin(15);
    
    		DynamicForm form = new DynamicForm();
    		form.setNumCols(1);
    		TextItem textItem = new TextItem();
    		textItem.setTitle("Tab Index 1");
    		textItem.setTitleOrientation(TitleOrientation.TOP);   
    		textItem.setGlobalTabIndex(1);
    		CheckboxItem cbItem = new CheckboxItem();
    		cbItem.setTitle("Tab Index 3");
    		cbItem.setTitleOrientation(TitleOrientation.TOP);   
    		cbItem.setGlobalTabIndex(3);
    		form.setFields(textItem, cbItem);
    		vLayout.addMember(form);
    
    		final ListGrid countryGrid = new ListGrid();
    		countryGrid.setWidth(500);
    		countryGrid.setHeight(224);
    		countryGrid.setShowAllRecords(true);
    
    		ListGridField nameField = new ListGridField("countryName", "Tab Index 2");
    		countryGrid.setFields(nameField);
    		countryGrid.setCanResizeFields(true);
    
    		ListGridRecord[] result = new ListGridRecord[2];
    		result[0] = new ListGridRecord();
    		result[0].setAttribute("countryName", "England");
    		result[1] = new ListGridRecord();
    		result[1].setAttribute("countryName", "France");
    		countryGrid.setData(result);
    
    		// add list grid
    		countryGrid.setTop(80);
    		countryGrid.setTabIndex(2);
    		vLayout.addMember(countryGrid);
    
    		IButton button = new IButton("Tab Index 4");
    		button.setSize("300", "20");
    		button.setTabIndex(4);
    		vLayout.addMember(button);
    		vLayout.draw();
    		textItem.focusInItem();
    	}

    Best regards,
    Manuel

    #2
    Hi,

    our ListGrids have to be accessible by keyboard as our application has to comply with accessibility demands.

    We cannot update to SGWT 3.0 because of this issue.
    Is there a way to manually set the tab index to the ListGrid/GridBody in SGWT 3.0 or is this a bug?

    Best regards,
    Manuel

    Comment


      #3
      It's already accessible by default. We wouldn't recommend trying to set your own tabIndexes as there are many automatically generated components you wouldn't be setting up correctly, and there is also the case of creating a closed tab loop for modal dialogs which you almost certainly are not handling.

      Comment


        #4
        Hi,

        I know that it is not recommended to set the tab index manually. But we have some complex editors where this approach proved to work better for us. Therefore we have been using it for a while now.

        In think that even though it is not recommend to set the index manually it must be applied to the ListGrid as before.

        Best regards,
        Manuel

        Comment


          #5
          Sorry, a ListGrid requires all kinda of complex interior tab management and needs to span a range of indices. Setting it to a single index does not make sense and could not actually lead to an accessible UI, so it's not something we'd try to support.

          Comment


            #6
            Hi Isomorphic,

            when the index is autogenerated you are already setting a single (initial) index to make the ListGrid accessible.
            In the example I have posted you can see that the index is set to the <div> containing the GridBody object.

            Code:
            <div 
            ... class="gridBody" 
            ... tabIndex="1203"
            I can understand that the complex interior needs a range of indices.
            I guess it is somehow based on this initial index set to the GridBody.
            Isn't it possible to base the range of indices on the manually set tab index? It seems it has been possible before 3.0.

            I have noticed that you have removed the method overloading of setTabIndex in the ListGrid.js. It forwarded the tab index setting to the header and body:

            Code:
            // Override _setTabIndex to also set the tab index of the header and body
            _setTabIndex : function (index, auto,a,b) {
            ...
            Does this really mean you don't want to support the manual setting of a tab index to ListGrids anymore.
            It should be mentioned somewhere, e.g. JavaDoc or even in the release notes.

            We would really appreciate if you don't stop the support of this functionality.

            Best regards,
            Manuel

            Comment


              #7
              Once again, from our perspective, we're not desupporting any meaningful feature. There is no way that setting a custom tab index on a ListGrid could possibly lead to an accessible UI as far as we can tell.

              Take a look at what you're trying to achieve in terms of tab order and try to achieve it without taking this untenable approach.

              Comment


                #8
                Sorry, maybe I haven't been clear enough.

                We have been successfully using the method setTabIndex() on the ListGrid in our product at many customers for a long time. Using SGWT 2.4. and SGWT 2.5.

                Regards,
                Manuel

                Comment


                  #9
                  Hi Manuel
                  We've added some logic to the 3.1d branch which will re-support explicitly specifying a TabIndex on a ListGrid.
                  The change will show up in the next nightly build on the 3.1d branch (Feb 6 or greater). Please let us know if this doesn't work for you

                  Thanks
                  Isomorphic Software

                  Comment


                    #10
                    Hi Isomorphic,

                    thanks a lot. It is working fine for me.

                    Best regards,
                    Manuel

                    Comment

                    Working...
                    X