Duplicate rows displayed in list

I am using ADF, Struts and JSP.
On occasion, some of the pages that simply display a list of attibutes in a VO display duplicate rows - these views reference just one EO and in the majority of cases all of the default settings are used.
There seems to be no consistency as to what causes this, at first it would appear after a new row had been inserted but then is would just appear when listing the detilas.
If you refresh the list (event invokes executeQuery() to refresh the data from the DB) then the duplicate row goes away.
This happens on my development machine (using JDev 10.1.2) and on the Application Server deployment.
Has anyone esle seen this?
Does anyone know why this might be happening and what I can do to solve this problem?
Thanks
Alan

Marcos - thanks for the reply - this is the type of answer I was looking for since I'm not able to find anywhere in my code that I'm inserting a new row.
However, I've tried this approach and am still experiencing the issue. I wanted to check that I had the right items checked / not checked. I don't have an item that says Disconnect Application Module 'unmanaged Release' - mine just says 'Release'. Here are my options (Jdev 10.1.3):
(default unchecked) Failover Transaction State Upon Managed Release
(default unchecked) Disconnect Application Module Upon Release
(default checked) Support Dynamic JDBC Credentials
(default checked) Reset Non-Transcational State Upon Unmanaged Release
(default checked) Enable Application Module Pooing
I've tried multiple combinations of checking / un-checking options (including having everything checked except the 2nd item above) and still get the same issue. I'm going to read up in the developer guide to see if I can understand these better.
By the way, can you let me know which passivate state options you have set for your View Object that was showing the duplicate row but is now working? For example, right-click on VO, select edit - what items are checked on the Tuning tab?
#1 Fill Last Page of Rows when Paging through Rowset
#2 Passivate State
#2a Including all Transient Values
#3 Retain View Link Accessor
Thanks

Similar Messages

  • Deleting Duplicate Rows in a list

    Hey folks, I've scowered around a bit for the answer to this and can't for the life of my figure it out.
    I've got a list of ~2,000-3,000 words in the following format:
    Fact
    Fiction
    Funny
    Funny
    Funny
    Funky
    etc etc. I am looking to make numbers delete all the duplicate rows such that the above list would become:
    Fact
    Fiction
    Funny
    Funky
    All of these words are in column A on a separate sheet in a numbers document I'm using to run an experiment. Is there a built in command or something that would do this? (I'm a COMPLETE beginner at using Numbers as a heads up)
    Any help with this would be GREATLY appreciated.

    Teaghue wrote:
    Never mind! I found an old old post explaining that this can't be done in numbers, so I just did it in excel.
    Perfectly wrong !
    The way to achieve the described goal was described several times in this forum.
    *_You just didn't search carefully !_*
    Searching for delet AND duplicate return several threads.
    Here are two of them.
    I didn't made a typo. I used delet so that it retrieve delete as well as deleting
    http://discussions.apple.com/thread.jspa?messageID=12992492
    http://discussions.apple.com/thread.jspa?messageID=11559125
    Yvan KOENIG (VALLAURIS, France) mercredi 2 mars 2011 17:59:40

  • How to force duplicate row display automatically

    In answers, we have one table that has duplicate data. The only thing different between some rows is the ROWID. When use user requests data, Answers automatically suppresses the duplicate rows. How can I force answers to display all rows and not suppress duplicate values?
    For example - db table contains
    COL-A COL-B COL-C
    ABC 3 5
    DEF 2 1
    DEF 2 1
    When adding COL A, B, and C to a report - Answers will display:
    ABC 3 5
    DEF 2 1
    How do I get answers to display
    ABC 3 5
    DEF 2 1
    DEF 2 1
    automatically?
    Thanks!

    I did as instructed - remove the check for DISTINCT_SUPPORTED from all DATABASE connections, saved the repository and recycled BI server and Presentation services. Unfortunately, there was no impact to suppression.
    My DB is Oracle 10.2.0.4 on Windows 2003.
    In addition, we have the following connection strings in place to allow for case-insensitive searches:
    alter session set NLS_SORT=BINARY_CI
    alter session set NLS_COMP=LINGUISTIC

  • How to delete particular row in ALV list display

    Hi All,
    My requirement is :
    I am displaying ouput using lav list dispplay befor the first colomn i am displaying check box. i defined my own pf status here . in pf status i have 3 buttons .
    1 select all
    2 deselect all
    3 delete.
    First two options are working fine when i click select all it is selecting all the rown in a program(selectiong all the check boxex) like working fine for deselecting all.
    3 optioin  Delete when i click delete option it has to delete partcular row in a list display and at the same time this entry should delete from the table. this is my requirement. for the third point(delete) option i dont have any logic. anybody can suggest me or send me the sameple code. i am sending my code below.if possible please modify the code and resend it to me.
    type-pools : slis.
    tables : zuser_secobjects.
    data : t_header1 like zuser_secobjects.
    data : begin of it_secobjects occurs 0.
            include structure t_header1.
    *data :  box,
           input(1) type c,
    data :   checkbox type c,
            flag type c,
          end of it_secobjects.
    data : wa_ita like line of it_secobjects.
    *data : it_secobjects like zuser_secobjects occurs 0 with header line.
    data : i_field type slis_t_fieldcat_alv with header line.
    data : w_field like line of i_field.
    data : i_sort type slis_t_sortinfo_alv.
    data : w_sort like line of i_sort.
    data : it_filt1 type slis_t_filter_alv with header line.
    data:
    i_tabname type tabname,
    i_repid like sy-repid,
    is_lout type slis_layout_alv.
    data :   it_filt type slis_t_filter_alv   with header line,
             it_evts type slis_t_event        with header line.
    DATA : is_vari type disvariant.
    constants :   c_default_vari value 'X',
                  c_save_vari    value 'U',
                   c_checkfield type slis_fieldname     value 'ACTION',
                   c_f2code     type sy-ucomm           value '&ETA'.
    data : chk_box type slis_fieldname.
    selection-screen: begin of block b1 with frame title text-t01.
    parameters : p_appln type zuser_secobjects-appln.
    parameters : p_user type usr02-bname, "zuser_secobjects-appln_user,
    p_partnr type zuser_secobjects-appln_partner,
    p_ptype type zuser_secobjects-partner_type default '02',
    p_upostn type zuser_secobjects-user_position,
    p_sdate like likp-erdat default sy-datum,
    p_edate(10) default '12/31/9999',
    p_revnum type zuser_secobjects-revnum,
    p_cted type zuser_secobjects-created_by,
    p_cdate type zuser_secobjects-creation_date,
    p_ctime type zuser_secobjects-creation_time,
    p_chnby type zuser_secobjects-changed_by,
    p_cdate1 type zuser_secobjects-changed_date,
    p_ctime1 type zuser_secobjects-changed_time.
    selection-screen: end of block b1.
    form user_command using p_ucomm like sy-ucomm
    rs_selfield type slis_selfield.
    *DATA :   it_filt type slis_t_filter_alv   with header line.
      case p_ucomm.
        when 'SELECT_ALL'. " SELALL is the FCODE of ur push button
          loop at it_secobjects into wa_ita.
            wa_ita-checkbox = 'X'.
            modify it_secobjects from wa_ita.
          endloop.
      rs_selfield-refresh = 'X'.   "<-  ADD THIS
      when 'DESLCT_ALL'.
        loop at it_secobjects into wa_ita.
            wa_ita-checkbox = ' '.
            modify it_secobjects from wa_ita.
          endloop.
      rs_selfield-refresh = 'X'.   "<-  ADD THIS
        is_lout-f2code               = c_f2code.
        is_lout-box_fieldname        = c_checkfield.
        is_lout-get_selinfos         = 'X'.
        is_lout-detail_popup         = 'X'.
        is_lout-detail_initial_lines = 'X'.
    when 'HIDE_DEL'.
          rs_selfield-exit  = 'X'.
          it_filt-fieldname = 'ACTION'.
          it_filt-tabname   = '1'.
          it_filt-valuf     = 'X'.
          it_filt-intlen    = '1'.
          it_filt-inttype   = 'C'.
          it_filt-datatype  = 'CHAR'.
          it_filt-valuf_int = 'X'.
          it_filt-sign0     = 'E'.
          it_filt-optio     = 'EQ'.
          if it_filt[] is initial.
            append it_filt.
          else.
            modify it_filt index 1.
          endif.
         perform display using i_object.
    PERForm  ALV_LIST_DISPLAY.
    WHEN 'SHOW_DEL'.
          rs_selfield-exit = 'X'.
          free it_filt.
    PERForm  ALV_LIST_DISPLAY.
    when 'SAVE1'.
           select * from zuser_secobjects where
                        appln = zuser_secobjects-appln
                  and   appln_partner = zuser_secobjects-appln_partner
                  and   partner_type = zuser_secobjects-partner_type
                  and   start_date = zuser_secobjects-start_date
                  and   end_date = zuser_secobjects-end_date.
          endselect.
          if sy-subrc eq 0.
            message e000(ZV) with 'Duplicate Entry'.
          endif.
      endcase.
    endform.
    *&      Form  delete
    form delete.
      data : begin of is_secobjects occurs 0.
              include structure zuser_secobjects.
      data : checkbox type c.
      data : end of is_secobjects.
      is_secobjects-checkbox = 'X'.
      modify is_secobjects
        from it_secobjects
        transporting checkbox
      where checkbox = 'X'.
    endform.
    *&      Form  get_data
    form get_data.
      select * from zuser_secobjects
      into table it_secobjects.
    endform.                    " get_data
    *&      Form  prepare_fieldcatalog
          text
    -->  p1        text
    <--  p2        text
    form prepare_fieldcatalog.
      clear: w_field,i_field.
      refresh:i_field.
      i_field-key = 'X'.
      i_field-col_pos = 1.
      i_field-ddictxt = 'S'.
      i_field-seltext_s = '@11@'.
    i_field-checkbox = 'X'.
      i_field-input = 'X'.
      i_field-fieldname = 'HEADER'.
      i_field-outputlen = 0.
      append i_field.
      clear i_field.
      w_field-fieldname = 'APPLN'.
      w_field-tabname = 'IT_SECOBJECTS'.
      w_field-seltext_l = text-m01.
      w_field-outputlen = '10'.
      w_field-col_pos = 1.
      append w_field to i_field.
      clear w_field.
      w_field-fieldname = 'APPLN_USER'.
      w_field-tabname = 'IT_SECOBJECTS'.
      w_field-just = 'C'.
      w_field-seltext_l = text-m02.
      w_field-outputlen = '7'.
      w_field-col_pos = 2.
      append w_field to i_field.
      clear w_field.
    endform.                    " prepare_fieldcatalog
    *&      Form  ALV_LIST_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    form alv_list_display.
      i_repid = sy-repid.
      is_lout-box_fieldname = 'CHECKBOX'.
      it_filt-fieldname = 'ACTION'.
      call function 'REUSE_ALV_LIST_DISPLAY'
           exporting
                i_callback_program       = i_repid
                i_callback_pf_status_set = 'PF_STATUS_SET'
                i_callback_user_command  = 'USER_COMMAND'
                is_layout                = is_lout
                it_fieldcat              = i_field[]
                it_filter                = it_filt[]
                 it_events                = it_evts[]
                i_default                = c_default_vari
                i_save                   = c_save_vari
                is_variant               = is_vari
           tables
                t_outtab                 = it_secobjects.
    endform.                    " ALV_LIST_DISPLAY
    *&      Form  display
          text
         -->P_I_OBJECT  text
    form display using    object.
      case object.
    ENDCASE.
    endform.                    " display
    thanks,
    maheedhar.t

    HI
    In my program checkbox(before the record is displayed)
    I used following lines to display checkbox .
      i_field-key = 'X'.
      i_field-col_pos = 1.
      i_field-ddictxt = 'S'.
      i_field-seltext_s = '@11@'.
      i_field-checkbox = 'X'.  <- Using this command i am getting checkbox
      i_field-input = 'X'.
    when i select this checkbox i press delete option then this entry will remove from internal table and refresh the screen and at the same time i will click on save button this ztable has to update according to that action.
    this is my requirement.
    thanks,
    maheedhar.

  • How to Not Display Exact Duplicate Rows in Report

    I have a report that displays many duplicate rows where all fields in several rows are exact duplicates.  I would like to know how to make it so that the entire row does not show up if it is an exact duplicate of another row.  Any ideas?  Thanks.

    I literally have been pulling my hair out for the past 3 days with the same issue.  I'm new to SSRS.  I created a new report where I basically only wanted to show order header info, but unfortunately, some of the info I need to show at the header
    level is only kept at the detail level.  So, when I linked the order header to the order detail (one to many) I got a duplicate row for every line that was in the order detail.   I tried to group just by order number (thinking it would roll
    all the dups up) but that didn't work.  Doing a group on all the fields on the report did the trick.
    I owe Mainiac007 a beer!!!! :)

  • Setfilter to display all the duplicate rows pb7

    Friends,
    my version is powerbuilder 7.
    i am checking the duplicate rows in the datawindow before inserting.
    in a button click event...i have the below code
    dw_master.SetSort ("rollno A")
    dw_master.Sort()
    dw_master.SetFilter("rollno = rollno[-1]")
    dw_master.Filter()
    if dw_master.RowCount() > 0 then
        MessageBox('Duplicate Rows','Check the Duplicate Roll numbers',StopSign!,OK!)
        Return 1
    end if
    //no dups, so clear the filter and do the update...
    dw_master.SetFilter ("")
    dw_master.Filter()
    i have 2 duplicate rows...but this setfilter is displaying only one row....
    if it displays all the duplicate rows then it will be very useful for me...
    how can i modify this code to get all the duplicate rows in this datawindow before inserting?
    thanks

    Instead of a filter you could do this...
    boolean lb_dupe_found=false
    long ll_row, ll_rowcount
    string ls_val1, ls_val2
    ll_rowcount = dw_1.rowcount()
    for ll_row = 2 to ll_rowcount
    ls_val1 = dw_1.getitemstring(ll_row, 'col1')
    ls_val2 = dw_1.getitemstring(ll_row -1, 'col1')
    if ls_val1 = ls_val2 then
      // duplicate
      lb_dupe_found = true
      exit
    end if
    next
    if lb_dupe_found then
    messagebox('DUPE', 'Houston we have a problem!')
    else
    messagebox('SAVE', 'Data valid for saving')
    end if

  • How to set the number of rows displayed in a classical report at runtime?

    Hi,
    Our customer has several standard client hardware configuration and would like to enable end users to choose their 'display profile' at login time. This 'display profile' would contain predefined values for these hardware configurations and supposed to set various paramters that should define the number of rows displayed in a classical report region.
    I tried to provide parameters on the report region but it refused to accept anything but numerical values. Is it possible to do this?
    Regards, Tamas

    The link is to the closest linkable point in the documentation to the description of the Number of Rows (Item) attribute.
    It sounds like you have been trying to enter&mdash;unsuccessfully&mdash;an item name or substitution string into the Number of Rows attribute. The Number of Rows (Item) attribute is the one that actually allows you to do this. Click on the flashlight icon beside it to get a list of items from the application.

  • How to control number of rows displayed in a report  by user?

    Hi All!
    I have provided a select list called 'Number of rows' in my report page.User can choose any number in the list, and accordingly he should be able to see so many number of rows in that report page.
    For example: if user selects 50 from the list, he will be able to see 50 records at a time out of say 2000 records retrieved. I want to control number of rows displayed per page dynamically. And if he selects 25 in the select list, he should be able to see 25 records at a time out of 2000.
    How to do it? Please give me ideas.
    Thanking in advance.
    Regards,
    Deepika.

    Hi Deepika,
    If you have a Select List with Submit called, say "P1_ROWS", you just enter P1_ROWS into the Report Attribute's "Number of Rows (Item)" setting.
    Regards
    Andy

  • How to restrict number of rows display using ig:gridView

    Hi
    All
    How to restrict number of rows display using <ig:gridView datasource="{mybean.mylist}">
    i am getting 10 rows using data_row . i wanna show only first 5 rows .
    pageSize ="5" will be ok . but it displays remaining rows in next page. but i want to display only first 5 rows . is there any attribute to restrict number of rows.
    thanks
    rambhapuri

    I have no idea which component you're talking about. If want to discuss here about a non-Sun JSF component, then please mention about the name, version and build in detail. You can also consider posting this question at the website/forum/mailinglist of the component manfacturer rather than here. At least I can tell you that the Sun JSF h:dataTable has the 'rows' attribute for that. I can also suggest you to just take a look in the TLD documentation of the component in question. There should be all possible attributes listed with a detailed explanation about the behaviour.

  • How to Hide some Rows in a List view Web Part using JavaScript ?

    How to Hide some Rows in a List view Web Part using JavaScript ?

     Here is the code that worked for me:
    var Elements = document.querySelectorAll('div[id=WebPartWPQ3] table[class=ms-listviewtable]>tbody tr .ms-vb-lastCell.ms-cellstyle.ms-vb2')
    for(var i=0, n = Elements.length; i < n; i++)
     if(Elements[i].innerHTML=="India")
    Elements[i].parentNode.setAttribute("style","display:none")
    WebPartWPQ3 -> ID of webpart Div
    ms-listviewtable -> class name of table in Div
    ms-vb-lastCell.ms-cellstyle.ms-vb2 -> classname of td to get text

  • Number of rows displayed per page in an interactive report

    Hi,
    I'd like to know if it's possible to change the values of the select list called 'Rows' in an interactive report (which is displayed in the search bar).
    Indeed, I want to display 16 rows per page and I can only choose among the values 1, 5, 10, 15, 20, 25, 30, 50, 100, 200...
    Thank you for your reply.
    Emilie.

    Hi Tobias,
    Thank you for your help.
    I had already tried this but it's not what I want. What your are saying only limits the values in the select list (for example, if I set to 16, I can't choose values higher than 16 in the select list 'Rows' of the search bar).
    I want to limit the number of rows displayed in the interactive report to 16 per page.
    Any other idea?
    Emilie.
    Hi Emilie,
    Go: Home>Application Builder>Application 301>Page 51>Interactive Report Attributes>Search Bar>Maximum Rows Per Page
    Set to = 16
    Oracle help description: Defines the maximum number to display in Rows Per Page Selector in the search bar.
    Greetings,
    Tobias

  • Deleting BOTH duplicate rows in Excel

    Hi everyone,
    I have just been introduced to Applescript and I was hoping to automate some things at my workplace. One of the first activities that I have been trying to figure out involves Excel 2008, which is running on a G5 (Latest version of Mac OS X updated just today). It involves deleting both duplicates of records--file numbers--in a long one column list (there may soon be thousands of these records piling up, with many duplicates.)
    Someone over at MacScripter ("mikerickson" @ http://macscripter.net/viewtopic.php?id=32340) posted the following code for using Excel autofilter to delete only one instance of each duplicate row:
    *tell application "Microsoft Excel"*
    *set myMessySheet to get worksheet "Sheet1" of workbook "Workbook2.xls"*
    *set myMessyRange to get current region of range "A1" of myMessySheet*
    *set myCleanRange to get resize (get offset (myMessyRange) column offset ((count of columns of myMessyRange) + 1)) row size 1*
    *advanced filter myMessyRange action filter copy copy to range myCleanRange with unique*
    *-- optional deletes dirty range*
    *delete range (entire column of (get resize myMessyRange column size ((count of columns of myMessyRange) + 1))) shift shift to left*
    *end tell*
    This code works great when I copy and paste in Applescript Editor. Now, I need to find all duplicates in my data and delete both of the numbers, leaving only the single instance records/numbers. There are even instances where a number shows up three or more times; it would be great to get rid of those as well.
    Thank you in advance to anyone who can help me with this.

    I think you're going to have a hard time doing this because the original script used Excel to do the heavy lifting (i.e. filter the duplicates). The keyword with unique in the advanced filter is what's doing that.
    Off hand, I don't see an equivalent option for the filter that finds singletons in the list. Without that you'll need to iterate through the list manually, excluding the duplicate entries.

  • Conditional display of list box in form (depends on other report column)

    Hello,
    i have one question regarding conditional display in forms.
    I have a tabular form where only one column ("flag") is updateable, all other columns are visible only.
    I changed the column "flag" from "standard report column" to "Select list (static lov)", which has the values "yes" and "no".
    This works fine. But in the running form i want to display the list box only if the column "status" = 'ERROR'.
    The column "status" can have the values 'ERROR' and 'OK'.
    When one record has "status" = 'OK', the column "flag" should not display the list box (only empty column row),
    when one record has "status" = 'ERROR" the column "flag" should display the list box.
    The idea behind is that if a record has "status" = 'ERROR' i have the possibility to confirm that "error" and update the column "flag" with "YES". This should only be possible for errors.
    This is my main problem.
    I tried with conditional display, but this hides or shows the column for the whole report/form, not on record level...
    The second problem then is, that if the column "flag" is changed to "YES" in case of column "status" = 'ERROR', then it should not be possible to change it again to 'NO". At the beginning it is 'NO', but once changed to 'YES' it should not be changeable any more.
    Is this possible?
    Thank you in advance,
    Matthias

    Hello Mike
    your solution sounds good, but unfortunately it is not working.
    None of my 2 columns are displayed, although i tried it as you wrote and the conditions should match...
    But i am no sure if this can work. If so, the 2 columns must fuse to 1 column:
    ID STATUS FLAG
    1 ERROR yes/no => comes from column1
    2 OK (null => comes from column2
    so "FLAG" must display column1 and column2 in one column. is that possible?
    regards,
    Matthias

  • What Component should be used to display the list on UI

    Hi All,
    I have a table in which when the user selects a row and tries to remove the row. I am supposed to show the pop up which shows all the rows matching to the header of the row.
    In my backing bean i have the context of the row so i could extract the matching rows form db into a List<String> . Now what i need to know is which component on the Ui will show this as a list in Pop Up.
    I mean which component af:??? should be used to display the List ?
    I am kind of new to ADF.
    Regards,
    Sharma

    inputComboboxListOfValues
    selectOneChoice
    inputListOfValues

  • First attempt to remove duplicate rows from a table...

    I have seen many people asking for a way to remove duplicate rows from data. I made up a fairly simple script. It adds a column to the table with the cell selected in it, and adds the concatenation of the data to the left into that new column. then it reads that into a list, and walks through that list to find any that are listed twice. Any that are it marks for DELETE.
    It then walks through to find each one marked for delete and removes them (you must go from bottom to top to do this, otherwise your row markings for delete don't match up to the original rows anymore). Last is to delete the column we added.
    tell application "Numbers"
    activate
    tell document 1
    -- DETERMINE THE CURRENT SHEET
    set currentsheetindex to 0
    repeat with i from 1 to the count of sheets
    tell sheet i
    set x to the count of (tables whose selection range is not missing value)
    end tell
    if x is not 0 then
    set the currentsheetindex to i
    exit repeat
    end if
    end repeat
    if the currentsheetindex is 0 then error "No sheet has a selected table."
    -- GET THE TABLE WITH CELLS
    tell sheet currentsheetindex
    set the current_table to the first table whose selection range is not missing value
    end tell
    end tell
    log current_table
    tell current_table
    set list1 to {}
    add column after column (count of columns)
    set z to (count of columns)
    repeat with j from 1 to (count of rows)
    set m to ""
    repeat with i from 1 to (z - 1)
    set m to m & value of (cell i of row j)
    end repeat
    set value of cell z of row j to m
    end repeat
    set MyRange to value of every cell of column z
    repeat with i from 1 to (count of items of MyRange)
    set n to item i of MyRange
    if n is in list1 then
    set end of list1 to "Delete"
    else
    set end of list1 to n
    end if
    end repeat
    repeat with i from (count of items of list1) to 1 by -1
    set n to item i of list1
    if n = "Delete" then remove row i
    end repeat
    remove column z
    end tell
    end tell
    Let me know how it works for y'all, it worked good on my machine, but I know localization is causing errors sometimes when I post things.
    Thanks,
    Jason
    Message was edited by: jaxjason

    Hi jason
    I hope that with the added comments it will be clear.
    Ask if something is always opaque.
    set {current_Range, current_table, current_Sheet, current_Doc} to my getSelection()
    tell application "Numbers09"
    tell document current_Doc to tell sheet current_Sheet to tell table current_table
    set list1 to {}
    add column after column (count of columns)
    set z to (count of columns)
    repeat with j from 1 to (count of rows)
    set m to ""
    tell row j
    repeat with i from 1 to (z - 1)
    set m to m & value of cell i
    end repeat
    set value of cell z to m
    end tell
    end repeat
    set theRange to value of every cell of column z
    repeat with i from (count of items of theRange) to 1 by -1
    (* As I scan the table backwards (starting from the bottom row),
    I may remove a row immediately when I discover that it is a duplicate *)
    set n to item i of theRange
    if n is in list1 then
    remove row i
    else
    set end of list1 to n
    end if
    end repeat
    remove column z
    end tell
    end tell
    --=====
    on getSelection()
    local _, theRange, theTable, theSheet, theDoc, errMsg, errNum
    tell application "Numbers09" to tell document 1
    set theSheet to ""
    repeat with i from 1 to the count of sheets
    tell sheet i
    set x to the count of tables
    if x > 0 then
    repeat with y from 1 to x
    (* Open a trap to catch the selection range.
    The structure of this item
    «class
    can't be coerced as text.
    So, when the instruction (selection range of table y) as text
    receive 'missing value' it behaves correctly and the lup continue.
    But, when it receive THE true selection range, it generates an error
    whose message is errMsg and number is errNum.
    We grab them just after the on error instruction *)
    try
    (selection range of table y) as text
    on error errMsg number errNum (*
    As we reached THE selection range, we are here.
    We grab the errMsg here. In French it looks like:
    "Impossible de transformer «class
    The handler cuts it in pieces using quots as delimiters.
    item 1 (_) "Impossible de transformer «class » "
    item 2 (theRange) "A2:M25"
    item 3 (_) " of «class NmTb» "
    item 4 (theTable) "Tableau 1"
    item 5 (_) " of «class NmSh» "
    item 6 (theSheet) "Feuille 1"
    item 7 (_) " of document "
    item 8 (theDoc) "Sans titre"
    item 9 ( I drop it ) " of application "
    item 10 ( I drop it ) "Numbers"
    item 11 (I drop it ) " en type string."
    I grab these items in the list
    {_, theRange, _, theTable, _, theSheet, _, theDoc}
    Yes, underscore is a valid name of variable.
    I often uses it when I want to drop something.
    An alternate way would be to code:
    set ll to my decoupe(errMsg, quote)
    set theRange to item 2 of ll
    set theTable to item 4 of ll
    set theSheet to item 8 of ll
    set theDoc to item 10 of ll
    it works exactly the same but it's not so elegant.
    set {_, theRange, _, theTable, _, theSheet, _, theDoc} to my decoupe(errMsg, quote)
    exit repeat (*
    as we grabbed the interesting datas, we exit the lup indexed by y.*)
    end try
    end repeat -- y
    if theSheet > "" then exit repeat (*
    If we are here after grabbing the datas, theSheet is not "" so we exit the lup indexed by i *)
    end if
    end tell -- sheet
    end repeat -- i
    (* We may arrive here with two kinds of results.
    if we grabbed a selection, theSheet is something like "Feuille 1"
    if we didn't grabbed a selection, theSheet is the "" defined on entry
    and we generate an error which is not trapped so it stops the program *)
    if theSheet = "" then error "No sheet has a selected table."
    end tell -- document
    (* Now, we send to the caller the interesting datas :
    theRange "A2:M25"
    theTable "Tableau 1"
    theSheet "Feuille 1"
    theDoc "Sans titre" *)
    return {theRange, theTable, theSheet, theDoc}
    end getSelection
    --=====
    on decoupe(t, d)
    local l
    set AppleScript's text item delimiters to d (*
    Cut the text t in pieces using d as delimiter *)
    set l to text items of t
    set AppleScript's text item delimiters to "" (*
    Resets the delimiters to the standard value. *)
    (* Send the list to the caller *)
    return l
    end decoupe
    --=====
    Have fun
    And if it's not clear enough, you may ask for more explanations.
    Yvan KOENIG (from FRANCE mardi 27 janvier 2009 21:49:19)

Maybe you are looking for

  • TS5164 itunes tv show help please.

    Have season 9 pass for Criminal Minds.  Watched until recently.  Last two episodes will not play.  Gives a simple error message, no code or anything.  What's up?

  • How to get lov display value dynamically for an item according to date pick

    Hi friends, I have a date picker item called on_date, and also one lov item course_name If i select one date from the date picker item means, automatically the course name corresponding to the date has to populate in the course_name item lov. suppose

  • HT3964 folder with question mark

    when trying to turn on computer I get the white screen and then see an error ...a folder with a question mark inside it.

  • Leaver Employee Org Unit Assignment..

    Dear All, In our current system when some employee leaves the company while performing the leaving action we make the postion assigned to the employee as default position while we leave the org unit value the way it was.. We are not sure what should

  • Address Book: Deleting 'Department' field - TOTAL NEWBIE

    Hi... I amended a card to include the Department Field via the 'add field' function. Now I can't delete it as I want to use a different field instead. Can someone please help? Tks...