Filtering table on checkbox state

Hello Everyone,
I'd like to achieve a quite simple goal: to filter a table on a column that contains checkboxes. Three options would be to show checked, unchecked or all. Using the standard table handler (IF_WD_TABLE_METHOD_HNDL) the behavior is not surprisingly the following:filtering checked entries ('X') works fine, but filtering unchecked entries (' ') will show all entries as the filter criteria has initial value which is being interpreted as there is no filter criteria.
There must be a very simple solution for this. All ideas are welcome.
Thanks, regards,
Peter

Unfortunately - no simple solution.
But given that you are given the on_Filter event you can code one yourself...
sorry - but the standard implementation of  IF_WD_TABLE_METHOD_HNDL~APPLY_FILTER doesn't allow you much wriggle room here - it retrieves the value of the filter and compares to "INITIAL" as you mentioned.
Can only suggest a custom implementation of your own filter method - you can't really override the attribute that is filtered easily - retrieved using CL_WD_ABSTRACT_TOGGLE->GET__PRIMARY_PROPERTY_BINDING for checkboxes - would be nice to redirect this to an alternate binding but that would cause other problems...
Would be interested if anyone else has already done this!
Chris

Similar Messages

  • Filtering Tables with Checkboxes?

    Hi, does anybody if it's possible to filter a table according to checkbox values and if so how? I have a book wishlist table, and I added a checkbox column called "Bought". I'd like to filter the table according to whether the checkbox is ticked or not, e.g. only bought/not-yet-bought books. Is this possible with Numbers? I tried using "Bought" equals TRUE/FALSE, but it didn't work. Thanks in advance!

    I did what I think you said and it worked...
    Then, enabling the filter by checking "Show rows that match the following" in the "Sort & Filter" window gives...
    Did I miss what you meant? Did you try "Bought" "is" "TRUE" in the "Sort & Filter" window?

  • Saving checkbox-state to table in Interactive Report

    Hi,
    I have been working with the information on http://www.apexninjas.com/blog/wp-content/uploads/2012/03/Checkboxes_in_Interactive_Reports.pdf to create an interactive report with a column containing a checkbox for each row.
    My report contains the following (simplified):
    Task_id, Employee_id, Checkbox_column
    The checkbox_column keeps track of which employees work on which tasks, so it could be:
    Task_id, Employee_id, Checkbox_column
    1               1                         0
    1               2                         1
    1               3                         0
    signifying that only employee 2 works on task 1.
    Now, I need to be able to change the 0 to 1 by clicking the checkbox, which already is possible, but I have problems saving that row to the database. Saving the checkbox state is also included in the PDF I used (page 12-14, 'Saving the checkbox state #2'), but I don't really understand where to put the scripts, I haven't worked with scripts and processes before so I could use some help understanding which script I need to put where. All in all, it's not too much code, I just don't understand where to put it.
    The scripts mentioned in the PDF are:
    The first one is a SQL-statement or a package, I imported the package in my environment, so I won't put the SQL here
    This is the only one I know where to put:
    <script type="text/javascript">
    function getCurIRTab()
    var temp_base_report_id = $v('apexir_report_id');
    return temp_base_report_id;
    </script>
    This I don't know where to put:
    <script type="text/javascript">
    document.getElementById('P_IR_REPORT_ID').value = getCurIRTab();
    </script>
    the PDF says:
    Now, create a hidden (just hidden, not protected!) item called P_IR_REPORT_ ID inside a HTML region.
    Important! This region has to be rendered afterthe Interactive Report, so create it in the “after footer” display point!
    In this regions’s footer paste the following JavaScript code, that will assign the hidden item P_IR_REPORT_ID the value of the Interactive Report ID.
    But can we create a region in the after footer?
    This I don't know where to put because the document doesn't specify it:
    apex_ir_query.ir_query_where
    (:APP_ID,--application id
    99,--page id
    :SESSION,--sesion ID
    : P_IR_REPORT_ID -–interactive report ID);
    This I don't know where to put, but I guess it's a 'processing' process:
    declare
    whereStmt varchar2(2000);
    sqlStmt varchar2(2000);
    begin
    whereStmt := apex_ir_query.ir_query_where(:APP_ID,
    99,
    :SESSION,
    :P_IR_REPORT_ID);
    sqlStmt := 'update CHK_TEST set SELECTED = 0 where SELECTED= 1'||whereStmt;
    execute immediate sqlStmt;
    if APEX_APPLICATION.G_F01.COUNT>0 then
    FOR i in 1..APEX_APPLICATION.G_F01.COUNT LOOP
    update CHK_TEST
    set VALID_LINE = 1
    where SELECTED_ID = APEX_APPLICATION.G_F01(i)
    and VALID_LINE = 0;
    END LOOP;
    end if;
    end;
    Can I please get some help understanding where exactly to put these scripts?
    I've been looking around on the forum and Google but I can't find the detailed answer to what I'm looking for anywhere.
    I am currently working with the test environment Oracle supplied us, because we are testing if we can use APEX at our company.
    The version is Application Express 4.2.2.00.11 and it's running on Oracle 11g.
    Just ask if you need any more info.
    Thanks for the answers!
    NDG

    Please put together an example application on apex.oracle.com and provide developer credentials.  This would help prevent multiple posts back and forth about try this, try that, now try this, now try that......
    But until you do that try this:
    I think you already know that the following goes in the page html header.
    <script type="text/javascript">
    function getCurIRTab()
    var temp_base_report_id = $v('apexir_report_id');
    return temp_base_report_id;
    </script>
    Alternately, since you are on apex 4.2 you could just add it to the Page Attributes->JavaScript->Function and Global Variable Declaration field (without the script tags):
    function getCurIRTab()
    var temp_base_report_id = $v('apexir_report_id');
    return temp_base_report_id;
    Now you need to create an HTML region (in display point "after footer").  Then you create the P_IR_REPORT_ID hidden item inside your new region.
    In the region definition you will put the following code into the region footer:
    <script type="text/javascript">
    document.getElementById('P_IR_REPORT_ID').value = getCurIRTab();
    </script>
    Alternately, you could try to add the line to the Page Attributes->JavaScript->Execute when Page Loads field:
    document.getElementById('P_IR_REPORT_ID').value = getCurIRTab();
    This is just an example of the procedure call you will make in your page process.
    apex_ir_query.ir_query_where
    (:APP_ID,--application id
    99,--page id
    :SESSION,--sesion ID
    : P_IR_REPORT_ID -–interactive report ID);
    It is included in this code which you will put into a page process.
    declare
    whereStmt varchar2(2000);
    sqlStmt varchar2(2000);
    begin
    whereStmt := apex_ir_query.ir_query_where(:APP_ID,
    99,
    :SESSION,
    :P_IR_REPORT_ID);
    sqlStmt := 'update CHK_TEST set SELECTED = 0 where SELECTED= 1'||whereStmt;
    execute immediate sqlStmt;
    if APEX_APPLICATION.G_F01.COUNT>0 then
    FOR i in 1..APEX_APPLICATION.G_F01.COUNT LOOP
    update CHK_TEST
    set VALID_LINE = 1
    where SELECTED_ID = APEX_APPLICATION.G_F01(i)
    and VALID_LINE = 0;
    END LOOP;
    end if;
    end;
    Ok, clear as mud!

  • NamedViewCriteria not working when drag and dropped as filtered table.

    Using JDev 11.1.2.1.0.
    I'm attempting to use NamedViewCriteria more and more because, well ... I keep reading it's the way to go. But I'm encountering an aggravating problem. I can't get them to work when I drag and drop as a filtered table onto a page. They work when I apply them in a managed bean, but simply dragging and dropping will not trigger the NamedViewCriteria to display the filtered items correctly.
    Creating a where clause manually works fine.
    Manual Where Clause & drag and drop ViewObject from data control
    (:pBpKey is null or upper(BP_KEY) like '%' || upper(:pBpKey) || '%') AND CinderBusinessPartners.BP_TYPE = 'C'NamedViewCriteria & drag and drop from ViewObject's NamedViewCriteria from data control
    ( ( (CinderBusinessPartners.BP_KEY LIKE ('%' || :pBpKey || '%') ) AND (CinderBusinessPartners.BP_TYPE = 'C' ) ) )There are three problems:
    1) The query pulls back all items. It doesn't retrieve only where BP_TYPE = 'C'.
    2) It is case sensitive. i.e. Enter in A will not pull back the customer Wal-Mart because Wal-mart contains lowercase a's.
    3) If I set the table's "Show Filter" attribute to true, the filter has the text "\*pBpKey\*" filled in by default. uhhh What?
    In the NamedViewCriteria's "UI Hints" tab, I have the "Query Automatically" checkbox selected.
    Any ideas why the NamedViewCriteria isn't "just working"?
    I'll be back with pictures after the break.
    Will

    I've rolled this into a bug post as seen here: BUG: NamedViewCriteria drag and drop as table SNAFU
    Pictures:
    Here is the NVC query
    http://www.williverstravels.com/JDev/Forums/Threads/2381120/Nvc1.jpg
    Here's that dang extra bind variable!
    http://www.williverstravels.com/JDev/Forums/Threads/2381120/Nvc3.jpg
    And just because I like awesome Paint.Net art.
    http://www.williverstravels.com/JDev/Forums/Threads/2381120/Nvc2.jpg
    Hope this helps someone down the road.
    Edited by: LovettWB on Apr 26, 2012 1:59 PM

  • How to insert a table with ref statement?

    the script:
    CREATE OR REPLACE TYPE B_T AS OBJECT (
    type varchar(6),
    value number(2));
    create table Bo of B_T;
    insert into Bo values('a',0);
    insert into Bo values('b',1);
    create or replace type try_T AS OBJECT(
    iii number(10),
    aaa ref B_T);
    create table try of try_T
    (scope for (aaa) is Bo);
    how to insert into the "try" table?
    the statement:
    insert into try values(4,B_T('a'))
    or :
    insert into try values(4, ref(t) from bo t where bo.type='a');
    both are erro.
    help me please.

    Hi,
    Right click the mouse->create->table
    If you want 5 columns, you need to declare 5 cells in one line type of the table
    Click on Table -> Details, then do the following
    Line Type 1 2 3 4 5
    L1 2mm 3mm etc
    Here specify the width of the columns as many as you want..
    then in the header/main area of the table, click create Table Line, Rowtype is L1, automatically 5 cells will come,In each cell create a text element, display the variable to be printed there.

  • Mutating table and row state - this was unexpected

    So, I learned in a class about 3 years ago to expect the following
    SQL> create table p (pk number primary key);
    Table created.
    SQL> create table c (fk number references p(pk));
    Table created.
    SQL> create or replace trigger t_insrt
      2  before insert on p
      3  for each row
      4  begin
      5   insert into c values (:new.pk);
      6  end;
      7  /
    Trigger created.
    SQL> insert into p values (1);
    insert into p values (1)
    ERROR at line 1:
    ORA-02291: integrity constraint (FORBESC.SYS_C00169150) violated - parent key
    not found
    ORA-06512: at "FORBESC.T_INSRT", line 2
    ORA-04088: error during execution of trigger 'FORBESC.T_INSRT'and so it led me to think that replicating ON MODIFY PARENT - MODIFY CHILD functionality wouldn't work in a BEFORE ROW trigger, but it does
    SQL> drop trigger t_insrt;
    Trigger dropped.
    SQL> create or replace trigger p_updt
      2  before update on p
      3  for each row
      4  begin
      5   update c
      6   set fk = :new.pk
      7   where fk = :old.pk;
      8  end;
      9  /
    Trigger created.
    SQL> insert into p values (1);
    1 row created.
    SQL> insert into c values (1);
    1 row created.
    SQL> select * from c;
            FK
             1
    SQL> update p
      2  set pk = 2
      3  where pk = 1;
    1 row updated.
    SQL> select * from c;
            FK
             2Why would the first scenario fail while the second succeeds? The update seems prone to a parent record also not existing, at least not by the BEFORE ROW trigger.
    ---=Chuck

    < mutating table and row state >
    BTW, you don't seem to have run into the mutating table error though 2 other threads today are also about it. You have a constraint violation, a different thing entirely.
    I believe the second scenario works because you're neatly avoiding the error of the first. The error "ORA-02291: integrity constraint (FORBESC.SYS_C00169150) violated" means that on insert Oracle is looking up the value you're trying to insert, not finding it, and raising an error. With the before trigger you are taking the assigned value from the insert, updating the parent to it, so that on actual insert when the check happens the value is there due to the update.
    I'm not convinced this is a good idea because any on-the-fly approach to data entry needs to be examined carefully.

  • Using plsql tables in select statement of report query

    Hi
    Anyone have experience to use plsql table to select statement to create a report. In otherwords, How to run report using flat file (xx.txt) information like 10 records in flat files and use this 10 records to the report and run pdf files.
    thanks in advance
    suresh

    hi,
    u can use the utl_file package to do that using a ref cursor query in the data model and u can have this code to read data from a flat file
    declare
    ur_file utl_file.file_type;
    my_result varchar2(250);
    begin
    ur_file := UTL_FILE.FOPEN ('&directory', '&filename', 'r') ;
    utl_file.get_line(ur_file, my_result);
    dbms_output.put_line(my_result);
    utl_file.fclose(ur_file);
    end;
    make sure u have an entry in ur init.ora saying that your
    utl_file_dir = '\your directory where ur files reside'
    cheers!
    [email protected]

  • FETCHING VALUES IN MULTI RECORD BLOCK FROM ANOTHER TABLE USING SELECT STATEMENT.

    Hi,
    I have one multi record block in which i want to fetch values
    (more then one record) from another table using select statement
    IN KEY NEXT ITEM.I am getting following error.
    ORA-01422: exact fetch returns more than requested number of rows
    Thanks in advance.

    In your case I see no reason to use non-database block and to try to populate it from a trigger with a query, instead of using the default forms functionality where you can associate the block and the fields with table, create where clause using bind variables and simply use execute_query() build-in to populate the block. The power of the forms is to use their build-in functionality to interact with the database.
    Also, you can base your block on a query, not on a table and you dynamically change this query using set_block_property() build-in. You can use any dynamic queries (based on different data sources) and you simply need to control the column's data type, the number of the columns and their aliases. Something like creating inline views as a block data source.
    However, you can replace the explicit cursor with implicit one like
    go_block('non_db_block_name');
    first_record();
    FOR v_tab IN (SELECT *
    FROM tab
    WHERE col_name = :variable)
    LOOP
    :non_db_block_name.field1 := v_tab.col1;
    :non_db_block_name.field2 := v_tab.col2;
    next_record();
    END LOOP;

  • Picking the right values from tables - SQL (select statement)

    Hi everyone,
    I'm facing the litlle(?) problem in Oracle environment.
    Let me explain:
    I have two tables.
    TABLE 1
    Id1 | Val1 | Id2 | Val2
    A | 44 | B | 36
    B | 36 | A | 44
    TABLE 2
    Id | Name
    A | New York
    B | Seattle
    I need to get from those tables, using SQL statement, result like this:
    Id1 | Val1 | Name1 | Id2 | Val2 | Name2
    A | 44 | New York | B | 36 | Seattle
    NOTE !! Very important!! If in table 1 we have crossed the same values in fields IdX and ValX in two rows (like in example)- just one of them should be presented as a result.
    I'm afraid it's a bit too complex. You, guys are my last hope.
    Looking forward for any solutions.
    Thanks in advance!

    jeneesh wrote:
    This can give you a startJaneesh, the OP specified that the duplication was across the ID and the VAL columns, but your solution only checks the ID's..
    SQL> ed
    Wrote file afiedt.buf
      1  with t1 as (select 'A' as id1, 44 as val1, 'A' as id2, 36 as val2 from dual union all
      2              select 'A', 36, 'A', 36 from dual)
      3      ,t2 as (select 'A' as id, 'New York' as name from dual union all
      4              select 'B', 'Seattle' from dual)
      5  -- END OF TEST DATA
      6  select distinct greatest(id1,id2) id1,
      7         case when id1 > id2 then val1 else val2 end val1,a.name name1,
      8         least(id1,id2) id2,
      9         case when id1 < id2 then val1 else val2 end val2,b.name name2
    10  from t1 t,t2 a,t2 b
    11  where greatest(id1,id2) = a.id
    12* and least(id1,id2) = b.id
    SQL> /
    I       VAL1 NAME1    I       VAL2 NAME2
    A         36 New York A         36 New York
    SQL>With this data I would have expected both rows to be returned as there is a difference in the val columns..
    SQL> ed
    Wrote file afiedt.buf
      1  with t1 as (select 'A' as id1, 44 as val1, 'A' as id2, 36 as val2 from dual union all
      2              select 'A', 36, 'A', 36 from dual)
      3      ,t2 as (select 'A' as id, 'New York' as name from dual union all
      4              select 'B', 'Seattle' from dual)
      5  -- END OF TEST DATA
      6      ,t3 as (select distinct id1, val1, id2, val2
      7              from
      8                (
      9                 select decode(switch,1,id2,id1) as id1
    10                       ,decode(switch,1,val2,val1) as val1
    11                       ,decode(switch,1,id1,id2) as id2
    12                       ,decode(switch,1,val1,val2) as val2
    13                 from (select id1, val1, id2, val2
    14                             ,case when id1||val1 > id2||val2 then 1 else 0 end as switch
    15                       from t1)
    16                )
    17             )
    18  --
    19  select t3.id1, t3.val1, t2_1.name
    20        ,t3.id2, t3.val2, t2_2.name
    21  from   t3 join t2 t2_1 on (t2_1.id = t3.id1)
    22*           join t2 t2_2 on (t2_2.id = t3.id2)
    SQL> /
    I       VAL1 NAME     I       VAL2 NAME
    A         36 New York A         36 New York
    A         36 New York A         44 New York

  • Problem in modifying a table through modify statement

    Hi,
    I am trying to update a 'Z' table in which there are 5 fields comprising of primary key. Out of them 2 key fields are defined as a part of seconadry index with 'Unique' option selected.
    As per the requirement, I am trying to update the table using modify statement so whenever this statement occurs it will check the primary keys and accordingly try to modify a record or insert a new record.
    But as there is Unique Index defined on 2 of the key fields the Modify query is

    Hi,
    Your syntax for MODIFY is not correct.
    As other friends suggested you can have index and you can modify the internal table.
    Whenever we are modifying internal table inside LOOP, we can omit index as system will take current row by default. So MODIFY statement should be written as follows:
    MODIFY T_ITPO5 from W_ITPO5 transporting AUFNR
    You can LOOP FROM INDEX also for the same to improve performance.
    data: wv_index like sy-tabix.
    sort T_ITPO5 by aufnr.
    sort T_ITPO4 by aufnr.
    wv_index = 1.
    LOOP AT T_ITPO5 INTO W_ITPO5.
         LOOP AT T_ITPO4 INTO W_ITPO4 from wv_index.
         if W_ITPO4-aufnr eq W_ITPO5-aufnr.
              IF ITPO4-NTGEW 0 .
                  CALL FUNCTION 'ZGET_ITEM_WEIGHT'
                    EXPORTING
                       P_BUID = W_ITPO4-WERKS
                       P_ITEMID = W_ITPO4-MATNR
                       P_QTY = 1
                       P_UOM = W_ITPO4-MEINS
                       P_UOM1 = 'KG'
                   IMPORTING
                      P_RETVAL = W_ITPO4-WTKG.
    TOTWT1 = W_ITPO4-WTKG * W_ITPO4-MENGE.
    IF W_ITPO4-BWART = '261'.
    W_ITPO5-I_QTY = W_ITPO5-I_QTY + TOTWT1.
    ELSEIF W_ITPO4-BWART = '101' OR W_ITPO4-BWART = '531'.
    W_ITPO5-I_QTY = W_ITPO5-I_QTY - TOTWT1.
    ENDIF.                    " IF W_ITPO4-BWART = '261'.
    endif.
    elseif W_ITPO4-aufnr gt W_ITPO5-aufnr.
       move sy-tabix to wv_index.
       exit.
    endif.                      " if W_ITPO4-aufnr eq W_ITPO5-aufnr.
    ENDLOOP.
    MODIFY T_ITPO5 FROM W_ITPO5 transporting aufnr.
    ENDLOOP.

  • Using Logical Databases and the Tables or Nodes Statement

    I want to start using Logical Databases whenever possible, but it seems that I need to use the Tables or Nodes statement for the Get statement to work.  Is there anyway to avoid Tables/Nodes statement since they are obsolete (and still use LDBs)?
    Message was edited by: Jason DeLuca

    Hi Jason,
    1) table statement is obligatory:
    -> look at abap-docu to GET:
    node is a node in the logical database that is assigned to the report (type 1 program) in the program attributes. <b>You must declare the node in the report using the NODES statement (or the TABLES statement, if the node is of the type "table").</b>
    2) some ldb-selections from the selection screen
       depends on the table-statement too, i remember...
    regards Andreas

  • Delete from two tables in one statement

    Hi,
    Is there a way to delete from two tables in one statement?
    Actually I have two tables:
    1. Base table (id, name, age)
    2. Person table (id, city, street)
    The id in both tables is identical.
    I would like to delete using something like a join:
    Delete from base, person where id=2;
    Thanks
    dyahav

    Hi,
    If you want to delete records both at a time them your table must use ON DELETE CASCADE. See the below example.
    CREATE TABLE supplier
    ( supplier_id numeric(10) not null,
    supplier_name varchar2(50) not null,
    contact_name varchar2(50),
    CONSTRAINT supplier_pk PRIMARY KEY (supplier_id)
    CREATE TABLE products
    ( product_id numeric(10) not null,
    supplier_id numeric(10) not null,
    CONSTRAINT fk_supplier
    FOREIGN KEY (supplier_id)
    REFERENCES supplier(supplier_id)
    ON DELETE CASCADE
    In this example, we've created a primary key on the supplier table called supplier_pk. It consists of only one field - the supplier_id field. Then we've created a foreign key called fk_supplier on the products table that references the supplier table based on the supplier_id field.
    Because of the cascade delete, when a record in the supplier table is deleted, all records in the products table will also be deleted that have the same supplier_id value.
    Thank you.

  • Checkbox State Help

    Try to get the checkbox state into a var from an if Flash CS3
    AS2.0
    When I press a button I have set up to email I cannot seem to
    get the state of the checkbox working.
    I can get a value but is always the same weather ticked or
    not. below code always returns no
    Please can anyone help
    on (release) {
    if (this.RSVP_text_popup.Check_box.selected) {
    var Coming = "Yes";
    } else {
    var Coming = "No";
    var subject = "Wedding Invite "+GuestsNames.text+" "+Coming;
    var body =
    _root.RSVP_text_popup.RSVP_bodycopy.body_Text.text;
    getURL("mailto:[email protected]"+"?subject="+subject+"&body="+body);
    }

    use trace(this.RSVP_text_popup.Check_box) to confirm the
    problem is an incorrect path/name issue.

  • Will alter table table_name move statement change the storage parammeter

    Hi there,
    I have a question about table reorgnization. Will alter table
    table_name move SQL statment change the table's storage parameter
    or keep the same as the original one? If I want to use alter
    table statement to do table defragmentation and change the
    initial and next storage parameter, how will I write this SQL
    statement?
    Thanks in advance.

    Thanks. My table has 5000 extents each of which is 64k, so I
    think I need to do table defragmentation to improve performance.
    If I use alter table table_name move without storage parameter
    and tablespace name, I will relocate this table in current
    tablespace and adopt the current tablespace's storage parameter
    as my table's new storage paramater which is still 64k. After
    that, if I issue alter
    table table_name storage (initial 50M next=50M) command, will it
    change this table's storage parameter and decrease the totoal
    extents number? I ask this question because I use OEM2.2 tuning
    pack reorg wizard to generate the job script to do table
    defragmentation, but in the job script there is no new storage
    parameter. It only generate alter table table_name move
    statement, so I wonder if I don't need to modify this job scripts
    and after it executes this job script, I issue alter table
    table_name storage parameter command manaully. Will this solve
    my problem or I must modify the job script and add new storage
    parameter in the job script?

  • How are execution plan created with tables of stale stats

    Hello
    I would like to ask the group
    1. How oracle handels the execution plan with table joins where some tables have stale stats
    2. How would oracle handel execution plan where the table has histogram but the stats are stale.
    Database version 11.1.0.7.0
    Thanks
    Arun

    ALTER SESSION SET EVENTS='10053 trace name context forever, level 1';
    by doing above before executing the SQL, you can see what & how CBO arrives at the actual execution plan

Maybe you are looking for