Titan
Titan

Reputation: 2903

How to disable Sap Business One form's default resizing behavior?

I'm developing the custom UI layout system for our custom SBO forms. I.e. catching form's resize event and arranging the controls according to our specific layout logic. The problem is that, apparently, SBO tries to arrange controls according to its (clunky and primitive) logic on every form resize first! My code handling the resize event and rearranging the items works, but there is a noticeable performance delay, as items are essentially re-positioned twice on each form resize - once by SBO itself, and then by my code.

Is there any way to stop SBO arranging controls on our custom forms during resize, so that they will be positioned only once by my code (in the resize event handler)?

Upvotes: 2

Views: 1460

Answers (1)

Zac Faragher
Zac Faragher

Reputation: 1001

This page by Boyum IT helps to explain what the resizing rules are. There's additional information on this page

To summarize those pages, every form is split into 4 quadrants, which are effectively pinned to the corners of the form that they belong to. That means that as you resize the form, these quadrants separate from each other, leaving large sections of space between them.

I don't believe that there's an easy way to prevent this behavior out of the box, but you can manually override it using the B1 UI API, by setting the LinkTo property of the Items to match the ID of one of the Items in the top left quadrant, which causes the given item to move with the same behavior as that of the item specified in LinkTo.

Upvotes: 2

Related Questions