Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355353

Summary: ComboViewer with AutoComplete - Javascript error occurred: 'this._rows.length' is null or not an object
Product: [RT] RAP Reporter: Beirti O'Nunain <beirti.x.onunain>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Beirti O'Nunain CLA 2011-08-22 05:36:51 EDT
Build Identifier: 20110218-0911

I can reproduce this every time using Eclipse RAP 1.4.0.20110614-2335. The error message is the same as that listed in the following bugs, but neither bug mentions ComboViewer.
- 351127
- 349649

Full code to display the error is below. I am unsure if the size of the content proposal list is relevant to the error so I have included the full verbose list I am using.

[code]
import org.eclipse.jface.fieldassist.AutoCompleteField;
import org.eclipse.jface.fieldassist.ComboContentAdapter;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.rwt.lifecycle.IEntryPoint;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class RAPEntryPoint implements IEntryPoint
{
	static enum Nationality
	{
		Afghan, Albanian, Algerian, American, Andorran, Angolan, Antiguans, Argentinean, Armenian, Australian, Austrian, Azerbaijani, Bahamian, Bahraini, Bangladeshi, Barbadian, Barbudans, Batswana, Belarusian, Belgian, Belizean, Beninese, Bhutanese, Bolivian, Bosnian, Brazilian, British, Bruneian, Bulgarian, Burkinabe, Burmese, Burundian, Cambodian, Cameroonian, Canadian, Cape_Verdean, Central_African, Chadian, Chilean, Chinese, Colombian, Comoran, Congolese, Costa_Rican, Croatian, Cuban, Cypriot, Czech, Danish, Djibouti, Dominican, Dutch, East_Timorese, Ecuadorean, Egyptian, Emirian, Equatorial_Guinean, Eritrean, Estonian, Ethiopian, Fijian, Filipino, Finnish, French, Gabonese, Gambian, Georgian, German, Ghanaian, Greek, Grenadian, Guatemalan, Guinea_Bissauan, Guinean, Guyanese, Haitian, Herzegovinian, Honduran, Hungarian, Icelander, Indian, Indonesian, Iranian, Iraqi, Irish, Israeli, Italian, Ivorian, Jamaican, Japanese, Jordanian, Kazakhstani, Kenyan, Kittian_and_Nevisian, Kuwaiti, Kyrgyz, Laotian, Latvian, Lebanese, Liberian, Libyan, Liechtensteiner, Lithuanian, Luxembourger, Macedonian, Malagasy, Malawian, Malaysian, Maldivan, Malian, Maltese, Marshallese, Mauritanian, Mauritian, Mexican, Micronesian, Moldovan, Monacan, Mongolian, Moroccan, Mosotho, Motswana, Mozambican, Namibian, Nauruan, Nepalese, Netherlander, New_Zealander, Ni_Vanuatu, Nicaraguan, Nigerian, Nigerien, North_Korean, Northern_Irish, Norwegian, Omani, Pakistani, Palauan, Panamanian, Papua_New_Guinean, Paraguayan, Peruvian, Polish, Portuguese, Qatari, Romanian, Russian, Rwandan, Saint_Lucian, Salvadoran, Samoan, San_Marinese, Sao_Tomean, Saudi, Scottish, Senegalese, Serbian, Seychellois, Sierra_Leonean, Singaporean, Slovakian, Slovenian, Solomon_Islander, Somali, South_African, South_Korean, Spanish, Sri_Lankan, Sudanese, Surinamer, Swazi, Swedish, Swiss, Syrian, Taiwanese, Tajik, Tanzanian, Thai, Togolese, Tongan, Trinidadian_or_Tobagonian, Tunisian, Turkish, Tuvaluan, Ugandan, Ukrainian, Uruguayan, Uzbekistani, Venezuelan, Vietnamese, Welsh, Yemenite, Zambian, Zimbabwean;
	}

	@Override
	public int createUI()
	{
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setLayout(new FillLayout());
		new ComboViewerBug(shell, SWT.NONE);

		shell.open();

		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}

		display.dispose();
		return 0;
	}

	private class ComboViewerBug extends Composite
	{
		private Combo		combo;
		private ComboViewer	comboViewer;

		public ComboViewerBug(Composite parent, int style)
		{
			super(parent, style);
			createContents();
		}

		private void createContents()
		{
			setLayout(new GridLayout(1,false));
			{
				comboViewer = new ComboViewer(this, SWT.NONE);
				combo = comboViewer.getCombo();
				combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

				comboViewer.setContentProvider(new ArrayContentProvider());
				comboViewer.setLabelProvider(new LabelProvider());
				comboViewer.setInput(Nationality.values());
				
				String[] proposals = new String[Nationality.values().length];
				for (int i = 0; i < Nationality.values().length; i++) {
					proposals[i] = Nationality.values()[i].toString();
				}

				new AutoCompleteField(combo, new ComboContentAdapter(), proposals);
			}
		}

		@Override
		protected void checkSubclass()
		{
		}
	}

}
[/code]

Reproducible: Always

Steps to Reproduce:
1. Use code above as the EntryPoint class
2. Start as RAP application inside Eclipse Browser
3. Start typing quickly and pressing backspace quickly. Repeat a few times and the screen blanks and shows the javascript error.
Comment 1 Ivan Furnadjiev CLA 2011-08-22 05:53:44 EDT
I will close this bug as a duplicate of bug 349649. Bug 349649 has been fixed in v14_Maintenance branch and will be part of 1.4 SR1. It does not affect the 1.5 stream. Please reopen if the bug persist with v14_Maintenance branch or CVS HEAD.

*** This bug has been marked as a duplicate of bug 349649 ***