Hello.
I have my dynamic form with an text item and a canvas item that contains a listgrid.
By default the listgrid takes all the available width space of the form. Perfect.
The problem is that if the textItem’s title is large the whole form overflows because the listgrid takes more space than it should.
Now I don’t want to set fixed width for the title column because I never know the title’s text length, text is dynamically inserted. How can I ensure that the listgrid doesen’t take more space than available in the form?
Here I added an very simple abstract example (just copy paste to run) that simulates my what is happening in my application:
public void onModuleLoad() {
final DynamicForm dynamicForm = new DynamicForm();
dynamicForm.setBorder("3px solid blue");
dynamicForm.setWidth100();
dynamicForm.setMargin(1);
final CanvasItem canvasItem = new CanvasItem();
canvasItem.setTitle("very_very_long_title");
HLayout layout = new HLayout();
layout.setBackgroundColor("#ccc");
canvasItem.setCanvas(layout);
dynamicForm.setFields(canvasItem);
new Timer() {
public void run() {
canvasItem.setTitle("short_title");
dynamicForm.markForRedraw();
}
}.schedule(2000);
dynamicForm.draw();
}
P.S. I am using just an HLayout instead of a list, but the result is the same.