Hi there!
I have problems when i try to catch table listSelectionChange events
when a popup menu is set on a that table (using setComponentPopupMenu).
When i right-click on a unselected row i see it selected, the popup is
shown but no listSelectionChange event is sent to the server. If i right
click again on that cell/row i got that event.

I think this is a bug.
I'm using last ULC version.

Do you confirm that issue using attached sample application?
How can be fixed?

Best regards,
Paolo Scaffardi
GFP Lab s.r.l.
http://www.gfplab.com
fax 178 2258454
/**
 * @author Paolo Scaffardi <[EMAIL PROTECTED]>
 */

package it.gfplab.ulc.bugs;

import com.ulcjava.base.application.AbstractApplication;
import com.ulcjava.base.application.ApplicationContext;
import com.ulcjava.base.application.ULCDialog;
import com.ulcjava.base.application.ULCPopupMenu;
import com.ulcjava.base.application.ULCScrollPane;
import com.ulcjava.base.application.ULCTable;
import com.ulcjava.base.application.event.IListSelectionListener;
import com.ulcjava.base.application.event.IWindowListener;
import com.ulcjava.base.application.event.ListSelectionEvent;
import com.ulcjava.base.application.event.WindowEvent;
import com.ulcjava.base.development.DevelopmentRunner;

public class ULCTableSelectionChangeBugSampleApp extends AbstractApplication {
        
    public void start() {
                ULCDialog dialog = new ULCDialog(null, "ULCTable 
SelectionChange bug", true);

                ULCTable table = new ULCTable(
                                new Object[][] {
                                                { "0,0", "1,0" },
                                                { "0,1", "1,1" }
                                }, new String[] {
                                                "Header1", 
                                                "Header2"}
                        );

                table.setComponentPopupMenu(new ULCPopupMenu("Test"));
                table.getSelectionModel().addListSelectionListener(new 
IListSelectionListener() {
                        public void valueChanged(ListSelectionEvent arg0) {
                                System.out.println("Selection changed");
                        }
                });
                
                dialog.add(new ULCScrollPane(table));
        dialog.setVisible(true);
        dialog.setDefaultCloseOperation(ULCDialog.DISPOSE_ON_CLOSE);
        dialog.addWindowListener(new IWindowListener() {
                public void windowClosing(WindowEvent arg0) {
                        ApplicationContext.terminate() ;
                }
        });
    }

    public static void main(String[] args) {
        
DevelopmentRunner.setApplicationClass(ULCTableSelectionChangeBugSampleApp.class);
        DevelopmentRunner.main(args);
    }
}

Reply via email to