Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SelectItem Visible Row Count

    Hi,

    Basically i am looking for a method equivalent to ListBox.setVisibleRowCount(5) in gwt.. Cant find it.

    I want to know how to set the visible row count for SelectItem even if it has no values currently associated with it..

    That is i want there to be say 5 rows showing even if there are no items, 2 items or 100 items. I do not want it to be multiple selection though.



    i have tried the following and combinations of the following but no joy when the initial values are empty.
    Code:
            selectedItemsList = new SelectItem();
            selectedItemsList.setTitle("Selected");
            selectedItemsList.setMultiple(false);
            selectedItemsList.setMultipleAppearance(MultipleAppearance.GRID);
            selectedItemsList.setHideEmptyPickList(false);
            selectedItemsList.setEmptyPickListHeight(120);
            selectedItemsList.setPickListHeight(120);
    Any help is appreciated. Its probably staring me in the face but ..
    Thanks,

    #2
    Thought i'd update the thread since i found a workaround. Maybe somebody else will have had the same problem

    The solution is to simply call setHeight (without calling setPickListHeight) and most importantly **** setMultiple(true) **** instead of false even though i did not want to allow multiple selection. I then simply warn the user if the have selected more than one alternative.

    Kind of annoyed i never got a reply off the forums because i'm still fairly sure there must be another way of doing this without having to call setMultiple(true).

    Code:
            selectedItemsList = new SelectItem();
            selectedItemsList.setTitle("Selected");
            selectedItemsList.setMultiple(true);
            selectedItemsList.setMultipleAppearance(MultipleAppearance.GRID);
            selectedItemsList.setHideEmptyPickList(false);
            //selectedItemsList.setEmptyPickListHeight(120);
            //selectedItemsList.setPickListHeight(120);
            
            selectedItemsList.setHeight(120);

    Comment

    Working...
    X