[MGNLUI-7907] Investigate to recalculate grid on resize/expand Created: 10/Mar/23  Updated: 09/May/23  Resolved: 28/Mar/23

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Spike Priority: Neutral
Reporter: Adam Jones Assignee: Quach Hao Thien
Resolution: Done Votes: 0
Labels: VN-Analysis, VN-Implementation
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: 1.75d Time Spent: 1.75d
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PNG File image-2023-03-10-11-56-39-272.png    
Issue Links:
dependency
is depended upon by MGNLUI-7152 Columns in content app not adapting c... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLUI-7908 Implementation Sub-task Completed Quach Hao Thien  
Template:
Epic Link: Nucleus Quality Maintenance
Sprint: Nucleus 32
Story Points: 5
Team: Nucleus
Work Started:

 Description   

When the Actionbar is collapse for the first time, the ContentViews that contains the Grid, is expanded as expected, but the Grid's width is not recalculate, but keep the same value as before expanded

The reason is, the LayoutManager didn't add the GridConnector to ManagedLayout (layout should be measure in need), and hence the Grid's width was not recalculated as well

But after expand the Actionbar, the LayoutManager adds GridConnector to the list ManagedLayout, so from now on, for every change to layout, the grid will be recalculated.

This could be a bug of vaadin when the grid doesn't work well with expandable layout.

What to do

Try these 2 approaches

  1. Find a proper way to add the GridConnector to LayoutManager com.vaadin.client.LayoutManager#setNeedsHorizontalLayout. This approach requires the understanding of how LayoutManager work.
    pros and cons: cannot prove whether it works
  2. Using Rpc to send an event from ActionbarConnector to tell UI repaints the workbench after the Actionbar is collapsed (e.g using workbench.markAsDirtyRecursive())
    • pros: fix the problem
    • cons: not ensure the performance if the workbench has too many component

Generated at Mon Feb 12 09:50:23 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.