TwinColSelect's highlighted row information is lost

If I change the width of my TwinColSelect or the number of rows displayed with setWidth or setRows the currently highlighted items are lost and every row is unhighlighted in both the available and selected boxes.

I have other buttons on my GUI that manipulate the number of rows displayed and the width of the TwinColSelect and I would like the user’s currently highlighted selections to not be lost just because they changed those settings.

Is my only option to rewrite my code and create my own custom TwinColSelect component?

Thanks for any advice/tips…

So, I’ve decided to make my own TwinColSelect and it is working so far, except I would like to set my
selected
listbox to have the same style as is defined for the TwinColSelect selected box. I could make my own custom style, but I would prefer to use the same one defined for TwinColSelect since it is to be a custom version of it. Using FireFox CSS inspection I saw that “v-select-twincol-selections” is used in themes/chameleon/styles.css. But when I try to set my listbox component’s class to use this by using addClassName or setClassName and passing “v-select-twincol-selections” the listbox rows do not show up in bold. Any ideas why?

themes/chameleon/styles.css


.v-select-twincol-selections {
    font-weight: bold;
}

My code…


lstAvailable = new ListSelect();
lstSelected = new ListSelect();
VerticalLayout buttonsLayout = new VerticalLayout(); 
btnRightArrow = new Button(RIGHT_ARROW_BUTTON_CAPTION, new ArrowButtonClickListener(ArrowButtonClickListener.RIGHT_ARROW));
btnLeftArrow = new Button(LEFT_ARROW_BUTTON_CAPTION, new ArrowButtonClickListener(ArrowButtonClickListener.LEFT_ARROW));
buttonsLayout.addComponent(btnRightArrow);
buttonsLayout.addComponent(btnLeftArrow);
lstAvailable.setSizeFull();
buttonsLayout.setSizeFull();
lstSelected.setSizeFull();
lstAvailable.addStyleName("v-select-twincol-selections");

As noted the “v-select-twincol-selections” style seems to be ignored because the selections are not showing in bold. Thanks in advance for any tips/suggestions.

Not sure if it helps with your problem but I think that Teppo’s
ListBuild
is worth of checking out.