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

Bug 365588

Summary: Problem AutoCompletion with ContentProposalAdapter to select items of popup with key up arrow
Product: [RT] RAP Reporter: Angelo ZERR <azerr>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: hihn
Version: 1.5   
Target Milestone: 1.5 M5   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 330461    

Description Angelo ZERR CLA 2011-12-05 08:50:20 EST
Hi,

I have implemented autocompletion by using ContentProposalAdapter. When I type some characters, my popup opens, but I cannot select the item by using Key ARROW UP. With RCP it works but not with RAP. I have debugged the ContentProposalAdapter and it seems that Key Arrow UP is never fired from the client side.

I suppose that it's a filter used to improve performance, but in my case I would like navigate accrosse items of the popup of the automplete.

Do you know how to fix this problem?

It seems that there is the same problem in a TableViewer with
- ArrayContentProvider
- TableViewerColumn ColumnLabelProvider, EditingSupport

-------------------------------------------------------------------
/*
   * (non-Javadoc)
   * @see org.eclipse.jface.viewers.TextCellEditor#createControl(org.eclipse.swt.widgets.Composite)
   */
  @Override protected Control createControl(Composite parent) {

    final Text text = (Text)super.createControl(parent);

    new ContentProposalAdapter(text,
                               new TextContentAdapter(),
                               new SimpleContentProposalProvider(new String[] {
          "1",
          "2",
          "3"
        }),
                               null,
                               null);

    return text;

  }
-------------------------------------------------------------------

This bug was creating after the discussion at http://www.eclipse.org/forums/index.php?t=rview&goto=760793

Regards Angelo
Comment 1 Ivan Furnadjiev CLA 2011-12-06 07:31:12 EST
There are at least two issues related to this bug:
1. The code related to KeyEvents in ContentProposalAdapter is completely commented - thus key events are not evaluated on the server-side (ContentProposalAdapter)
2. The Firefox related bug - Bug 329639.
Comment 2 Angelo ZERR CLA 2011-12-06 08:05:38 EST
(In reply to comment #1)
> There are at least two issues related to this bug:
> 1. The code related to KeyEvents in ContentProposalAdapter is completely
> commented - thus key events are not evaluated on the server-side
> (ContentProposalAdapter)
> 2. The Firefox related bug - Bug 329639.

Hi Ivan,

Thank a lot to interst you for this bug. I'm not sure that your 2 issues are right because : 

1. When I debug client side with My Firefox "Reseau" panel, there is none POST content sent when I type key up  in my Text widget (although when I type another key like "a", page down, etc POST content is sent). I suppose that Arrow KeyUp is not fired for performance raison.

2. I have tested with Google Chrome and it's the same problem.

I think we should debug the autocmplete Javascript to understand the problem, but I don't know where I can find that.

Thanks for your help.

Regards Angelo
Comment 3 Angelo ZERR CLA 2011-12-06 08:12:18 EST
(In reply to comment #2)
> (In reply to comment #1)
> > There are at least two issues related to this bug:
> > 1. The code related to KeyEvents in ContentProposalAdapter is completely
> > commented - thus key events are not evaluated on the server-side
> > (ContentProposalAdapter)
> > 2. The Firefox related bug - Bug 329639.
> 
> Hi Ivan,
> 
> Thank a lot to interst you for this bug. I'm not sure that your 2 issues are
> right because : 
> 
> 1. When I debug client side with My Firefox "Reseau" panel, there is none POST
> content sent when I type key up  in my Text widget (although when I type
> another key like "a", page down, etc POST content is sent). I suppose that
> Arrow KeyUp is not fired for performance raison.
> 
> 2. I have tested with Google Chrome and it's the same problem.
> 
> I think we should debug the autocmplete Javascript to understand the problem,
> but I don't know where I can find that.
> 
> Thanks for your help.
> 
> Regards Angelo

Oooops sorry Ivan I have replied to quicly. I have tested with Google Chrome and the behaviour is different. When I type KeyUp, POST message is sent and my description of the ContentProposalAdapter  is displayed. But I cannot navigate to the autocmplete (perhaps because of comments of ContentProposalAdapter). 

Excuse me for my last comment.

Regards Angelo
Comment 4 Ivan Furnadjiev CLA 2012-01-25 08:28:55 EST
Fixed by enable the corresponding key events code in the ContentProposalAdapter class. Selection of the proposal items by arrow keys is working now.