History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: COO-139
Type: Bug Bug
Status: In Progress In Progress
Priority: Major Major
Assignee: Pete Butland
Reporter: ashvedov
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Cooee

Combobox doesn't apply visibleRows for the second (and the rest) popup.

Created: 11/Dec/07 11:54 PM   Updated: 11/Nov/08 01:26 PM
Component/s: [General] EchoPointNG Components
Affects Version/s: COOEE-CORE-1.1, COOEE-CORE-1.0.2
Fix Version/s: COOEE-CORE-1.2

File Attachments: 1. Text File Combobox__illegal_width_for_second_call,_memory_leak_in_processDispose.patch (4 kb)

Environment: IE 6 SP2, firefox 2.0.0.11


 Description  « Hide
Combobox doesn't apply visibleRows for the second (and the rest) popup.

First time - popup has width of row with max length, and has visibleRows at height.

Problem 1 - length of row is too large, popup will be much wider than screen! I expect to have width same as combobox width.

Second time (and the rest tries) - popup has the same width as combobox, and no limit to height - height allow to show all rows of combobox.

Problem 2 - visibleRows not applied. I expect to show popup with height of visibleRows.

I found the problem in method EPComboBox.prototype.adjustSize - this.eBox object has width/height for the first popup, and doesn't have width/height for others.

But I don't know the reason of that and don't understand what to do with that.

Source code is

import echopointng.ComboBox;
import java.util.ArrayList;
import java.util.List;
import nextapp.echo2.app.Column;
import nextapp.echo2.app.list.DefaultListModel;
import org.apache.commons.lang.RandomStringUtils;

public class TextComboBox extends Column {

public void init() {
super.init();
ComboBox comboBox = new ComboBox();
int capacity = 50;
List<String> strings = new ArrayList<String>(capacity);
for (int i = 0; i < capacity; i++) { strings.add(RandomStringUtils.randomAscii(i * 10)); }
comboBox.setListModel(new DefaultListModel(strings.toArray()));
comboBox.setListRowCount(10);
comboBox.setAutoRecall(false);
add(comboBox);
}
}



 All   Comments   Change History      Sort Order:
ashvedov - [05/Feb/08 03:55 AM ]
Combobox: illegal width for the second call, memory leak in processDispose

kayven - [04/May/08 12:17 AM - edited ]
The problem occurs because the ebox 's displayed property is set to false, which causes the items in it to not have a height / y position, which in turn causes the adjustSize function to not calculate the height needed for the elements correctly, and so defaults to auto. A possible workaround is to set the displayed property to true (but leave the visible one to false) before the adjustSize function like this (note that scrollToSelection also depends on the height / y position of items) :

in combobox.js , line 312
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Shows the popup list
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EPComboBox.prototype.showListBox = function(echoEvent) {
EP.setDisplayed(this.eBox,true);
this.adjustSize();
this.scrollToSelection();
EP.setDisplayed(this.eBox,false);

// delegate visibility handling to popup click handler
var popup = EP.ObjectMap.get(this.popupId);
if (!popup.isExpanded()) { popup.togglePopup(echoEvent) //popup.onclick(echoEvent); }
};


Daniel Murley - [27/Jul/08 09:42 PM ]
Cheers for the info - i'll try and look into this in the next few days.