Prevent transfer of data for a single component

Hello

ComboBox box = new ComboBox();
        box.setNullSelectionAllowed(false);
        box.setWidth("60px");
        box.addItem("10");
        box.addItem("11");
        box.addItem("12");
        box.addItem("13");
        box.addItem("14");
        box.addItem("15");
        box.addItem("16");
        box.addItem("17");
        box.addItem("18");
        box.addItem("19");
        box.addItem("20");
        box.addItem("21");
        box.addItem("22");

        box.setValue("12");

        box.setPageLength(4);

        return box;

I have a simple combobox that has the hours of the day in it (not even all the hours…). It seems that when the user clicks on the dropdown button the component gets the data for, say 15-19, from the server. It’s a tiny amount of data so is it possible to make just this one component populate locally entirely?

If yes, is it also possible to get rid of the “1-4/13” at the bottom too? (see attachment)

Thanks!
18953.png

The setPageLength() sets the number of items shown in the selection popup. At least that’s what the API doc for ComboBox says, I’m not sure if I have tried that myself. So, just do cb.setPageLength(13) or something.

thanks yeah thought of that but the ui lives inside a small window embedded in a larger website, so making it bigger actually falls out of the iframe

Ok. Then ComboBox might not be suitable. Perhaps you could select the value with a PopupView or some popup add-on. If you need the text field part of the CB or otherwise need data binding, you’d need to wrap them in CustomField.

There’s also the NativeSelect, but it might behave better; its dropdown might reach outside the iframe.

I’ll give NativeSelect a go first, otherwise a Popup as you say - thanks!