Community
Participate
Working Groups
Created attachment 247474 [details] Pictures RAP Version: 2.0 + 2.3 (two different applications) Browser: Internet Explorer 10 Fields: Combo cboManufacturer; AutoCompleteField cboManufacturerAutoComplete; In this case itβs possible to select the content from a list via mouse (no issue, no wrong display) or using the keyboard and entered it into a combo field. This creates either a new entry into the list or the content is found and taken over by the automatic text search (AutoCompleteField). Afterwards the content will be saved. The issue only happens if we take the keyboard. See attached Pictures! The wrong display appears after a new entry via keyboard was created or selected from the list and saved. Even if the form will be changed the wrong window will be shown. Code examples: 1. Create fields: private void createFormControlsMould(Composite parent) { cboManufacturer = AbstractTestRunFormPart.createCombo( result ); cboManufacturerAutoComplete = new AutoCompleteField( cboManufacturer, new ComboContentAdapter(), ModelProvider.getInstance().getTestRunMouldManufacturer() ); } 2. Set data: public void setData( Object dataObject ) { input = ( TestRun )dataObject; cboManufacturer.setItems( ModelProvider.getInstance().getTestRunMouldManufacturer() ); cboManufacturer.setText( input.getMouldManufacturer() ); cboManufacturerAutoComplete.setProposals( cboManufacturer.getItems() ); } 3. Save: public void save() { String manufacturer = cboManufacturer.getText(); if( manufacturer != null ) { this.input.setMouldManufacturer( manufacturer ); } else { this.input.setMouldManufacturer( "" ); //$NON-NLS-1$ } }
Please create a complete self-running snippet (project) to reproduce the issue.
Created attachment 247638 [details] DemoPreferencePage.java
Now we've right a complete self-running snippet within the RAP Workbench Demo. We only have changed the class "DemoPreferencePage.java". The adapted class is attached. To get the bug, select within the tool-bar: Window->Preferences. Now select an entry from the list in the "ARBURG Test" field by Keyboard! Afterwards push the button "setData". Now the selection within the Combo box is still on the Screen.
Created attachment 247640 [details] Example
(In reply to Ivan Furnadjiev from comment #1) > Please create a complete self-running snippet (project) to reproduce the > issue. the code snippet is now attached
Which RAP version are you using? Is it reproducible for you with external browser like Firefox or Chrome (browser used in the "example" is the internal Eclipse browser)? I can't reproduce it with Firefox 32.0.3, Chrome 37, IE11 and Opera 24 with RAP from master on Windows 7 x64 SP1.
(In reply to Ivan Furnadjiev from comment #6) > Which RAP version are you using? Is it reproducible for you with external > browser like Firefox or Chrome (browser used in the "example" is the > internal Eclipse browser)? I can't reproduce it with Firefox 32.0.3, Chrome > 37, IE11 and Opera 24 with RAP from master on Windows 7 x64 SP1. We are using RAP 2.3. We only have installed Eclipse Luna Service Release 1 (4.4.1) and the actual RAP Workbench Demo Project: "org.eclipse.rap.demo". The Browser doesn't matter. We get the bug with Firefox 32.0.3, IE10 and internal Eclipse browser. OS: Windows 7 x64 SP1 ( + Windows 7 32bit) In our example (offical RAP Workbench Demo) we have nothing changed exept the class "DemoPreferencePage" in the package "org.eclipse.rap.demo.presentation". Procedure: Use the mouse to open the selection of fields. Now use the keyboard! Select with the arrow keys, for example, "demoPresentation" and accept the selection with "Enter". Afterwards click with the mouse on the button "setData". Important: If everything is done with the mouse, the bug does not happen. The error only occurs when the selection is done via keyboard and press enter.
Thanks for detailed steps to reproduce the issue. Now I can reproduce it with current RAP master.
Wait... this is not the Combo list which stays visible.... it is the AutoCompleteField (ContentProposalAdapter). You construct AutoCompleteField with Combo as a control??!!! ContentProposalAdapter is heavily rely on key events. What functionality you want to achive? Maybe the RAP DropDown widget (or incubator AutoSuggest) could be used instead.
BTW ... the auto complete list is triggered by cboTest.setText(cboTest.getText());. What is the purpose of this code?
(In reply to Ivan Furnadjiev from comment #9) > Wait... this is not the Combo list which stays visible.... it is the > AutoCompleteField (ContentProposalAdapter). You construct AutoCompleteField > with Combo as a control??!!! ContentProposalAdapter is heavily rely on key > events. What functionality you want to achive? Maybe the RAP DropDown widget > (or incubator AutoSuggest) could be used instead. The box should contain two functionalities. First combo functionality: unfolding a list, select the content with mouse or keyboard, takeover of the content of the field. Second Autocomplete functionality: not open the list, direct input from the keyboard.
(In reply to comment #10) > BTW ... the auto complete list is triggered by > cboTest.setText(cboTest.getText());. What is the purpose of this code? There is a modify listener attached to the combo in ContentProposalAdapter (line 1895), which auto activate the proposal list ( autoActivateString is null ).
(In reply to Ivan Furnadjiev from comment #10) > BTW ... the auto complete list is triggered by > cboTest.setText(cboTest.getText());. What is the purpose of this code? In the example, the point was "simplified" and ensures that the selected content is displayed and the field is not "empty". In our application, a value is set from the data model at this point. For example: cboTest.setText (input.getCoordinator ());
...but in this case the visible auto complete list is expected. You modify the text in the Combo and the list become visible, because of ContentProposalAdapter control modify listener.
If single sourcing with RCP is not important, you should give the DropDown widget (or incubator AutoSuggest) a try. In any case it will work better than ContentProposalAdapter (AutoCompleteField). As I already said, JFace ContentProposalAdapter relies on key events, which will trigger a lot of network traffic.
We tried it with an AutoSuggest field. Unfortunately, this does not provide the desired functionality of us. We need the ability to open a list by dropDown (Combo). Furthermore, the selected value is not taken by Enter key only by tab or mouse. I have attached our expamle (code and ui).
Created attachment 247710 [details] Example AutoSuggest