How to set a checkbox to call javascript for calling package procedure?

Hi folks,
I have a report where each row includes a dynamically created checkbox:
Step 1: define report in APEX based on this test query
select object_id,
       txt,
       htmldb_item.checkbox
          1,
          data.object_id,
          'onclick=alert('||data.object_id||');'
       ) cb
from
  select 1 object_id, 'AAAA' txt from dual union
  select 2 object_id, 'BBBB' txt from dual union
  select 3 object_id, 'CCCC' txt from dual
)  data Step 2: create a log table
create table tk_test_log
   log_val  varchar2(100)
);Step 3: Then I have a package stored in db called: tk_test
create or replace package tk_test is
  procedure add(p_num number);
  procedure remove(p_num number);
end tk_test;
create or replace package body tk_test is
  procedure add(p_num number) is
  begin
    insert into tk_test_log values ('TK_TEST.ADD: '||p_num||'   '||to_char(sysdate,'DD/MM/YYYY HH24:MI:SS'));
  end;
  procedure remove(p_num number) is
  begin
    insert into tk_test_log values ('TK_TEST.REMOVE: '||p_num||'   '||to_char(sysdate,'DD/MM/YYYY HH24:MI:SS'));
  end;
end tk_test;Is it possible to call "tk_test.add" procedure everytime when user checks any of checkboxes and to call "tk_test.remove" when user un-check any checkbox?
How should I modify a javascript in step 1 (currently = alert('||data.object_id||') ) to obtain similar solution?
Please help,
Tomas

Hi Earl,
Thanks for your reply.
Well this is exactly what I'm planning to use within my package :). Above example was just a really into into problem.
In reallity:
"add" prcedure will add a record into collection (plsql table - stored as a type)
and
"remove" procedure will remove it from it
But my problemis how to call it from javascript.
You're probably suggesting to use/maintain this collection within APEX and not within database?
Here is how I've defined my collection:
create or replace type ap_choice_temp_object_type is object
    ( person_id number,
      choice_id number,
      added     date
create or replace type ap_choice_temp_tab_type is table of ap_choice_temp_object_type;       And then in package I have procedures:
  procedure clear_ap_choice_temp_tab is
  begin
     l_choice_temp_tab := ap_choice_temp_tab_type();
  end;
  procedure add_ap_choice_temp_row (p_person_id number,
                                    p_choice_id   number
                                    ) is
  begin
    if l_choice_temp_tab.exists = false then
       clear_ap_choice_temp_tab;
    end if;
    l_choice_temp_tab.extend;
    l_choice_temp_tab(l_choice_temp_tab.last) := ap_choice_temp_object_type(person_id => p_person_id,
                                                                            choice_id => p_choice_id,
                                                                            added => sysdate
  end;
  procedure remove_ap_choice_temp_row (p_person_id number,
                                       p_choice_id   number
                                       ) is
  i integer;
  begin
    -- this should be more optimalised -- this version is just 1-st try !
    print_ap_choice_temp_tab;
    i := l_choice_temp_tab.first;
    loop
       if l_choice_temp_tab(i).person_id = p_person_id and l_choice_temp_tab(i).choice_id = p_choice_id then
         l_choice_temp_tab.delete(i);
       end if; 
       i:= l_choice_temp_tab.next(i);
       exit when i is null;
    end loop;
    print_ap_choice_temp_tab;                                                                              
  end;
  procedure print_ap_choice_temp_tab is
   i integer;
  begin
     dbms_output.put_line('Start');
     i := l_choice_temp_tab.first;
     loop
        dbms_output.put_line(l_choice_temp_tab(i).person_id||' | '||l_choice_temp_tab(i).choice_id||' | '||l_choice_temp_tab(i).added);
        i:= l_choice_temp_tab.next(i);
        exit when i is null;
      end loop;    
     dbms_output.put_line('End');
  end;Testing code
begin
  tk_test.clear_ap_choice_temp_tab;
  tk_test.add_ap_choice_temp_row(123,321);
  tk_test.add_ap_choice_temp_row(777,555);
  tk_test.add_ap_choice_temp_row(9999,4445);
  tk_test.remove_ap_choice_temp_row(777,555);
  --tk_test.print_ap_choice_temp_tab;
end;     Do you have any nice example how to use what you're suggesting in APEX? I mean "create some collection at page display time, let the user update the collection (through checkboxes) while they're scrolling through things."
I think this example would be usefull for many developers :)
Thanks,
Tomas

Similar Messages

  • How to set up and configure AirPort Express for AirPlay and iTunes

    Saw somewhere that supposedly there were some apple written guidlines on the above topic. I have searched all over for them. Anyone know where I can get a copy to read through. Just trying to educate myself a bit and sety up another room with access to itunes, radio, etc with high quality speakers and amp off my express.

    Here you go ...
    How to set up and configure AirPort Express for AirPlay and iTunes

  • How to set default User preferences in Analyzer for all users

    How to set default User preferences in Analyzer for all users<BR><BR>Hi,<BR><BR>I would like to set some settings in Analyzer as default for all users. For example:<BR>1. Display | Char<BR>2. right mouse click on char | Chart Properties<BR>3. Axes tab<BR>4. "Format: Currency" i would like to change to "Format: Number".<BR><BR>How to set default values to all users? Is this possible?<BR><BR>Thanks,<BR>Grofaty

    I'm pretty sure higher access superceedes, so you could set up a group with no actual access, just to get the preferences working, then their individual security will dictate what they can do. I haven't tested this fully, but I beleive this is how it will work.<BR>As far as setting the preferences, go into the admin console and right click on the group, then select Preferences. To apply the group preferences to a user, add the user to the group, then right click on the user, select preferences and from the upper left corner, use the drop down to select the active preference, in this case, it will be the group you created and added them to.<BR><BR>HTH

  • How to set user preferred timezone in OBIEE for all objects.

    How to set user preferred timezone in OBIEE for all objects based on users TZ(may be from @{session.timeZone}). without changing My Account -> Preferences

    Check
    Time Zone Specification from http://docs.oracle.com/cd/E12844_01/doc/bip.1013/e12187/T421739T481157.htm#4535403
    just in case https://blogs.oracle.com/xmlpublisher/entry/how_to_keep_your_dates_from_go

  • How to set and resent reconcilation a/c for Assent a/c

    hi
    how to set and resent reconcilation a/c for Assent a/c
    amk

    You are permitted to post the recon account undercertain special circumstances :
    USe the transaction codes OAMK and OASV.
    Kindly read the SAP on line documentation before making a postings directly to the recon account.
    Definition of the Reconciliation Accounts
    You are not allowed to manually post to the reconciliation accounts for Asset Accounting in Financial Accounting. Normally, you designate the corresponding General Ledger accounts in Financial Accounting as reconciliation accounts. This change, however, can no longer be made in Financial Accounting, once these accounts already have balances from the legacy data transfer. However, you can use a special report to assign these accounts the status of reconciliation accounts in Financial Accounting (in Customizing for Asset Accounting, choose Preparing for Production Startup ® Production Startup ® Set Reconciliation Accounts).
    There is another report for removing this specification (Reset Reconciliation Accounts).
    Subsequent Correction Postings to Reconciliation Accounts
    Suppose you have already defined the asset G/L accounts in Financial Accounting as reconciliation accounts, but still need to transfer balances to these accounts, or make corrections. You can make correction postings to these reconciliation accounts with a special posting transaction in Customizing for Asset Accounting (Transfer Balances), using posting key 40 or 50. You can only postings to those accounts in a company code with implementation status (Customizing for Asset Accounting, choose Preparing for Production Startup ® Production Startup ® Activate Company Code).

  • How to set a minimum width and height for a stage or scene?

    Hello,
    Does anyone how to set a minimum width and height for a stage or scene?
    I tried listening for width/height property value changes and then adjust the width/height if necessary, but that causes unpleasant flickering of the window.
    In JavaFX 2.1 beta SDK for Mac OS, the Stage class has setMinWidth() and setMinHeight() functions which work very well.
    I'm wondering what's the equivalent way to do that when using the FX SDK for Windows.
    Any help is appreciated!
    Thanks.

    I was wondering how to enforce a minimum stage size with JavaFX 2.0.3.The same flickering way you are currently doing it. See: http://javafx-jira.kenai.com/browse/RT-15200 "Need a way to set the minimum size of a window"

  • Without to change the setting.how to set the decimal place to 7 for an UDF.

    Without to change the setting, how to set the decimal place to 7 for an UDF?

    Hi
    Once you create a UDF it will automatically be binded to the data source of data type that you gave at the time of creating UDF.
    So i think you can not set the decimal places without changing the setting in display parameters.
    i am not sure whether it will work or not one thing you can try is that create it as a alphanumeric data type and convert your decimal value to sting and then assign it to UDF,While retrieving for any manipulation you convert it as decimal.
    Hope it helps you
    Regards
    Vishnu

  • How to set up an iPhone as PAN for MacBook Air

    I would like to know how to set up a Personal Area Network for my MacBookAir by using my iPhone.
    I successfully used Bluetooth to pair the two, according to the MacAir, but the iPhone never believed it and insisted that it had found no device to pair to.
    This is after it had presented the correct pairing number with the Mac.
    Thank you.
    Kit

    Create a folder on the external drive named "Music." Copy your /Home/Music/iTunes/ folder into the Music folder on the external drive.
    Now select the iTunes folder on the external drive. Hold down the COMMAND-OPTION keys then drag the iTunes folder icon to your Desktop. This should create an alias named, "iTunes alias." Open the /Home/Music/ folder on your internal hard drive. Drag the iTunes folder to the Trash but do not Empty the Trash. Copy the alias on the Desktop into the /Home/Music/ folder. Select the alias and press RETURN to edit the name. Delete the word, "alias" so that the alias is now simply "iTunes."
    Now open iTunes to verify that you are accessing your real iTunes data. If all is well you can Empty the Trash.

  • How to set up the "incoming Mail server" for google apss account

    how to set up the "incoming Mail server" for google apss account

    The settings are not generic for all webmail accounts, only your office IT department would know what the server address is for their outgoing email server.  You'll have to ask them about it.

  • How I set my Q5 so that reminders (for appointments, etc.) are displayed on my home screen?

    How I set my Q5 so that reminders (for appointments, etc.) are displayed on my home screen?
    Solved!
    Go to Solution.

    Swipe down from the top of your homescreen and select Settings>Notifications. Near the bottom you'll see in blue letters Lock Screen Settings. Click that and toggle Lock Screen Notifications to ON. Now whenever you have an appointment in your Calendar, it'll show up that day on your Lock Screen.
    Cheers.  
    - If my response has helped you, please click "Options" beside my post and mark it as solved. Clicking the "thumbs up" icon near the bottom of my response would also be appreciated.

  • How to set the gain and input coupling for each channel on a NI 4462 DaQ card?

    I've seen a few examples in how to set the gain for NI 4462, but none tell me how to chose the channel I wish to set this gain.  Also the same problem with input coupling
    Does anyone know how to set the gain and input coupling for each individual channel?
    Thanks,
    Hector
    LabView 8.5 Windows XP

    Hey Hector,
    http://forums.ni.com/ni/board/message?board.id=100&thread.id=1688
    This has a few examples of how to do that.  Let me know if you have further questions.
    Have fun!
    -gaving

  • How to set the Mail and Fax options  for the Smartforms ???

    How to set the Mail and Fax options  for the Smartforms ??? Please reply me very soon. Its a life deciding question now for me. Please .

    >
    veera Karthik wrote:
    > How to set the Mail and Fax options  for the Smartforms ??? Please reply me very soon. Its a life deciding question now for me. Please .
    Hi
    Check this Link:
    http://help.sap.com/saphelp_nw04/helpdata/en/a5/28d3b9d26211d4b646006094192fe3/frameset.htm
    P.S: Never say reply me soon....people answer you here voluntarily and as everyone has their own desk to manage...sp replies may late or early..depending upon the availabality of the members.
    Vishwa.

  • An error occurred while evaluating javascript for the package

    I need help. Whenever I try to install anything I get the error "an error occurred while evaluating javascript for the package." This occurs with installing a safari update or updating OS X. I am running with version 10.6.4 but can not update because I get the"an error occurred while evaluating javascript for the package" error. Any suggestions on how to repair my system?
    Thank You
    Neil

    Nobody?

  • 10.8.2 update: can't install "error occurred while evaluating Javascript for the package"

    Greetings All-
    I'm trying to update from 10.8.1 to 10.8.2 on my Macbook Air. When I downloaded the .dmg from Apple and ran it, I got the following error:
    "OS X Update Can't be installed on this disk. An error occurred while evaluating JavaScript for the package."
    So far, I've done the following, all to no avail:
    (1) Updated Java to v7 per Java's website, no change
    (2) Downloaded the 10.8.2 combo update, no change
    (3) Found Apple's OS X Java update (which is still at v6)- get an error at install that "the contents of the disk can't be changed"
    (4) Restarted at each step
    Does anyone have any suggestions or ideas?
    Thanks!

    Permission repair, too?
    Take a look here: https://discussions.apple.com/thread/3811748?start=0&tstart=0
    And possibly here:  https://discussions.apple.com/thread/3889562

  • "Adobe Photoshop Lightroom 5.4 can't be installed on this disk. An error occurred while evaluating JavaScript for the package."

    Hi there,
    I'm getting this error on trying to install / update LR 5.3 to 5.4:
    "Adobe Photoshop Lightroom 5.2 can't be installed on this disk. An error occurred while evaluating JavaScript for the package."
    I hope there's somebody that can help me out here.
    Cheers

    Hi kglad,
    Sorry for the late response:
    Here's the screenshot you wanted:
    It's in Dutch but it 's exactly the same as posted above by abphoto.biz
    I'm running OS X Maverick on an early iMac (2007). No problems until now.....
    Hope you can help,
    Cheers

Maybe you are looking for