Hi, 

I am trying to set the location of a dialog box so that it will appear
as close as possible to a table column that was clicked.  The purpose is
that the columns are searchable so I would like the dialog in which the
user is going to enter the text they are searching for to 'pop-up' next
to the column they are searching on.

My applet that is contained within a frame in my webapp.  I am able to
create an event and send the point that is clicked to the server-side
but the point is relative to the table.  I have yet to figure out how to
set the location of the dialog using this point.  I have also tried
setLocationRelativeTo(ULCTable) but this does not set it close to the
header or the column.

I have overridden UITableHeader in order to fire off the event but I
have been unsuccessful in setting the actual header as one of the args
in the event.  When I add the event source as an arg I get an error on
the client side: 
'No coder registered for class
com.ulcjava.base.client.UITableHeader.BasicTableHeader'

If I do not try to send the actual event source from the client to the
server it all works fine, except that I can not set the location of the
dialog where I want it.


Following is the event code in my UITableHeader:

 public void mousePressed(MouseEvent event) {
            JTableHeader header = (JTableHeader)getBasicComponent();
            int colIndex = header.columnAtPoint(event.getPoint());
            TableColumnModel model = header.getColumnModel();
            TableColumn col = model.getColumn(colIndex);

            Object[] args = new Object[4];
            args[0] = event.getPoint();
            args[1] = event.getSource().toString();
            args[2] = col.getModelIndex();
            args[3] = event.getSource();  //This causes an error on the
client side
            fireMandatoryEventULC("foo", "foo", args);


Following is the code in my dispatcher:

 protected class ComboSortedTableHeaderDispatcher extends
ULCTableHeaderDispatcher{
        public EventObject createFooEvent
(com.ulcjava.base.application.util.Point p, String source, int col,
UITableHeader.BasicTableHeader header){

            ComboSortedHeaderEvent event = new ComboSortedHeaderEvent
(source, "foo");
            event.setPoint(p);
            event.setColumn(getTable().getColumnModel().getColumn(col));
            event.setTable(getTable());
            return event;
        }

Thank you for any suggestions in advance.

-- 
Sharon O'Connor
Software Engineer
Meridias Capital

Tel: 866-369-7755 ext. 4096
_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer

Reply via email to