Hi, usually i dont have any problem inserting data to Grid, but i got very unique problem that i can’t fix for days.
Why my grid data like this (the row apply all data with the last data column, in my case. like Attachment 1, All row filled with the ‘Balance Available’ data.)?
i tried to reconfigure my grid, and set each column with key. and i got the same result. (if you told me that the data is the problem, its not correct, because i tested it and it return correct data.)
What i do is creating Dialog, and i add Grid to Dialog, i got no problem with different grid.
below is my fullcode for the Dialog below (Attachment 2).
Thank you so much.
EDIT : I tried it with the base entity layout on the grid, it works perfectly. but the placement of each column is not right. so i need to re-position it
Only thing that comes to mind would be equals or hash code problems - your object is an entity and therefore lombok’s data annotation can cause some interesting problems
Also remove the IDs und Keys If you don’t need them. If you don’t use preconfigured columns, it’s also unnecessary to pass Bla.class to the grid’s constructor. So that no columns are created and removed from you again. Additionally I can only see a Component annotation, which in case makes this component a singleton which is impossible
thanks for replying!. i tried to remove @Data annotation, and remove all the unnecessary keys but it still return the same.
im using @Data to other entities and added it to other grid it works perfectly.
and yes. this is Component. and it getting called from the main layout with the Entity data.
below is the result if i dont use any addColumn .
and this is my JPA Query
@Query("select b from PayadvBalance b where b.tpCustomerId = :tpUserId order by b.createdDate desc ")
List<PayadvBalance> findAllByTpCustomerIdOrderByCreatedDateDesc(@Param("tpUserId") String tpUserId);
That Data annotation (and more specifically default equals/hashCode generation in Lombob) should indeed be killed with . It is only legid for immutable classes.
and yeah. im so sorry because english is not my first language so i dont think i understand the article. but i made it simple.
so what i do is remove the unused column and this is the result (below). and maybe i just need to render the result. is there any way to render the data without addColumn? (im using getColumnByKey but it return this error
Cannot invoke "com.vaadin.flow.component.grid.Grid$Column.setRenderer(com.vaadin.flow.data.renderer.Renderer)" because the return value of "com.vaadin.flow.component.grid.Grid.getColumnByKey(String)" is null
```)
