How to stop the selection of an empty table?

Hello , everyone.
I created a JTable : tableView :
tableView.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
tableView.getSelectionModel().addListSelectionListener(this);
tableView is a empty table , that is to say , tableView.getRowCount() returns 0 .
When the table has focus, I press ENTER key , it will invoke the table's ListSelectionEvent event.
So , in the ListSelectionEvent interface:
public void valueChanged(ListSelectionEvent _e)
I call :
int selectedRow = tableView.getSelectionModel().getMinSelectionIndex();
selectedRow value will increase with ENTER key pressed each time .
My question is how to prevent from ENTER key event when a table is empty ?
Thanks in advance .

There is no table, unless you have a mapping table or an overflow segment, so the size is the bytes for the index segment. So yes, your query is probably correct. NB you will only have multiple segments with the same name, if you have partitioning, so you might not need the SUM .. GROUP BY

Similar Messages

  • How to insert the select query result into table?

    How to insert the select query result into table?
    SELECT  top 20 creation_time  
            ,last_execution_time 
            ,total_physical_reads
            ,total_logical_reads  
            ,total_logical_writes
            , execution_count 
            , total_worker_time
            , total_elapsed_time 
            , total_elapsed_time / execution_count avg_elapsed_time
            ,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,
             ((CASE statement_end_offset 
              WHEN -1 THEN DATALENGTH(st.text)
              ELSE qs.statement_end_offset END 
                - qs.statement_start_offset)/2) + 1) AS statement_text
    FROM sys.dm_exec_query_stats AS qs
    CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st
    ORDER BY total_elapsed_time / execution_count DESC;
    Thanks,
    Tirumala

    1. SELECT INTO
    Below method will create table when data is inserted from one table to another table. Its useful when you need exactly same datatype as source table.
    Use AdventureWorks2008R2;
    Go
    ---Insert data using SELECT INTO
    SELECT AddressLine1, City
    INTO BothellAddresses
    FROM Person.Address
    where City = 'Bothell';
    GO
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    2. INSERT INTO SELECT
    Below method will need table to be created prior to inserting data. Its really useful when table is already created and you want insert data from
    another table.
    Use AdventureWorks2008R2;
    Go
    ---Create Table
    CREATE TABLE BothellAddresses (AddressLine1 NVARCHAR(60), City NVARCHAR(30))
    ---Insert into above table using SELECT
    INSERT INTO BothellAddresses(AddressLine1, City)
    SELECT AddressLine1, City
    FROM Person.Address
    where City = 'Bothell';
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    Regards,
    Vishal Patel
    Blog: http://vspatel.co.uk
    Site: http://lehrity.com

  • How to save the  selected rows from Advance table into database

    Hi
    I have requirement like..
    In custom page , Manager Search the Candidates and selects the candidate ROWS from advance table.
    The reqt is how to save the selected multiple rows into the database.

    hi Reetesh,
    In Custom page
    Supoose the Recruiter Search is for Position Finance Mangager , it retrieves 100 rows , out of which Recruiter select 10 rows .
    So in Such scenario how to save this 10 rows against Recruiter
    , i mean , Is i need to create custom table, to save Recruiter , these selected 10 rows.
    I hope u understand my question

  • How to highlight the selected value in a table

    Hi All,
    I have list of roles in a table like admin,dba...etc.
    i will select the current selected role using
      Stgin role =wdCotext.currentElement().getRole();
    After getting the role i bind this value in context.
    now my requiremnet is i will navigate to other table view containing all roles like admin,dba,networkadmin .
    I have to highlight the selected role in previous table to new table containing the  all the roles.
    means selected role should be highlight in a next table view list of roles.
    please help.

    Hi mohammad,
    To achieve this functionality, use another integer variable to store the index of the currently selected element in the first view. Pass this variable's value to the next view (either as plug parameter or throgh mapping) and set the Lead selection for the table as this index in the second view.
    In the first View ....
    int n = wdContext.current<your_node>Element().index()
    pass this value from first view to second view.
    In the second view
    wdContext.node<your_node>().setLeadSelection(n)
    Hope this helps,
    Best Regards,
    Nibu.
    Message was edited by: Nibu Wilson

  • How to pass the selected data of a table to SAP(R/3)

    Hi all,
             I have a table with 2 colums and 10 records.Now i want to send the selected record to the R/3.
    Once the user checks the checkbox i retrivred the colum values of that row into a string array.
    and i added all the string arrays to an AbstractList.
    Now in function module it is giving as setT_Operations(AbstractList)
    but it is giving error..can u plz tell me how the function module understands the individual String arrays
    Regards
    Padma N

    Hey try to accept the values of a column as import parameters to a BAPI and you can send the data.But this will work out for a single data.
    In the BAPI insert the data making use of insert command.
    ITAB-COLUMN1 = IMPORT PARAMETER 1.
    ITAB-COLUMN2 = IMPORT PARAMETER 2.
    INSERT INTO VALUES ITAB.
    If you want to insert multiple records then you have to change the cardinality of the node.And add the node elements to the node.If any doubts then do reply.

  • How to get the selected rows in a table

    Hi,
    How to get the ids of all the selected rows. On Page load a query is executed that shows the data in a table with a checkbox in the first column to select the rows and delete. Now if a user select multiple rows how do I get the ids of selected rows in the backend code.
    Thanks

    Please search the forum before posting questions.
    refer following thread for table selection.
    Re: Record selection with MessageCheckBox and print the selected record.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                           

  • How to move the selected rows from a  table control in dialog programming

    hiiiiiiii Every1
    I have to update some fields for a slected row in table control on click of a button and save it in database.
    Regards
    Sachin Dhingra

    see below example, I have added INSERT option after DELETE option, you can use same table or you can use differnt table by populating into that table and insert into the db table. If you want to use same internal table then use below code
    LOOP AT itab INTO demo_conn WHERE mark = 'X'.
    insert into table from itab.
    ENDLOOP.
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA cols LIKE LINE OF flights-cols.
    DATA: ok_code TYPE sy-ucomm,
    save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn.
    TABLES demo_conn.
    SELECT * FROM spfli INTO TABLE itab.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
    cols-screen-input = '0'.
    MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
    SET PF-STATUS 'SCREEN_100'.
    ENDMODULE.
    MODULE cancel INPUT.
    LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
    MODIFY itab FROM demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
    save_ok = ok_code.
    CLEAR ok_code.
    CASE save_ok.
    WHEN 'TOGGLE'.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
    IF cols-screen-input = '0'.
    cols-screen-input = '1'.
    ELSEIF cols-screen-input = '1'.
    cols-screen-input = '0'.
    ENDIF.
    MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    WHEN 'SORT_UP'.
    READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
    IF sy-subrc = 0.
    SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
    cols-selected = ' '.
    MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDIF.
    WHEN 'SORT_DOWN'.
    READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
    IF sy-subrc = 0.
    SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
    cols-selected = ' '.
    MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDIF.
    WHEN 'DELETE'.
    READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
    IF sy-subrc = 0.
    LOOP AT itab INTO demo_conn WHERE mark = 'X'.
    DELETE itab.
    ENDLOOP.
    ENDIF.
    WHEN 'INSERT'.
    READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
    IF sy-subrc = 0.
    LOOP AT itab INTO demo_conn WHERE mark = 'X'.
    itab1 = itab.
    modify itab1.
    ENDLOOP.
    ENDIF.
    if not itab1 is initial.
    INSERT dbtab FROM TABLE itab1.
    endif.
    ENDCASE.
    ENDMODULE.

  • How to populate the selected row details of table in the next view?

    hi,
    Im having a table, on selecting a particular row of a table by clicking on a radio button. i need that row details to be passed on(populated) to the next view when i navigate to that view by clicking on a button?
    Thanks & Regards,
    Suresh

    Hi Suresh,
    Your scenario is simple. Just follow the ex as shown below
    (Assuming you want default selection view provided by table itself.)
    1>Create 2 views (Ex:A and B)
    2>Create a Context with a node and attributes(For Ex:Person as node and Fname and Last Name as attributes
    2>In A view create a table with F name and L Name(map to context as well) and a action button to navigate to B view when you selected a particualr row o.k
    3>In B view, create a TextView with mapping to LastName(or all the data if you want from input selection) from the context
    If you want you can add back action button from B view to A view for easy navigation.
    4>Execute the application and select any row in the table appeared, press next action button,you can see that the selected row details will be shown in second(B) view.
    If you do the above example, I think you can easily find the solution for navigation issue.. try it out.
    In case if you are not able to ...let me know..I have that example.
    Hope that helps
    Regards
    Praveen

  • How to stop the Selection Tool from selecting effects around objects?

    This question is for Illustrator CS5.
    I can't seem to figure out how to fix this problem. I vaguely recall finding a solution in CS4, but cannot recall how it was achieved:
    Scenario: If I have a number of shapes on top of each other, with, for example, a drop shadow on the top shape, whenever I try and select the shape below it (it is peeking out from beneath the top shape, so I click on this 'peeking' section of the shape to try and select it) I cannot - it just selects the top shape as the top shape's drop shadow is 'blocking' the shape below it. Make sense?
    How do I go about about remedying this? I seem to recall being able to tell Illustrator to ignore 'effects' when making selections in CS4, but cannot work out how to do this in CS5. And is there a way to refine the 'sensitivity' or selection radius when clicking to make selections?
    Hopefully someone with the knowledge can please advise?
    Many thanks.

    Never heard of ignore effscts for this.
    Couple way to solve this
    CMD Click on the already selected top element, to select the element underneath.
    You may have used the visiblilty eyeball in the appearance pallette to temporarily hide the drop shadow
    You can use CMD 3 to hide selected top elements, make the change you need, then Opt CMD 3 to unhide
    For #1 to work, don't click too fast, or else your clicks will register as a double click rather than a 2nd clikc (depending on what you have set in you Keyboard preferences).
    I mention #3 cause this is a very useful tool for cleaning up and grouping complex documents, when you want to select multiple elements.

  • How to stop the option key from changing tools when trying to subtract from a selection?

    How to stop the option key from changing my tools when I am trying to subtract from a selection?
    I'm running CS3 on Mac OS Leopard, and the automatic tool switching slows me down, but even preferences doesn't show a way to turn this off.
    Thanks for your help.

    With any marquee tool, JUST holding down the option key should not switch tools. You need to explain the problem much more carefully, It's completely impossible to tell from your description whats going wrong.
    automatic tool switching
    The only preference related to this, is to do with the SHIFT KEY - "use Shift key for tool switch".

  • How to stop the background job "Sap_collector_for_job_statistic"

    Dear All,
    Kindly let me know how to stop the Background job "Sap_collector_for_job_statistic" which is running everyday.
    We want to stop this background job.
    Kindly suggest.
    Regards,
    Mullairaja

    Select the Job using SM37 transaction. In the Menu Choose
    Job ---> Cancel Active Job.
    Before you do this it may be good idea to check the pid using SM50.
    It will be using a Background work process. Check the pid and the status.
    Select the same and in the Menu Choose Process --> Cancel with Core.
    Refresh and check in SM37 for the Active and Cancelled Jobs.

  • HOW TO STOP THE PROCESS CHAIN WHICH IS RUNNING IN THE PRODUCTION?

    HI ALL,
    CAN ANYONE TELL ME HOW TO STOP THE PROCESS CHAIN WHICH IS RUNNING DAILY AT 5.00 PM. I NEED TO STOP THE PROCESS CHAIN FOR COUPLE OF DAYS AND THEN RESTART IT AGAIN.
    cAN ANYONE TELL ME THE PROCEDURE TO STOP THE ENTIRE PROCESS CHAIN RUNNING IN THE PRODUCTION.
    THANKS
    HARITHA

    Hi,
    First and foremost let me advice you to be very careful while doing this.
    For Rescheduling
    RSPC> chain > Goto > Planning view and
    click on Execution tab > select > Remove from Schedule and then in Maintain variant of start process reschedule for the day you require it to run.
    For terminating active chain
    You can start from SM37, find the process WID/PID then go to SM50 or SM51 and kill it. Once its done come back to RSMO and check the request, it should be red but again manually force to red and save by clicking on the total status button in the status tab. This shuld ensure that the process is killed properly.
    The next step will be to go to targets that you were loading and remove the red requests from those targets.
    Note: For source system loads you may have to check if the request is running in the source system and kill if needed and pull it again.
    But for BW datamart delta loads u may have reset the datamarts in case u are going to pull the delta again.
    Re: Kill a Job
    Re: Killing a process chain.
    Regards,
    JituK

  • How to stop the Sending USSD message on my iPad since upgrading. The eKit SIMM worked fine on my older iPad. Thanks

    How to stop the Sending USSD message on my iPad since upgrading. The eKit SIMM worked fine on my older iPad. Thanks

    Wiping my phone, restoring from backup, AND wiping all iTunes related files (from a search in Library and in Music) seems to have stopped this behavior.
    (I couldn't wipe the iTunes files on the machine with my media and apps, but I did so on the other machine--where I only sync contacts, calendars and bookmarks. My iTunes library is empty there anyway.)
    I don't know if this relates to an "app synching" issue that iTunes 9.0.1 fixed. Could be.

  • How to stop the spinning wheel?

    How to stop the spinning wheel?

    Back up your documents and everything else important to you, not that there is any reason to believe your hard disk may be failing, but the symptoms you describe may presage an impending disk failure, and you should have backups anyway.
    Boot OS X Recovery by holding ⌘ and r (two fingers) while you start your Mac. At the Mac OS X Utilities screen, select Disk Utility. Select your startup volume (usually named "Macintosh HD") and click the Repair Disk button. Describe any errors it reports in red.
    When it finishes restart your Mac and test again for operation. If it's still not behaving as you expect it should, please post the results of EtreCheck in accordance with the following instructions:
    Apple Support Communities contributor etresoft wrote a very useful app to quickly gather certain system information that may help point to a cause of this problem. Go to his website, download and run EtreCheck:
    http://www.etresoft.com/etrecheck
    Etrecheck will be in your Downloads folder. Open it from there. You may see the following dialog box:
    Click Open - etresoft contributes to this forum frequently and can be considered a trustworthy developer.
    It will take a moment to run as it collects its data.
    Copy and paste its output in a reply.
    Do not be concerned about anything that says "Problem" or "failed".
    EtreCheck was designed to remove any personal information (such as your computer's name and serial numbers) but if you see anything that looks like an email address or any other personal information that should not be divulged to others, please delete or obscure that information when you post the reply.
    When you are finished with EtreCheck, quit the program. It occupies very little space, and you can keep it or drag it to the Trash as you wish.

  • How to disable the select options button, while audio is playing in the question template in captivate 8?

    How to disable the select options button, while audio is playing in the question template in captivate 8?

    Apologies for late reply.
    I mean "On Question screens audio keeps on playing even after we have selected an option or options depending on the question type and clicked Submit. How do we stop the audio on selecting an option?"

Maybe you are looking for

  • How to get contacts from stolen phone

    my iphone got stolen and when i try to track it on icloud it says its offline and i need to figure out how to get all my contact back but they wont show up on icloud when i go to contacts

  • Attendees not showing up in ical when clicking on a date in an email

    Hey When I receive an email with a date and time in it and I click on that date and add it in to ical (using "Create New iCal Event" option), it allows me to give a name of the meeting, change time, set the alarm etc but I cant seem to add the attend

  • USB mouse button doesn't work on MacBook Unibody

    Since the trackpad was not working, we have to use a USB mouse to navigate. After a few minutes, the mouse left and right button doesn't work. I can move the pointer around the screen and use the keyboard. Thoughts

  • Xml file usage

    A customer of mine is using a custom made Real Estate management software which extracts the properties' relevant data to an xml file of about 700.000 lines. I will create a website which will give the website visitor the ability to search for the av

  • Firefox 6 ,Hyperlink not opening when I select Open In New Tab, it always Open In New Windows.

    I have just upgrade to Firefox 6 and I having problems opening Hyperlink when I select Open In New Tab, it always Open In New Windows. It will work when I open another copy of Firefox browser but not on my main browser. Any suggestions to fix this ?