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

2.5 -> 2.6 Error when adding the first column to the #215

Open
robertpic71 opened this issue Oct 24, 2022 · 3 comments
Open

2.5 -> 2.6 Error when adding the first column to the #215

robertpic71 opened this issue Oct 24, 2022 · 3 comments

Comments

@robertpic71
Copy link

When i update my project from 2.5.0 to 2.6.0 or 2.6.1 my table wont build.

I get: "Cannot read properties of undefined (reading 'isHelpEnabled_0_g$')

TypeError: Cannot read properties of undefined (reading 'isHelpEnabled_0_g$')
at qHk_g$.zGk_g$ [as isHelpEnabled_0_g$] (Column.java:557:1)
at PKk_g$.WKk_g$ [as drawColumnHeader_0_g$] (BaseRenderer.java:322:1)
at dPk_g$.CEk_g$ [as renderColumn_0_g$] (AbstractDataView.java:530:1)
at dPk_g$.qDk_g$ [as insertColumn_6_g$] (AbstractDataView.java:1139:1)
at dPk_g$.CBk_g$ [as addColumn_9_g$] (AbstractDataView.java:1112:1)
at dPk_g$.BBk_g$ [as addColumn_8_g$] (AbstractDataView.java:1150:1)
at l7k_g$.j3k_g$ [as addColumn_8_g$] (AbstractDataTable.java:332:1)
at bu_g$.whl_g$ [as buildTable_0_g$] (MitarbeiterOverlay.java:111:1)
at bu_g$.Nhl_g$ [as onClick_0_g$] (MitarbeiterOverlay.java:198:1)
at Shl_g$.Thl_g$ [as onClick_0_g$] (MitarbeiterOverlay_MitarbeiterViewUiBinderImpl.java:40:1)
at Uch_g$.IJf_g$ [as lambda$2_1_g$] (MaterialWidget.java:1487:1)
at vjg_g$.wjg_g$ [as onClick_0_g$] (MaterialWidget.java:1485:1)
at ERc_g$.FRc_g$ [as dispatch_4_g$] (ClickEvent.java:56:1)
at ERc_g$.GRc_g$ [as dispatch_1_g$] (ClickEvent.java:55:1)
at ERc_g$.wQc_g$ [as dispatch_0_g$] (GwtEvent.java:76:1)
at D_c_g$ (EventBus.java:40:1)

My view ..ui.xml
   <m:MaterialRow marginTop="5" width="98%">
         <m:MaterialColumn ui:field="maPanel" grid="l12 s12 m12">
            <table:MaterialDataTable ui:field="maTable"
									   shadow="1"
									   useCategories="true"
									   useRowExpansion="false"
									   useStickyHeader="false"
			  						    />
         
        </m:MaterialColumn>
    </m:MaterialRow>
    <m:MaterialButton text="Laden" ui:field="btnload"/>
 </ma:overlay.MaterialOverlay>

Java View

@UiField
MaterialDataTable<MitarbeiterDTO> maTable;

...

public void buildTable() {
if (maTable.getColumns().size() > 0) return;

	maTable.setRowFactory(new MitarbeiterRowFactory());
	
	maTable.addColumn(MitarbeiterDTO::getSbrName, "Mitarbeiter");    // error
	maTable.addColumn(MitarbeiterDTO::getAppBezeichnung, "Typ");
	maTable.addColumn(MitarbeiterDTO::getLeZugriff, "Le.Zugriff");
	maTable.addColumn(MitarbeiterDTO::getLeZugriff, "Le.Besuch");

GMW Column.java

public Boolean isHelpEnabled() {
if (helpEnabled == null) {
Boolean defaultHelpEnabled = getDataView().isHelpEnabled();
helpEnabled = defaultHelpEnabled != null ? defaultHelpEnabled : MaterialDataTable.getGlobals().isHelpEnabled(); // << error
}
return helpEnabled;
}

@kevzlou7979
Copy link
Contributor

kevzlou7979 commented Oct 24, 2022 via email

@robertpic71
Copy link
Author

THX.

My dirty work-a-round:

DateColumn<MitarbeiterDTO> leZugriff = new DateColumn<MitarbeiterDTO>() {
   @Override
    public Date getValue(MitarbeiterDTO object) {
         return (object.getLeZugriff());
     }
leZugriff.setDataView(maTable.getView()); // Problem in 2.6.0/1
....
maTable.addColumn("Le.Verwendung", leZugriff);

I could not find the difference to your working demo :/

@kkrupka
Copy link

kkrupka commented Jan 17, 2023

I have the same problem. It's a little curious, as in one table I only get it work when I use above workaround. However, other tables work without the workaround, at least the addColumn call. But there I have a problem with sorting the table; getting a IndexOutOfBoundsException also in the AbstractDataView. I assume it's connected, because in 2.5 everything was working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants