Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataGrid.ItemClickEvent always returns null for columnId value #2000

Closed
glebfox opened this issue Mar 27, 2019 · 1 comment
Closed

DataGrid.ItemClickEvent always returns null for columnId value #2000

glebfox opened this issue Mar 27, 2019 · 1 comment
Assignees
Labels
state: fixed Fixed by the developer type: regression ver: 7.0.4 Fixed in version ver: 7.1.0 Fixed in version
Milestone

Comments

@glebfox
Copy link
Member

glebfox commented Mar 27, 2019

Environment

  • Platform version: 7.0.3

Description of the bug or enhancement

  • Minimal reproducible example
<window xmlns="http://schemas.haulmont.com/cuba/screen/window.xsd">
    <data>
        <collection id="customersDc"
                    class="com.haulmont.sampler.entity.Customer"
                    view="_local">
            <loader id="customersLoader">
                <query>
                    <![CDATA[select e from sampler$Customer e]]>
                </query>
            </loader>
        </collection>
    </data>
    <layout expand="customersDataGrid">
        <dataGrid id="customersDataGrid"
                  dataContainer="customersDc"
                  width="100%">
            <actions>
                <action id="create" type="create"/>
                <action id="edit" type="edit"/>
                <action id="remove" type="remove"/>
                <action id="excel" type="excel"/>
                <action id="greeting"
                        caption="Greeting"/>
            </actions>
            <columns>
                <column id="nameId" property="name"/>
                <column property="lastName"/>
                <column property="age"/>
                <column property="active"/>
                <column property="grade"/>
            </columns>
            <buttonsPanel>
                <button action="customersDataGrid.create"/>
                <button action="customersDataGrid.edit"/>
                <button action="customersDataGrid.remove"/>
                <button action="customersDataGrid.excel"/>
                <button action="customersDataGrid.greeting"/>
            </buttonsPanel>
        </dataGrid>
    </layout>
</window>
@UiController("datagrid-actions")
@UiDescriptor("datagrid-actions.xml")
@LoadDataBeforeShow
public class DataGridActionsSample extends ScreenFragment {
    @Inject
    private Notifications notifications;

    @Subscribe("customersDataGrid")
    private void onCustomersDataGridItemClick(DataGrid.ItemClickEvent<Customer> event) {
        notifications.create()
                .withCaption(event.getColumnId())
                .show();
    }
}
  • Expected behavior

event.getColumnId() returns either column Id or property Id

  • Actual behavior

event.getColumnId() returns null

@pribavkindenis
Copy link
Contributor

For QA:
See com.haulmont.cuba.web.gui.components.WebAbstractDataGrid#onItemClick

@natfirst natfirst added the state: fixed Fixed by the developer label Apr 9, 2019
@natfirst natfirst closed this as completed Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: fixed Fixed by the developer type: regression ver: 7.0.4 Fixed in version ver: 7.1.0 Fixed in version
Projects
None yet
Development

No branches or pull requests

4 participants