Problem facing in Table header filter.

This forum is used by users to request and discuss new product features. Please do not use this forum for technical support including bug reports.

Moderator: JIDE Support

Forum rules
Product suggestions only. Please do not use this forum for technical support including bug reports.

Problem facing in Table header filter.

Postby Nachiyappan » Wed Dec 09, 2009 9:42 pm

Hi

I have a column and it contains content more than a screen size. I will scroll a table and view the content in the column.

If I need to filter any value using column header, the popupmenu go beyond the monitor size and I cant able to view the OK & Cancel button in the popup menu.

Pls let me know, how to define a size for popup menu and give scrollbar option to view the content in the scrollbar. If possible let me know the code.

Note: I have attached a screenshot for your reference.

Thanks & Regards
Nachiyappan.
Attachments
ss.JPG
ss.JPG (33.82 KiB) Viewed 29643 times
Nachiyappan
 
Posts: 32
Joined: Tue Oct 06, 2009 9:10 pm

Re: Problem facing in Table header filter.

Postby JIDE Support » Thu Dec 10, 2009 8:35 am

Please override AutoFilterBox#createPopupWindow() to customize the popup. Please check out JIDE AutoFilterTreeTableDemo on how you could override AutoFilterBox.

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

Re: Problem facing in Table header filter.

Postby Nachiyappan » Sun Dec 13, 2009 9:58 pm

Hi..

The AutoFilterTreeTableDemo.java does not have a code to override popup window.

Could you please give the code to resize the popup window.

Thanks
Nachiyappan
 
Posts: 32
Joined: Tue Oct 06, 2009 9:10 pm

Re: Problem facing in Table header filter.

Postby JIDE Support » Sun Dec 13, 2009 10:41 pm

Sure. Here you are.
Code: Select all
    class CustomAutoFilterTableHeader extends AutoFilterTableHeader {
        public CustomAutoFilterTableHeader(JTable table) {
            super(table);
        }

        @Override
        protected TableCellEditor createDefaultEditor() {
            if (isAutoFilterEnabled()) {
                return new AutoFilterTableHeaderEditor() {
                    private static final long serialVersionUID = -7347944435632932543L;

                    @Override
                    protected AutoFilterBox createAutoFilterBox() {
                        return new AutoFilterBox() {
                            @Override
                            protected void customizeList(JList list) {
                                super.customizeList(list);
                            }

                            @Override
                            protected JidePopup createPopupWindow() {
                                JidePopup popup = new JidePopup();
                                popup.setDetached(false);
                                popup.setResizable(true);
                                popup.setPreferredSize(new Dimension(200, 400));
                                popup.setPopupBorder(UIDefaultsLookup.getBorder("PopupMenu.border"));
                                return popup;
                            }
                        };
                    }

                    @Override
                    protected void customizeAutoFilterBox(AutoFilterBox autoFilterBox) {
                        autoFilterBox.applyComponentOrientation(CustomAutoFilterTableHeader.this.getComponentOrientation());
                        super.customizeAutoFilterBox(autoFilterBox);
                        CustomAutoFilterTableHeader.this.customizeAutoFilterBox(autoFilterBox);
                    }
                };
            }
            else {
                return null;
            }
        }
    }

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

Re: Problem facing in Table header filter.

Postby Nachiyappan » Sun Dec 13, 2009 10:51 pm

Hi...

I have tried this in morning. Just I called super.customizeAutoFilterBox(). I missed to add the following two lines.

autoFilterBox.applyComponentOrientation(CustomizedAutoFilterTableHeader.this.getComponentOrientation());
CustomizedAutoFilterTableHeader.this.customizeAutoFilterBox(autoFilterBox);

Because of this, I cant able to view the OK, Cancel button. And it is looking like list.

Anyway, thank you.

One more thing, the popup menu always starts at the table co-ordinate of (0,0). But I need to show at the column header of corresponding column co-ordinate(0,0).

Please let me the solution. I will also try in the mean while..

Thanks
Nachiyappan
 
Posts: 32
Joined: Tue Oct 06, 2009 9:10 pm

Re: Problem facing in Table header filter.

Postby Nachiyappan » Sun Dec 13, 2009 10:55 pm

Hi.

What is the purpose of setDetached(false) here.
Nachiyappan
 
Posts: 32
Joined: Tue Oct 06, 2009 9:10 pm

Re: Problem facing in Table header filter.

Postby JIDE Support » Sun Dec 13, 2009 11:32 pm

I tried that code. The popup window does show at the corresponding table header as you expected. setDetached(false) so that the popup window can not be dragged away.

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

Re: Problem facing in Table header filter.

Postby Nachiyappan » Mon Dec 14, 2009 2:03 am

Hi,

If I need to override a createAutoFilterBox method for a specific column, What I need to do?

Thanks
Nachiyappan
 
Posts: 32
Joined: Tue Oct 06, 2009 9:10 pm

Re: Problem facing in Table header filter.

Postby Nachiyappan » Mon Dec 14, 2009 5:20 am

Hi,

1. Actually I need to override only for one column. Not for all columns.. Is there any option to override this method for a specific column.

2. While overriding this createPopupmenu() method, I can able to set size for popup. But cant able to set location.

Ref the 14Dec.JPG, the "Comment" column contains value as "jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj". The popup goes beyond the monitor size. So, I applied setPreferredSize as 200,200. The size of the column has been set.

But the location of popup goes somewhere away from Comment column. Please tell me some fix for this problem..

Thanks
Attachments
14Dec.JPG
14Dec.JPG (18.42 KiB) Viewed 29632 times
Nachiyappan
 
Posts: 32
Joined: Tue Oct 06, 2009 9:10 pm

Re: Problem facing in Table header filter.

Postby JIDE Support » Mon Dec 14, 2009 8:20 am

Please use the following code instead to fulfill both specific column setting and the popup location issue.
Code: Select all
    class CustomAutoFilterTableHeader extends AutoFilterTableHeader {
        public CustomAutoFilterTableHeader(JTable table) {
            super(table);
        }

        @Override
        protected TableCellEditor createDefaultEditor() {
            if (isAutoFilterEnabled()) {
                return new AutoFilterTableHeaderEditor() {
                    private static final long serialVersionUID = -7347944435632932543L;

                    @Override
                    protected AutoFilterBox createAutoFilterBox() {
                        return new AutoFilterBox() {
                            @Override
                            protected void customizeList(JList list) {
                                super.customizeList(list);
                            }

                            @Override
                            protected PopupPanel createPopupPanel(TableModel tableModel, int columnIndex, Object[] possibleValues) {
                                PopupPanel panel = super.createPopupPanel(tableModel, columnIndex, possibleValues);
                                if (columnIndex == 0) {
                                    panel.setStretchToFit(false);
                                    panel.setPreferredSize(new Dimension(200, 400));
                                }
                                return panel;
                            }
                        };
                    }

                    @Override
                    protected void customizeAutoFilterBox(AutoFilterBox autoFilterBox) {
                        autoFilterBox.applyComponentOrientation(CustomAutoFilterTableHeader.this.getComponentOrientation());
                        super.customizeAutoFilterBox(autoFilterBox);
                        CustomAutoFilterTableHeader.this.customizeAutoFilterBox(autoFilterBox);
                    }
                };
            }
            else {
                return null;
            }
        }
    }

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


Return to Product Suggestions

Who is online

Users browsing this forum: No registered users and 10 guests

cron