TableExComboBox

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

TableExComboBox

Postby pablovilas » Thu Sep 22, 2011 11:33 am

Hello,

Is there any way to show a real (with close, maximize, buttons) popup in a TableExComboBox?. Or just I have write my own ExComboBox component?.

Thanks. :)
pablovilas
 
Posts: 45
Joined: Wed Aug 31, 2011 10:13 am

Re: TableExComboBox

Postby JIDE Support » Thu Sep 22, 2011 12:19 pm

You might have to override TableExComboBox#createPopupComponent() to achieve your goal. However, where do you want to maximize if the customer click the maximize button? In next regular release, the popup component would be able to be resized by default.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: TableExComboBox

Postby pablovilas » Thu Sep 22, 2011 12:55 pm

I just want to see a window like in MultilineStringExComboBox but with the jTable inside and maximize box. Because my "Selection Panel" it´s more complex and I want to use it generically.

BTW: If you set the JTable as a SortableTable with AutoFilterTableHeader, that just don´t work because user cannot type any filter word, the ExComboBox doesn´t loose focus and just don´t let you write in filters input text.
pablovilas
 
Posts: 45
Joined: Wed Aug 31, 2011 10:13 am

Re: TableExComboBox

Postby JIDE Support » Thu Sep 22, 2011 1:46 pm

Please try to invoke tableComboBox.setPopupType(ExComboBox.DIALOG) to have the effect you want.

Can you please describe the focus issue a little bit more? As I can see, after drop down the popup panel, you could still enter characters to search it. If you do have focus issue, please give the following code a try.
Code: Select all
        TableExComboBox tableComboBox = new TableExComboBox(DemoData.createQuoteTableModel()) {
            @Override
            protected JTable createTable(TableModel model) {
                final SortableTable sortableTable = new SortableTable(model);
                AutoFilterTableHeader header = new AutoFilterTableHeader(sortableTable);
                header.setAutoFilterEnabled(true);
                header.setUseNativeHeaderRenderer(true);
                sortableTable.setTableHeader(header);
                return sortableTable;
            }

            @Override
            public PopupPanel createPopupComponent() {
                PopupPanel popupComponent = super.createPopupComponent();
                popupComponent.setRequestFocusEnabled(true);
                popupComponent.setFocusable(true);
                return popupComponent;
            }
        };

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: TableExComboBox

Postby pablovilas » Fri Sep 23, 2011 6:53 am

Well, using:

Code: Select all
tableComboBox.setPopupType(ExComboBox.DIALOG);


there is no focus problem, but if you try to run this code no focus to input filter text it´s available (I cannot search anything).

Code: Select all
MyTableExCombobox tableComboBox = new MyTableExCombobox(new QuoteTableModel()) {
        @Override
            protected JTable createTable(TableModel model) {
               
               SortableTable sortableTable = new SortableTable(model);
               
               
               AutoFilterTableHeader cabezal = new AutoFilterTableHeader(sortableTable) {
                  
                private static final long serialVersionUID = -8981103560551395381L;

                @Override
                   protected IFilterableTableModel createFilterableTableModel(TableModel model) {
                       return new FilterableTableModel(model) {
                           private static final long serialVersionUID = 7072186511643823323L;

                           @Override
                           public boolean isColumnAutoFilterable(int column) {
                              return true;
                           }

                           @Override
                           public boolean isValuePredetermined(int column) {
                              return true;
                           }                      
                       };
                   }

                   @Override
                   protected void customizeAutoFilterBox(AutoFilterBox autoFilterBox) {
                       super.customizeAutoFilterBox(autoFilterBox);
                       autoFilterBox.setSearchingDelay(-1);
                   }
                  
                  
               };
              
               cabezal.setAutoFilterEnabled(true);
               cabezal.setAcceptTextInput(true);
               sortableTable.setTableHeader(cabezal);
              
               TableHeaderPopupMenuInstaller installer = new TableHeaderPopupMenuInstaller(sortableTable);
               installer.addTableHeaderPopupMenuCustomizer(new AutoResizePopupMenuCustomizer());
               installer.addTableHeaderPopupMenuCustomizer(new TableColumnChooserPopupMenuCustomizer());
               
               
                return sortableTable;
            }
        };
        tableComboBox.setValueColumnIndex(1); // display the second column value in the combobox.
        tableComboBox.setSelectedItem("ALCOA INC");
        tableComboBox.setMaximumRowCount(12);
        tableComboBox.setEditable(true);


MyTableExComboBox Class:

Code: Select all
public class MyTableExComboBox extends TableExComboBox{
   
   public MyTableExComboBox (TableModel model) {
      super(model);
   }
   
   @Override
   public PopupPanel createPopupComponent() {
      
      PopupPanel panel = super.createPopupComponent();
      panel.setRequestFocusEnabled(true);
      panel.setFocusable(true);
      
      return panel;
   }
}


Anything else you need please let me know. Greetings.
pablovilas
 
Posts: 45
Joined: Wed Aug 31, 2011 10:13 am

Re: TableExComboBox

Postby pablovilas » Fri Sep 23, 2011 7:16 am

Also I think by default if using

Code: Select all
tableComboBox.setPopupType(ExComboBox.DIALOG);


The selection should not follow mouse movements because we have an accept, cancel buttons. Of corse it´s not a real selection (you need double click to select).But it's very confusing
that selection highlight follows mouse.
When you use the default popup this it´s cool because you just want double click one and close the popup at same time.

Thanks.
pablovilas
 
Posts: 45
Joined: Wed Aug 31, 2011 10:13 am

Re: TableExComboBox

Postby JIDE Support » Fri Sep 23, 2011 9:12 am

Will add an option to turn off the feature that mouse over could make selection. I'm afraid there is no easy solution to let the AutoFilterTableHeader to obtain focus if the popup type is POPUP.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: TableExComboBox

Postby pablovilas » Fri Sep 23, 2011 10:05 am

Okay, thank you very much.
pablovilas
 
Posts: 45
Joined: Wed Aug 31, 2011 10:13 am

Re: TableExComboBox

Postby JIDE Support » Thu Sep 29, 2011 10:06 pm

Just so you know, this is fixed in 3.2.3 just released.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: TableExComboBox

Postby pablovilas » Fri Sep 30, 2011 6:24 am

Excellent!! Thanks.
pablovilas
 
Posts: 45
Joined: Wed Aug 31, 2011 10:13 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 16 guests

cron