Customizer's Guide > Working with XUI (XML-based User Interface) Dialog Boxes > XUI Display Recommendations
  
XUI Display Recommendations
When implementing XUI dialog boxes, you should add as many XUI controls to a dialog box as possible in a single pass to improve the display refresh of XUI dialog boxes.
For example, the following Java code adds ten controls to the dialog box one by one:
Element box = _xui.getElementById("AddControlsBox");
for(int i = 0; i < 10; ++i) {
Element textbox = _xui.createElement("textbox");
box.appendChild(textbox);
}
The dialog box display refresh would be improved by adding all ten controls to the dialog box at once as in the follow example:
DocumentFragment frag = _xui.createDocumentFragment();
for(int i = 0; i < 10; ++i) {
Element textbox = _xui.createElement("textbox");
frag.appendChild(textbox);
}
Element box = _xui.getElementById("AddControlsBox");
box.appendChild(frag);
For optimum display speed when clearing all listitems from a combobox or listbox, delete the items in order beginning with the firstChild.