SplitPanel/Form

I have a vertical layout with 2 components: MenuBar and then a SplitPanel
The SplitPanel has 2 components: Table on the left, Form on the right
By default, the splitPosition is set to 100%, and the panel is locked.
When a table item is clicked, the splitPosition is set to 50%, the panel is unlocked, and the item is loaded into the form.
The issue is that the form does not fit neatly inside of the panel (you see a scrollbar). If I refresh the page, it is drawn correctly. What might I check to see about making this work? Thanks.

Hi,

you should provide a code example, which shows the problem. That way, it’s easier to help you :slight_smile:

-Henri

Sorry for the delay. Not sure how to trim the code down for illustration purposes, so I attached the full source.

When the window first loads, you see a table with clickable items.


activationsTable.addListener(
	new Property.ValueChangeListener() {
		
		@Override
		public void valueChange(ValueChangeEvent event) {
			String itemId = (String) event.getProperty().getValue();
			storeForm.setItemDataSource(itemId != null ? activationsTable.getItem(itemId) : null);
		}
		
	}
);

Here is where I set the splitter


public void setItemDataSource(Item newDataSource) {
  setItemDataSource(newDataSource, getVisibleItemProperties());

  store = newDataSource != null ? new Store((String) newDataSource.getItemProperty("id").getValue()) : null;
  
  mainLayout.setSplitPosition(newDataSource == null ? 100 : 50);
  mainLayout.setLocked(newDataSource == null);      
}

Everything works as expected, except it’s like the form in the right panel is too large. If I refresh, it is drawn correctly. If I reposition the splitter, it does not help either. Hope this helps. Thanks.
11303.java (9.93 KB)