Multiple selection in JTable

Hi ,
The problem is to select multiple rows and columns in the JTable like that of a excel application and have the focus on the first column of the last row. for example if select cells from ( 1,1 ) to ( 4,4), after selection the focus should be in cell (4,1). i have written a prgram( which is below) which uses listSelection to find out the cells which are selected. i found out the cells which are selected also. but i do not know how to get the focus on that cell. i have attached the code below also.. i want to know whether there is any method which set the focus to the particular cell. Can the problem above can be solved in any other way..or a simpler way..
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.*;
class myTable {
public static void main(String a[] ) {
          JFrame myframe = new JFrame();
          JTable jtable = new JTable(10,10);
          jtable.setCellSelectionEnabled(true);
     // add the listener to the table
ListSelectionModel listSelectionModel;
     OSSTableSelectionHandler obj = new OSSTableSelectionHandler(jtable,10,10);
     listSelectionModel = jtable.getSelectionModel();
listSelectionModel.addListSelectionListener(obj);
     myframe.getContentPane().add(jtable);
     myframe.show();
} // end of public static void main
} // end of class of myTable
class OSSTableSelectionHandler implements ListSelectionListener {
               JTable table;
     int row;
               int col;
OSSTableSelectionHandler(JTable tab, int r, int c ) {
     table = tab;
row = r;
          col = c;
public void valueChanged(ListSelectionEvent e) {
ListSelectionModel lsm = (ListSelectionModel)e.getSource();
               int i = 0,j = 0;
int firstIndex = e.getFirstIndex();
int lastIndex = e.getLastIndex();
boolean isAdjusting = e.getValueIsAdjusting();
if (lsm.isSelectionEmpty()) {
System.out.println(" Selection empty ");
} else {
// Find out which indexes are selected.
                    int maxrow = 0 ;
int minIndex = lsm.getMinSelectionIndex();
int maxIndex = lsm.getMaxSelectionIndex();
for ( i = minIndex; i <= maxIndex; i++) {
if (lsm.isSelectedIndex(i)) {
                              if ( maxrow < i )
                                   maxrow = i;
                              for (j = 0;j < col ;j++ )
                                   if ( table.isCellSelected(i,j) )
                                        System.out.println("The selected index is " + i + " " + j);
                         } // end of if                    
} // end of for
               // after this maxrow contains the last row that has beeb selected
               // this for loop is to find out the first column in the maxrow that is selected
               for (j = 0;j < col ;j ++ )
                    if ( table.isCellSelected(maxrow,j) )
                              break;
               // set the focus to the column ( maxrow, j )
} // end of else
} // end of fucn value changed
} // end of class OSSTableSelectionHandler

Whic cell is focused depends on where you begin your selection. The cell that you press your mouse first will be the focused one. Here is how I implement the mutiple selection functionality in a JTable as what MS Excel provides. This class is independent of my any other package. your table has to have column headers and a upper left JLabel corner(int the scroll pane containing the table) in order to make this class which I named TableSelectionAdapter function properly. You can revise and imporve it as you need, however.
package petrochina.riped.gui.table.tableadapter;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.event.*;
import java.awt.datatransfer.*;
import java.util.*;
* Enables multiple selection funtionality on <code>JTable</code>s.
* @author Guanglin Du,SEC of Riped, PetroChina,
* [email protected]
* @version 1.0 2002/09/16
public class TableSelectionAdapter extends MouseAdapter {
private String newline = "\n";
private boolean DEBUG = false;
// private boolean DEBUG = true;
private JTable myTable = null;
private boolean shiftKeyDown = false;
private boolean ctrlKeyDown = false;
private int firstSelectedColIndex = -1;
* Constructs with a <code>myTable</code> to simplify its reusability.
* Guanglin Du, 2002/09/19
* @param myTable     a <code>JTable</code>
public TableSelectionAdapter(JTable myTable) {      
this.myTable = myTable;
initTableSelection();
* The initTableSelection method: initializes the row/column/cell
* selection functionality of the table.
* Guanglin Du, 2002/09/19
public void initTableSelection() {      
getMyTable().setSelectionMode(
          ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
     //Cell selection
     myTable.addMouseListener(new MouseAdapter() {
     public void mousePressed(MouseEvent e) {
          myTable.setColumnSelectionAllowed(true);
          myTable.setRowSelectionAllowed(true);
     setMyKeyListener(); //shift/control key listener
     //column selection functionality
     JTableHeader myTableHeader = getMyTable().getTableHeader();
     myTableHeader.addMouseListener(new TableHeaderListener());
     //enalbles select-all functionality
     setSelectAllFunction();
* This setSelectAllFunction isto set the select-all functionality
* when the upper left corner label of the JTable is clicked.
* Note: JTable's parent JScrollPane has to be found.
* Guanglin Du, 2002/09/19
public void setSelectAllFunction() {      
Container firstParent = getMyTable().getParent();
if (firstParent instanceof JViewport) {
     Container secondParent = firstParent.getParent();
     if (secondParent instanceof JScrollPane) {
     JScrollPane myScrollPane = (JScrollPane)secondParent;
     JLabel myLabel =
          (JLabel)myScrollPane.getCorner(JScrollPane.UPPER_LEFT_CORNER );
     myLabel.addMouseListener(this);
* Detects shift/control key state.
* DGL, 2002/09/18
public void setMyKeyListener() {
     getMyTable().addKeyListener(new KeyAdapter(){               
     //keyPressed
     public void keyPressed(KeyEvent e){
          //shift key state
          if(e.isShiftDown())     shiftKeyDown = true;                    
          //control key state
          if(e.isControlDown()) ctrlKeyDown = true;
//keyReleased
     public void keyReleased(KeyEvent e){
          //shift key state
          if( !e.isShiftDown() ) shiftKeyDown = false;                    
          //control key state
          if( !e.isControlDown() ) ctrlKeyDown = false;
* Adds the table header listener to enable single/multiple column selection.
* DGL, 2002/09/17
public void setTableHeaderListener() {
     JTableHeader myTableHeader = myTable.getTableHeader();
     myTableHeader.addMouseListener(new TableHeaderListener());
* Returns the <code>myTable</code> property value.
* @return myTable the table that this class handles
public JTable getMyTable() {
return myTable;
* Sets <code>myTable</code> property value of this class.
* @param myTable the table that this class handles
public void setJTable(JTable myTable) {
     this.myTable = myTable;
* Returns the shiftKeyDown property value.
* @return boolean, Guanglin Du, 2002/09/18
public boolean getShiftKeyDown(){
     return shiftKeyDown;
* Return the ctrlKeyDown property value.
* @return boolean, Guanglin Du, 2002/09/18
public boolean getCtrlKeyDown(){
     return ctrlKeyDown;
* This inner class handles the column selection, the same
* behavior as MS Excel.
* Guanglin Du, 2002/09/18
class TableHeaderListener extends MouseAdapter {
public void mousePressed(MouseEvent e) {    
     stopLatestCellEditing(); //To save the data being edited
     if(DEBUG) System.out.print("mousePressed on ");
     JTableHeader myColumnHeader = (JTableHeader)e.getSource();
     Point myPoint = e.getPoint();
     int selectedColIndex = myColumnHeader.columnAtPoint(myPoint);
     if(DEBUG) System.out.print("the header of column "
          + selectedColIndex+newline);
     JTable table = myColumnHeader.getTable();
     //The following column selection methods work only if these
     //properties are set this way
     table.setColumnSelectionAllowed(true);
     table.setRowSelectionAllowed(false);
     int myRowCount = table.getRowCount();
     //makes this table focused, so that setMyKeyListener method can
     //listen for shift/control KeyEvent
     table.requestFocus();
//     System.out.println("myRowCount = " + myRowCount);
     if( getShiftKeyDown() ){
     table.clearSelection();
     table.setRowSelectionInterval(0,myRowCount-1);
     table.setColumnSelectionInterval(selectedColIndex,selectedColIndex);
     if(firstSelectedColIndex > -1) {
          table.addColumnSelectionInterval(firstSelectedColIndex, selectedColIndex);
          firstSelectedColIndex = -1;//restore to -1
     } else if( getCtrlKeyDown() ) {
     table.addRowSelectionInterval(0,myRowCount-1);
     table.addColumnSelectionInterval(selectedColIndex,selectedColIndex);
     } else {
     table.clearSelection();
     table.setRowSelectionInterval(0,myRowCount-1);
     table.setColumnSelectionInterval(selectedColIndex,selectedColIndex);
     if(DEBUG) System.out.println("shiftKeyDown = " + shiftKeyDown
          +";"+" ctrlKeyDown = " + ctrlKeyDown);     
     //saves the first selected column index
     firstSelectedColIndex = selectedColIndex;
* MouseAdapter implemenation.
* mousePressed: sets the select-all functionality
* when upper left corner label of the table is clicked
* Guanglin Du, 2002/09/18
public void mousePressed(MouseEvent e) {    
     if(DEBUG) System.out.println("Select all");
     stopLatestCellEditing();//To save the data in editing
     getMyTable().selectAll();
* Triggers the latest <code>ActionEvent</code> in a table cell to save
* the latest data. Or, the newly input data will not be stored into the table
* model and cannot be retrieved.
public void stopLatestCellEditing() {
int editingRow = getMyTable().getEditingRow();
int editingCol = getMyTable().getEditingColumn();
if (editingRow != -1 && editingCol != -1){
     TableCellEditor cellEditor =
     getMyTable().getCellEditor(editingRow, editingCol);
     cellEditor.stopCellEditing();
Here is how you can use it in your coding(where myTable is a JTable instance you create):
     /* Adds TableSelectionAdapter to enable all kinds of selection action. */
     TableSelectionAdapter tableSelect = new TableSelectionAdapter(myTable);     

Similar Messages

  • Multiple selection in JTable for deletion

    Dears,
    I'm using Jdeveloper 9.0.3.3 on 8.1.7 Oracle DB.
    I noticed that when a JTable is bound to a View object ==> only one row can be selected.
    My situation -which I think is very common- I have a screen with JTable where I can edit a row and commit my updates or select multiple selection in JTable and delete them at once ; thats what I need.
    It is very like the test of any application module but allow multiple selection and deletion in JTable for user's selected rows.
    How this could be done in JClient?
    Thankx in advance.

    Thanks for your suggestions! They both would work as workarounds, I think. I tried another way:
    Following code changes a TableBinding bound JTable's selection model to Multi select (thanks to Shailesh!!).
    void setMultiSelectionModel(JTable tbl)
    class MultiSelectionListListener implements javax.swing.event.ListSelectionListener
    ListSelectionModel defSelModel;
    MultiSelectionListListener(ListSelectionModel model)
    defSelModel = model;
    public void valueChanged(javax.swing.event.ListSelectionEvent e)
    if (!e.getValueIsAdjusting())
    ListSelectionModel listModel = (ListSelectionModel)e.getSource();
    int leadIndex = listModel.getLeadSelectionIndex();
    if (leadIndex == listModel.getAnchorSelectionIndex()
    && leadIndex == listModel.getMaxSelectionIndex()
    && leadIndex == listModel.getMinSelectionIndex())
    //change currency on the bound iterator only if
    //one row is being selected.
    defSelModel.setSelectionInterval(leadIndex, leadIndex);
    ListSelectionModel newModel = new DefaultListSelectionModel();
    newModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    newModel.addListSelectionListener(new MultiSelectionListListener(tbl.getSelectionModel()));
    tbl.setSelectionModel(newModel);
    This fixes the bug if you select some rows and then select a row before the first selected one. Seems to work great.

  • Is it possible to diable multiple selections in JTable and JList?

    as the title states, is it possible to disable multiple selections? how to prevent user from using ctrl or shift keys to select multiple rows?

    Use the setSelectionMode(ListSelectionModel.SINGLE_SELECTION ) for your JList / JTable.

  • JTable Multiple Selection

    Hi,
    I am having a problem with the jTable's multiple selection.
    I apply cell renderers on a table's cells and also apply cell selection model on the table. I want to have mutliple row selection but I only get single selection.
    Could someone please explain why that is?
    Thanks
    Zweli
    <code>
    Utils.setupTableColumns(tblLookupProducts);
    Utils.setTableCellRenderer(tblLookupProducts, new CellToolTipRenderer(), -1);
    Utils.setCellFormatRenderer(tblLookupProducts, 5);
    Utils.setCellFormatRenderer(tblLookupProducts, 6);
    tblLookupProducts.setRowSelectionAllowed(true);
    cellSelectionModel = tblLookupProducts.getSelectionModel();
    cellSelectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    public class CellToolTipRenderer extends DefaultTableCellRenderer {
    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
    boolean hasFocus, int row, int col) {
    Component comp = super.getTableCellRendererComponent(
    table, value, isSelected, hasFocus, row, col);
    comp.setForeground(Color.black);
    comp.setBackground(Color.white);
    if (table.getSelectedRow() == row) {
    comp.setBackground(table.getSelectionBackground());
    comp.setForeground(Color.WHITE);
    setToolTipText(table.getModel().getValueAt(row, col).toString());
    return comp;
    * @author Zweli
    public class CellAlignmentRenderer extends DefaultTableCellRenderer {
    private int column;
    private NumberFormat currency = NumberFormat.getNumberInstance();
    private DecimalFormat df = new DecimalFormat("#,###,###,##0.00");
    private BigDecimal bd;
    public CellAlignmentRenderer(int column) {
    this.column = column;
    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
    boolean hasFocus, int row, int col) {
    Component comp = super.getTableCellRendererComponent(
    table, value, isSelected, hasFocus, row, col);
    comp.setForeground(Color.black);
    comp.setBackground(Color.white);
    if (table.getSelectedRow() == row) {
    comp.setBackground(table.getSelectionBackground());
    comp.setForeground(Color.WHITE);
    if (row != -1) {
    setHorizontalAlignment(SwingConstants.RIGHT);
    setToolTipText(table.getModel().getValueAt(row, col).toString());
    return comp;
    </code>

    Hello,
    Please edit your post and use proper tags.
    +if (table.getSelectedRow() == row) {+
    From the JTable API Javadoc:
    getSelectedRow()
    Returns the index of the first selected row, -1 if no row is selected.
    So this only returns +one+ index among all those selected.
    You could use <tt>getSelectedRows()</tt> (notice the +s+ !) instead, but there's a much better approach: guess what the +isSelected+ argument to <tt>getTableCellRendererComponent(...)</tt> stands for :o)
    Regards.
        J.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Disabling multiple row selection in JTable

    hi,
    I have a JTable and I want to disable the multiple row selection.
    I used
    getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);and this working fine with ctr+clicking on a row
    but if i am using shift key instead of Ctrl key multiple selection is possible....
    Any idea y?and how to resolve it??
    thnx
    ~neel

    Use table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);I don't know if it differs but I use it and I don't have the problems you describe. Might be a bug in your Java version?!
    Message was edited by:
    pholthuizen

  • First cell not selected in JTable

    When selecting multiple cells in JTable by pressing the mousebutton and draging the selection over the cells you want to select the first cell is not selected (it stays white).
    Any suggestions on how to fix this?

    I am running in M$ Windows.
    The first cell (anywhere in the Table) when you press the mouse to select a range of cells is present by color white (depend on L&F setting).
    The white color on first cell does not means the first cell is not selected!!!
    ( The first cell is selected, but present by white color to show you that is the start point )
    (if you use M$ Excel, that is the same effect presentation! )
    Hope this helps.

  • How do i delete multiple rows in JTable

    hello
    how i delete multiple rows in JTable
    when i selected multiple rows from the jtable and delete its give the error ArrayIndexOutOfBoundException
    e.g.
    int rows[]=jtable.getSelectedRows();
    for(int i=0;i<rows.length;i++)
    DefaultTableModel model=(DefaultTableModel)jtable.getModel();
    model.removeRow(rows);
    like this
    please help me
    meraj

    You are trying to remove the rows an equal times to the amount of rows selected.
    You should remove one row at a time:
    model.removeRow(rows);
    Change your code into this.
    for(int i=0;i<rows.length;i++)
    DefaultTableModel model=(DefaultTableModel)jtable.getModel();
    model.removeRow(rows[i]);

  • Is it possible to paste multiple selections from excel?

    How do you detect in Java whether a multiple selection in excel has been copied to the clipboard.
    For instance: I have an excel spreadsheet - 3 rows x 3 columns. I highlight the first 3 rows in column 1 and the first 3 rows in column 3 then I copy this to the clipboard (ctrl-c). If I now go to a text editor and paste this then the data from all 3 columns, not the expected 2 columns, appears.
    Likewise, in Java I have tried using the clipboard object looking at all the different data flavours to find a way of detecting that only data from the 1st and the 3rd columns were copied. But I can't find a way.
    This is most likely a microsoft issue in that they never make this information available from the clipboard.
    Can anyone shed any light on this one?

    Use the setSelectionMode(ListSelectionModel.SINGLE_SELECTION ) for your JList / JTable.

  • Multiple-selection JList

    here is my another problem:
    how to retrieve the data (tables, columns) from access database to the JList? i already success connected database to the jdbc-odbc bridge...after got the all column names (JList2) from selected table (JList1), i would like to select the certain column name by clicking the ( > , <, >>, << jbutton1, 2, 3, 4 ) to the another JList (JList3) because not all the column is useful to use to analyse. i think i need to use multiple selection JList but i don't know how to start because i am new to java.
    thx!

    Usually data from a database would be stored in a JTable as it already provide support for multiple rows and columns:
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    Also, with JDK1.3 there is some sample code of using a JTable with a database. I'm not sure if the code actually runs, but at least you can look at the source to see the steps involved:
    jdk1.3\demo\jfc\TableExample\src>

  • Dragging multiple rows in JTable - MUST use CTRL, or not?

    Hello all!
    I'm writing an app that needs to be able to drag multiple rows from a JTable. I have seen that I can do this by selecting multiple rows with the LEFT mouse button, while holding down the CTRL key, and then dragging (again, with the left mouse button).
    The problem is, since I'm holding down the CTRL key, this comes across as a DnDConstants.ACTION_COPY.
    I find that if I do multiple selection, then drag with the RIGHT mouse button (no CTRL key held down), then I get a DnDConstants.ACTION_MOVE, as I want.
    My question: Is there any simple way to enable dragging multiple JTable rows, using the LEFT mouse button, but WITHOUT holding down the CTRL key?
    I have been tasked with "making it act like Windows", which doesn't undo a multiple-selection when one clicks on an existing selected row until one lets go of the left mouse button; whereas JTables appear to change the selection to the clicked-upon row immediately, even if it is part of the existing selection.
    Any ways around this anyone knows, short of modifying the JTable or BasicTableUI itself?
    - Tim

    By the way, I just tested this assumption of mine, and found I was wrong if you're using default JTable drag and drop.
    However, I'm using my own implementation. I notice in a simple program without any drag and drop, I get the behavior I mentioned above, so I'm guessing this IS default JTable behavior, which is then modified by the built-in drag and drop support.
    So the trick will be, how to do what built-in drag and drop is doing, without using built-in drag and drop. :-)
    - Tim

  • Multiple Select in same Query

    I'm building a report based on a single table in APEX. The report requires the following.
    select user, project, count(start date ), project, count(end date) where date between 01-jan-07 01-feb-07
    (simplified to show the idea)
    basicaly a count of projects that started between two dates and the ones that ended between the same two dates relating to the user.
    I have writen the selects to do both parts and they work BUT is it posible to glue them together in a single statement?
    I tried to searching the forum on "multiple selects" but never realy got anything close.
    Is it possible to do this type of select? If so does it have a special name (so I can try a search on that name)
    Thanks
    Bjorn

    First of all, '11-MAY-06' and '19-MAY-06' are not dates, they are strings. This has some important disadvantages:
    1) Oracle has to implicitly convert them to a date, when they are being compared to a date column
    2) Your application will be NLS (National Language Support) dependent, so they might break when you change a setting
    3) When compared to a varchar2 or other string column, the comparison will give incorrect results. For example: 12-MAY-06 will be between 06-JAN-06 and 18-JAN-06
    Bottom line: convert those dates to real dates using the to_date function, or the date 'yyyy-mm-dd' variant.
    Back to your question, apparently you don't want to count the number of occurences of CON_ACTUAL_START and CON_SIGN_OFF, but you only want to count them when this date is between the two boundary values. So use the following:
    select mli_clo
         , count(case when con_actual_start between date '2006-05-11' and date '2006-05-19' then 1 end)
         , count(case when con_sign_off between date '2006-05-11' and date '2006-05-19' then 1 end)
    ...Regards,
    Rob.

  • How to get multiple selections from jsp page in my servlet

    Hello Everyone,
    I've a list that allows users to make multiple selections.
    <select name=location multiple="multiple">
        <option>
             All
        </option>
        <option>
             Hyd
        </option>
        <option>
             Dub
        </option>
        <option>
             Mtv
        </option>
      </select>I want to get the selections made by user in jsp page from my servlet, selections can be multiple too.
    ArrayList locList = new ArrayList();
    locList = request.getParameter("location");when I do so, I get compilation error as the request returns string type. How do I then get multiple selections made by the user.
    Please let me know.

    For those kind of basic questions it would help a lot if you just gently consult the javadocs and tutorials.
    HttpServletRequest API: [http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html]
    Java EE tutorial part II: [http://java.sun.com/javaee/5/docs/tutorial/doc/]
    Coreservlet tutorials: [http://courses.coreservlets.com/Course-Materials/]

  • Get all the values from a multiple select in a multipart form

    Hi there!
    I am using a form with enctype="multipart/form-data" in order to upload files from the form.
    I have read this page: http://commons.apache.org/fileupload/using.html and everything works well for my form.
    The only problem is that I can't get all the values from a "multiple select" html object. I get only one value.
    Using servlets I have used this method:
    public java.lang.String[] getParameterValues(java.lang.String name) But now I have enctype="multipart/form-data" in my form and I can't use this way...
    Is there a way to get all the values of a multi-valued parameter?
    Thanks a lot!
    Stefano

    Hi
    I have got solution for this problem so, I am listing here logic
    assume tag name of html
    <select name="moption" multiple="multiple">
    iterate it in as
    String moption="";
    boolean cnt=true;
    while(itr.hasNext())
    FileItem fi=(FileItem)itr.next();
    if(fi.isFormField())
    if(fi.getFieldName().equals("moption"))
    if(cnt==true)
    moption=fi.getString();
    cnt=false;
    else
    moption=moption+","+fi.getString();
    If wants more help then mail me your problem
    at [email protected]
    Thanks!
    Anand Shankar
    Edited by: AnandShankar on 6 Nov, 2009 12:54 PM

  • All values from multiple select LOV

    Hi.
    Ik have a customize screen for a chart where a can select days. That works. But i want the standard value to be 'all days', so the user does not have to click all seven days. When i have combobox i use in the where clause:
    "and (fieldname = :variable or :variable = '%')"
    For a mutiple select i use IN:
    "and fieldname IN :variable"
    That would make:
    "and (fieldname IN :variable or :variable = '%')"
    This does not work for a multiple select LOV.
    Anu ID how i can make it work???

    Try the following:
    (:variable = '%' or
    :variable <> '%' and fieldname in :variable)

  • Struts: getting multiple selected values from a select element

    Hi Friends,
    I am a total newbie with struts,I have manage to run a simple login script,
    Now I was wonderingif there is a select box and user has the ability to select multiple values from it how do I get those values in the *Form class
    my select tag looks like this
    <html:select property="listboxValue" mulitple="mulitple">
    ...options--
    </html:select>
    in the ****Form extends ActionForm{....I have setter and getters for getting the value  from select box as below
    public void setListboxValue(String value){
    this.listboxValue = value;
    and the getter is
    public String getListboxValue(){
    return this.listboxValue ;
    please never mind the missing brackets and such.
    What I was hoping to get to work was something like this
    public void setListboxValue(String[] value){
    this.listboxValue = value;
    but that does not work...If I have the an array being passed,it seems like this method is no even envoked
    Please guide me
    Thanks

    I'm having trouble to get in the ActionForm all the selected values in my multiple select. I select all the values by setting to true the selected attribute of all the options in a javascript function. In the ActionForm the variable is String[]. I'm not getting any ClassCastException, but I only receive the first value selected (String array with just one element).
    Select definition:
    <html:select name="detalleConsultaForm" property="destinatarios" multiple="true" size="8" >
    Javascript function:
    function validalistarelacion(campo)
    {   if (campo.length < 1)
    alert("Campo sin valores");
    campo.select();
    return false;
    for (var i = 0; i < campo.length; i++)
    campo.options.selected = true;
    return true;
    ActionForm:
    String[] destinatarios;
    public String[] getDestinatarios() {
    return destinatarios;
    public void setDestinatarios(String[] destinatarios) {
    this.destinatarios = destinatarios;
    What I get:
    2006-03-30 12:54:19,899 [ExecuteThread: '10' for queue: 'weblogic.kernel.Default'] DEBUG BeanUtils - setProperty(es.tme.apl.mante
    nimientosPlanificados.form.DetalleConsultaForm@59def5, destinatarios, [2320])
    2006-03-30 12:54:19,899 [ExecuteThread: '10' for queue: 'weblogic.kernel.Default'] DEBUG ConvertUtils - Convert String[1] to class
    'java.lang.String[]'
    Thnx

Maybe you are looking for

  • Windows 7 on bootcamp installation problem

    hi all, i just had a new imac and was trying to install a windows home premium OEM 64 bit on bootcamp. installation is going fine until the completion stage where your suppose to set up winodws for first use, all it did is become a blank/ black scree

  • Photoshop CC Freezes every constantly, VERY frustrating.

    Hi all, So here is the problem.  Interested to see if anyone else is having the same issues, or if anyone knows anyfixes. Im Using: 27inch imac i7 SSD 32gig ram Maverics Photosho CC 14.2.1 The Problem: About every 30sec - 3min photoshop hangs up.  I

  • Aperture 3.3 can't import iPhoto 8.1.2 library?

    I'm on iPhoto '09 (8.1.2) and want to upgrade to Aperture.  Aperture 3.3 seems to be missing the ability to import older iPhoto libraries which it looks like it used to be able to do in previous versions.  Is there some way for me to migrate to Apert

  • To print letters in bold

    how to print the letters in bold format in classiscal reports

  • Apps/windows lost going from dual to single monitor

    I use a MacBook Pro at work, where I hook up to an external monitor. Later at home when I use the MacBook without the external monitor, I lose windows for apps that were last viewed on the other monitor. If I use Exposé to view all the open windows,