How to insert a line checked several

Hi friends,

IM facing a scenario. Let me explain.

I have a page with a report and a button (these two in a homepage).

I have a tabular presentation based on a table that opens in a pop-up window by pressing a button located on the home page. In this sick in tabular form be select several lines and if I press Add button in the pop - up, then all the lines checked must insert in the table report located in the home page.

How can I achieve this.

Can someone help me with this problem.

Brgds,
Mini

Mini,

I've updated my example for you.

There are several ways to accomplish what you're looking for, here are two options:
1. make an ajax call on beforerefresh pop-up report.
2 persists the values checked in a page element and use it instead of an array.

In my example, I used the second option. Instead of using an item hidden, I used a text field you can see the selected values. Here are the changes I made:

1. Add a new region and an article about her, I called my article "P33_SELECTED_WIDGETS".
2. in the declarations of global variables in your definition of the page, add the following text:

    var pkArray = [];

3. change the report query to refer to the element on the page and ensure that the State of the check box reflects the values that you have seaved in your page element.

select
    SEQ,
    APEX_ITEM.CHECKBOX2(
      2,
      SEQ,
      'class="pk-selector" ' || SEQ_CHECK
    ) SEQ_CHECK,
    NAME,
    READY_DATE,
    COMMENTS
  from(
      select
          SEQ,
          case
             when instr(':' || :P33_SELECTED_WIDGETS || ':',
                        ':' || SEQ || ':') > 0 then
                 'checked="checked"'
             else ''
          end SEQ_CHECK,
          NAME,
          READY_DATE,
          COMMENTS
        from widgets_broken
)

4. create a dynamic action to manage the persistence the checked values.

* Name: * bind_click_handler
* Event: * after refresh
* Type selection *: region
* Region: *
Real actions:
* Seq *: 10
* Fire on Page Load *: Yes
* Execute JavaScript Code *:

$('.pk-selector').bind('click',function(){
  $this = $(this);
  var checkVal = $this.val();

  if($this.prop("checked")){
    pkArray.push(checkVal); //save checked value
  }else{
    pkArray.splice( $.inArray(checkVal, pkArray), 1 ); //remove unchecked value
  }
  $s('P33_SELECTED_WIDGETS',pkArray.join(':')); //update page item with new values
});

Edit
I left a decisive step. In your background report, ensure that this partial page refresh is enabled and P33_SELECTED_WIDGETS builds page elements to present the attribute.

Finally, change the proceudure files add to refer to the page instead of globl table element.

BEGIN

    insert into widgets(NAME,READY_DATE,COMMENTS)
    select name, ready_date, comments
      from widgets_broken
     where instr(':' || :P33_SELECTED_WIDGETS || ':', ':' || SEQ || ':') > 0;

    delete from widgets_broken
      where instr(':' || :P33_SELECTED_WIDGETS || ':', ':' || SEQ || ':') > 0;

    :P33_REC_CNT := SQL%ROWCOUNT;
END;

See you soon,.
Janet Tyson

Published by: Tyson Janet January 3, 2012 13:13

Tags: Database

Similar Questions

  • How to insert multiple lines using a single query

    Hi all

    How to insert multiple lines using a single query to the emp table?
    I have the number of rows to insert into table x. consumes a lot of time. I tried to insert several lines using a single query, but get errors. I know exactly the query to do this.


    Thank you
    Sunil

    Like this?

    SQL> create table test(id number , dt date);
    
    Table created.
    
    SQL> insert into test values(&a,&b);
    Enter value for a: 1   --- It asked me and I entered 1
    Enter value for b: sysdate  --- It asked me and I entered sysdate
    old   1: insert into test values(&a,&b)
    new   1: insert into test values(1,sysdate)
    
    1 row created.
    
    SQL> 
    

    g.

  • How to insert multiple lines in viewobject with primary key?

    Hello

    I use Jdeveloper 11.1.1.3.0 version.

    I create object entity based on the table of the database that have primary keys.
    I created the view on this entity object. I created an array of viewobject, with CreatInsert button and my primary key in the table may while the new record is added.

    Now my problem is that I have created several rows by pressing CreateInsert Button several rows of time are created and displayed in the table. I insert data in all columns of all rows when I click on the submit button (who have the Action "# {bindings.Commit.execute} ') will save data of any 1 line not all data line.

    How can I save all the lines that is created in a single transaction?

    Thanks in advance
    Amit

    Amit,

    I just tried this (all by default, no code written), and he recorded all of the lines. It must be something unique to your application. Michael asks a lot of questions.

    John

  • How to insert multiple lines to the DB table

    I create processes in BPM Studio 10 g.

    I write below the code snippet to insert data in the database.
    However, it does not work.

    In the flow of the screen, the user can key in several rows of data. I try to add the to_char (element.purpose), but the Studio does not allow me to do.

    I think the code is wrong, but I don't know how to change it.

    ----------------code in PBL------------------------------------------------------------------------------
    for each item in BPMObject.group1
    do

    Insert in DBM. SOADEMO. SZ_TABLE (id, amount, purpose, result)
    values (element.id, element.amount, element.purpose, element.result)

    end

    -----------------------------------------------------------------------------------------------------------------

    ID, amount: decimal
    Purpose, result: String

    DBM: Module
    A group is under a BPMObject but not inherit a table.

    Hello

    It seems that you do not use a variable in the statement "for each.

    Right now you have:

    for each item in BPMObject.group1...

    You can add a new instance variable called 'bpmObject' which is of the type "BPMObject". You must use this variable in the job call the interactive component fills the table of the group. Then, you would change your logic to reflect this change by making it to read:

    for each item in bpmObject.group1...

    Hope this helps,
    Dan

  • How to insert a PDF into several PDF?

    Hi people,

    I have a PDF that is a cover page, and I would like to insert it at the beginning many PDF. How can I do without adding files?

    Thanks for your help,
    Franck

    If you have the professional version, you can use the professional treatment (actions in Acrobat X) to insert the PDF as a page at the beginning of the PDF file in batches.

    ,

  • How to capture the line checked a DataGrid data

    I have data within a DataGrid as shown.

    < mx:DataGrid id = "dataGrid" dataProvider = "{myAC}" = "10" XY = "177" visible = "true" >
    < mx:columns >

    < mx:DataGridColumn headerText = itemRenderer="mx.contrls.RadioButton"/ "SLNO" >
    < mx:DataGridColumn dataField = "EmpId" headerText = "Name" / >
    < mx:DataGridColumn dataField = "Ename" headerText = "Password" / >
    < mx:DataGridColumn dataField = "EmpDepartment" headerText = "CPasswords" / >
    < / mx:DataGridColumn >

    < mx:Button = "149" x = "327" label = "Button" click = "deleteRow ()" / >

    < mx:script >

    public function deleteRow (): void
    {
    Need a logic here
    }
    < / mx:script >

    Now my requirement is that when the user activates a row inside a DataGrid control and one button Delete, I need to capture this EMPID.
    I'm planning a delete button this DataGrid as shown above.

    Please tell me how to capture this EMPID activated inside the deleteRow() function

    Thanks in advance.


    Hi Kiran

    You can use the simple code below for the EmpId of the selectedItem in DataGrid...


    http://www.Adobe.com/2006/mxml">
      
       Import mx.controls.Alert;
         
    [Bindable] private var myAC:Array =]
    {EmpId:1001, Ename: 'Harish', EmpDepartment: 'HE'},
    {EmpId:1002, Album: 'Carmy', EmpDepartment: 'HARDWARE'},
    {EmpId:1002, Album: 'Pavan', EmpDepartment: 'NETWORK'},
    ];
               
    public void deleteEmployee (): void {}
    If (dataGrid.selectedItem! = null & dataGrid.selectedItem.hasOwnProperty ("EmpId"))
    {
    var empId:int = dataGrid.selectedItem.EmpId;
    Alert.Show ("EmpId =" & empId)
    }
    on the other
    {
    Alert.Show ("Please select a line to delete.");
    }
    }
         
    ]]>
      

              
     
                  
                  
      
      
     



    Thank you

    Jean Claude Chari

  • How to divide a line into several posts based on the period.

    Hello

    I have data from the table like this:

    Project EMP_ID Date_Assignment Date_Expiry EMP_TYP

    P001 1000 1 JUNE 2015 30 JUNE 2015 D

    P001 1001 1 JULY 2015 31 JULY 2015 D

    1002 1 AUGUST 2015 31 AUGUST P001 2015 D

    P001 2000 01 - JUN - 2015 31-DEC-9999 M

    The report of three developers to the Manager during their own lifetime. I want the corresponding duration of Manager for each of them:

    Project EMP_ID Date_Assignment Date_Expiry EMP_TYP

    P001 1000 1 JUNE 2015 30 JUNE 2015 D

    P001 1001 1 JULY 2015 31 JULY 2015 D

    1002 1 AUGUST 2015 31 AUGUST P001 2015 D

    P001 2000 1 June 2015 M June 30, 2015

    P001 2000 July 1, 2015 M July 31, 2015

    P001 2000 31 August 1, 2015-AUG - 2015 M

    P001 2000 M 01-SEP-2015 31-DEC-9999

    For the last span (01-SEPT.-15 to 31 - DEC-9999) there is no developer reporting to the Manager.

    How in Oracle 11 g?

    Post edited by: 2808486

    The date ranges developers will never overlap? If so, what would happen?

    Your desired results can be achieved like this, but I don't think it makes a lot of sense:

    SELECT emp_id, date_assignment, date_expiry, emp_typ

    WCP

    WHERE emp_typ = '

    UNION ALL

    SELECT em.emp_id, ed.date_assignment, ed.date_expiry, em.emp_typ

    Ed, em emp EMP

    WHERE ed.emp_typ = '

    AND em.emp_typ = am'

    UNION ALL

    SELECT em.emp_id, MAX (ed.date_expiry) + 1, TO_DATE (31-DEC-9999 ',' mon-dd-yyyy ""), em.emp_typ

    EMP ed, emd em

    WHERE ed.emp_typ = '

    AND em.emp_typ = am'

    GROUP BY em.emp_id

    ORDER BY 4.2

  • How to extend a line with several anchor points

    Hi, the image below is expanded to show all the anchor at the end of the cord.  The blue lines are the power cord and the green lines are in the shade.  The image below which gives you the image at this time.  What I try to achieve is to extend the string to the left so that I can use the image as the background for a very long area 2561px by 141px.  Appreciate your help

    Screen Shot 2015-06-18 at 6.13.51 pm.png

    Screen Shot 2015-06-18 at 6.24.10 pm.png

    Use the direct Selection (NOT the selection tool) tool and the marquee your selection around the area that you have demonstrated. Then zoom out and you will then be able to move these points to where you want.

  • Insert a line in a form to separate 2 groups of fields...

    I'm new to APEX and since there is no drag-and - déposer to develop a new form, I am struggling to find how to insert a line in a form to be used as a separator between two groups of data fields on the form... it's probably simple.

    Create a new item (display only, display text (does not save the State), no label)

  • How to insert rows in multiple tables in a sql

    I want to know how to insert multiple lines in a single sql statement.

    Let's insert records into the table emp and dept in a sql statement.


    Thank you

    It's here

    SQL>l
      1  insert all
      2    into emp values(8888,'WADE','MANAGER',7839,'01-MAR-2008',5000,100,20)
      3    into dept values(50,'MARKETING','NEW YORK')
      4* select * from dual
    SQL> /
    
    2 rows created.
    

    SS

  • How can I get rid of a redirect virus. It is not DNS, I checked several times. I scanned my Mac with Malware bytes multiple times. He is yet to come. I am very confused. Help me!

    I'm on MacBook Pro (retina, 15 inch, mid-2015) how can I get rid of a redirect virus. I use Google Chrome. It is not DNS, I checked several times. I scanned my Mac with Malware bytes multiple times. He is yet to come. I am very confused. Help me!

    http://Syndication.ExoClick.com/splash.php?IDZone=1758202&type=8

    It's the kind of redirects that I get all the time

  • How to insert an InlineGraphicElement beginning of line

    When I insert InlineGraphicElement it insert end of line

    How to insert at the beginning of line

    insertInlineGraphic (source:object, width:object, height:object, options:Object = null, operationState:SelectionState = null):InlineGraphicElement
    the value of Appiles to change the place of the chart online
  • How do validation before inserting a line when press a button insert create?

    Hi all;

    I use JDev 11.1.1.2.0

    How do for validation before inserting a line when press on create a button insert into ADF11g?

    < af:commandButton actionListener = "#{bindings." CreateInsert.execute}.
    Text = "CreateInsert."
    Disabled = "#{!}" bindings. CreateInsert.enabled}.
    ID = "cb8" / >

    best regards;

    Hello
    You can do per set actionlister with commit and action with createinsert
    Good luck
    lixinzhu

  • How do I insert a line in ra_interface_distributions_all

    Hi friends,
    Can anyone provide a query to insert a line in the ra_interface_distributions_all table? We have to work around autoaccounting to create distributions for the management of the orders from lines...
    Thanks in advance...

    Thanks for the request.

    Thank you
    Vijay
    http://www.lightningminds.com

  • Dynamically insert a line at end w / static lines above

    Using LiveCycle Designer 8.2

    I need to have a table with a header row, 2 static lines and then be able to insert rows at the end (after the static lines).

    I have this in my Add button, but nothing happens.  Don't know how to dynamically add line at the end after the 2 static lines.

    tblOtherStudyMS._Row1.addInstance (1);
    XFA. Form.Recalculate (1);

    Thanks in advance.

    Check the attached sample...

    https://Acrobat.com/#d=KCl5YhmbUKq37Rz48zg9Vw

    You must check the box, line to repeat for each item of the last data you want to repeat several times. and then use the instance Manager to add lines / delete lines.

    In my screen shot as I'm creating the box for Row3 in table 1.

    So my Add button click event code will look like:

    Table1.Row3.instanceManager.addInstance (1);

    My event code click Remove button will look like:

    If (table1. Row3.instanceManager.Count > 1)
    Table1.Row3.instanceManager.removeInstance (1);

    Thank you

    Srini

Maybe you are looking for