ListBox Scroll bar

I have listbox whos data are populated at run time.

 <split id= "split1" splitterPosition="70" minWidth="100%">
                <vbox id="vBox2" width="100%" spacing="false" expand="vBox4">
                    <hbox width="100%">
                        <h5 text="I am SheelAI, a legal assistant AI specialized in Indian Legislation." width="100%" classNames="sectionLabel"/>
                    </hbox>
                    <vbox id="vBox4" spacing="false" padding="false" width="100%" expand="messageListBox">
                        <listBox id="messageListBox"/>
                    </vbox>
                    <hbox id="vBox6" width="100%">
                    </hbox>
                </vbox>

The data is rendered using rendrer.

The listbox doesnot show scrollbar but force full view to scroll.

How to solve this.

Regards and Thanks

Hi,

Define correct size for listBox.

Regards,
Gleb

@gorelov
That doesnot make any difference if it is in %. Do expand=“messageListBox” will not work?

As far as I see from your code snippet: your <split> which contains vBox2 which expands vBox4 which expands listBox has minWidth="100%" which doesn’t prevent it from growing bigger. As a result you have a page scrollbar instead of listBox.

@gorelov ,

Firstly i am getting verticle scroll bar.

This is my xml

  <split id= "split1" splitterPosition="70"  height="100%">-->
                <vbox id="vBox2" width="100%" expand="vBox4" padding="false" height="100%">
                    <hbox width="100%" spacing="false" padding="false">
                        <h5 text="I am SheelAI, a legal assistant AI specialized in Indian Legislation." width="100%" classNames="sectionLabel"/>
                    </hbox>
                    <vbox id="vBox4" spacing="false" padding="false" width="100%" expand="messageListBox">
                        <listBox id="messageListBox" itemsContainer="userInteractionsDc"/>
                    </vbox>
                    <hbox id="vBox6" width="100%" spacing="false" padding="false" classNames="px-m py-s bg-contrast-5">
                    </hbox>
                </vbox>

This is image
Screenshot 2025-04-02 151936

Just wite messageListBox.setHeight(“100px”); in oninit, (any px). Things become ok.

See the image
Screenshot 2025-04-02 152325

No effect if you write messageListBox.setHeight(“100%”);

If we set height in oninit the list box height will not be that px but message list will expant to fill vbox.

This is my trial and error for 4 hrs.

If you still need my help with the layout, please attach a demo project that reproduces the problem. Unfortunately, I cannot investigate the scroll issue from a part of the view you provided.

I still require your help as if another listbox is added with custom rendering the proble resurface again. I will try to make a demo and then come back (if i can think of similar situation)

Thanks again