Best way to navigate to first column of first entity in refreshed DataGrid

I have a lookup field and a table attached. They look like this:

<window xmlns="" caption="msg://caption" 
    class="com.paslists.rade.web.batchEntry.BatchEntry" focusComponent="companyLookup"
        <collectionDatasource id="companiesDs" class="com.paslists.rade.entity.Company" view="_minimal">
                <![CDATA[select e from rade$Company e order by e.compname]]>
        <collectionDatasource id="batchhdrsDs"  class="com.paslists.rade.entity.Batchhdr"  view="batchhdr-view">
                <![CDATA[select e from rade$Batchhdr e where in (:component$companyLookup) order by e.batchdate,]]>
        <collectionDatasource id="updtransDs" class="com.paslists.rade.entity.Updtrans" view="updtrans-edit-view">
                <![CDATA[select e from rade$Updtrans e where :ds$]]>
    <dialogMode height="600" width="800"/>
    <layout expand="batchSplit">
        <lookupField id="companyLookup" align="TOP_CENTER" caption="Company" optionsDatasource="companiesDs"
                     required="true"  requiredMessage="Please choose a Company" width="200px"/>
        <split id="batchSplit"  orientation="vertical" pos="300px"  width="100%">
            <vbox id="vboxBatchhdr"  expand="batchGrid"  height="500px"  spacing="true">
                <buttonsPanel height="30px">
                    <button id="addButton" action="batchhdrTable.create" caption="Create Batch"icon="icons/create.png" />
                    <button id="saveButton" action=""  caption="Save Batch"icon="icons/save.png" />
                    <button id="removeButton"  action="batchhdrTable.remove" caption="Delete Batch" icon="icons/remove.png" />
                <grid id="batchGrid"  height="400px" spacing="true">
                        <column flex="6.0"/>
                            <table id="batchhdrTable" editable="true" height="400px" width="650px">
                                    <action id="create" invoke="onAddBatchhdr"/>
                                    <action id="save" invoke="onSaveBatchhdr"/>
                                    <action id="remove"/>
                                    <column id="batchdate" caption="Batch Date" dateFormat="MM/dd/yyyy" editable="true"/>
                                    <column id="id" caption="Batch Number" editable="true"/>
                                    <column id="batchtype" caption="Batch Type" editable="true"/>
                                    <column id="reccount" caption="Count"/>
                                    <column id="totamount" caption="Tot Amount"/>
                                    <column id="username" caption="Entered By"/>
                                <rows datasource="batchhdrsDs"/>

I have a ValueChangeListener on the lookup field created in the ready() function of my AbstractWindow. When the field changes, the listener refreshes the datasource for the table. Once that happens, I want the focus to move to the “batchdate” column of the first row of the table.

        // reload all batch headers when company changes
        companyLookup.addValueChangeListener(e -> {
                Company company = (Company) e.getValue();
            if (!batchhdrsDs.getItemIds().isEmpty()) {
                batchhdrTable.requestFocus(batchhdrsDs.getItem(batchhdrsDs.getItemIds().iterator().next()), "batchdate");

It is not working. When I choose a company, the table populates correctly, but I have to click in the row to move the cursor (and to populate the corresponding updtransDs. I can’t figure out how to set the “current row” in a collection datasource or the corresponding table.

What is the best way to move to the first item in the batchhdrDs collection and then to move to the first field in that row in the table?

Hello, Eric!

This bug corresponds to this issue - and have been already fixed.