Check boxes based on the table...

I have an 'event' of the table, a "subject" of table and one table that links these two 'event_topics '. I have a form to create events and want to have all the available topics in the table of 'event' presented a list with checkboxes, to verify for each event, all the van when registering for any subject verified and relevant topics, a line is added in "event_topics" with the event_id and the topic_id.

Is this possible? And if so, how do I start on this? I use Apex 3.2.

Hello Tom,

Yes, it is possible.

First of all, you need a point of the box. The LOV for this element of the value to something like

select topic_name, topic_id from topic order by topic_id

To save the selection you need a process of pl/sql

declare
  vPICKED apex_application_global.vc_arr2;
  vITEMS varchar2(1000);
  vCOUNT number;
begin

  vITEMS := :YOUR_CHECKBOX_ITEM;

  --first delete all entries from event_topics that are not checked
  delete from event_topics
  where ':' || trim(to_char(topic_id)) || ':' not in (':' || vITEMS || ':')
  and event_id = :EVENT_ID;

  -- insert all new checked topics into event_topics
  vPICKED := apex_util.string_to_table(vITEMS, ':');

  for z IN 1..vPICKED.count
  loop
    select count(*) into vCOUNT from event_topics
    where event_id = :EVENT_ID
    and topic_id = vPICKED(z);

    if vCOUNT = 0 then
      insert into event_topics values (:EVENT_ID, vPICKED(z));
    end if;
  end loop;

end;

To extract the items all turned on during the loading of the page, you need to load on before the process of the header:

declare
  vPICKED apex_application_global.vc_arr2;
begin

  select to_char(topicl_id)
  bulk collect into vPICKED
  from event_topics
  where event_id = :EVENT_ID
  order by topic_id;

  :YOUR_CHECKBOX_ITEM := apex_util.table_to_string(vPICKED, ':');

end;

Hope this helps,
Dirk

Tags: Database

Similar Questions

  • Check box to hide the table row

    I have the table and the box.
    I need when is checked then unhidde of certain lines and when is not checked to be hidden?

    Thank you

    I did it in my form. What I did do the subform, and then place all the objects that I wanted to be hidden and then visible inside. I then used this code on the button:

    If (this.rawValue == '1') {}

    oTargetField = this.resolveNode ("subform name here");

    oTargetField.presence = "hidden".

    }

    If (this.rawValue == '0') {}

    oTargetField = this.resolveNode ("subform name here");

    oTargetField.presence = "visible".

  • Data received, press CHECK BOX to print the last page

    Aloha

    I have an old HP Laser 4200 Jet that has been the back BONE of my business! I worked perfectly except for the last two days!

    He give me a "data received press CHECK BOX to print the last page" and print a portion of the last page with or without printing of the

    previous pages! It just started happening! Over the other day, I have my children of girlfriends! Is it possible that they pressed a button?

    I reset, but this problem persists! Help!

    SLY

    Hi Sly,

    Welcome to the Customer Support Forums!  I'll lock this accidental double post and lead everyone on this subject.  This will keep all your answers in one easy to find place.

    If you have any questions or concerns about this, feel free to contact me by private Message.  Thank you!

    Message edited by SandyD on 06/06/2009 17:07
  • Clear the check box according to the value of column DB

    Hello
    My requirement is to disable the check box according to the value of a column DB. Say for example my report displays the following. Check box, the name of the EMP, Dept. If the Department is the checkbox should be disabled and user should not be able to select the check box.
    Ask your help for a solution.
    Thank you
    Prasanth

    You must use the parameter p_attributes of the apex_item.checkbox API to make the boxes off (readonly do not work with the checkboxes)

    SELECT ..
    CASE WHEN  THEN APEX_ITEM.CHECKBOX(1,)
                         ELSE APEX_ITEM.CHECKBOX(1,,'disabled="disabled"')
              END 
      ..
    
  • Automatically select the correct check box based on choices made in the previous section?

    With the help of LiveCycle to create a form that contains a table. This table has 3 columns with 15 boxes in each column.

    Here are these 15 rows 3 more boxes that have calculated values. In each row of the table one of the checkboxes can be active at a time.

    Based on the majority of choices in a column of some, the calculated corresponding checkbox must be verified. (If most of the choices are made in column 1, then the 1st calculated box must be marked, etc...)

    The sentence that I am writing the JavaScript code that selects the checkbox correctly calculated. Currently, I'm just trying to understand it with only 3 first lines and I can reproduce the template after.

    Table e.g.: ("BOLD" is calculated)

    CheckBox20CheckBox35CheckBox50
    CheckBox21CheckBox36CheckBox51
    CheckBox22CheckBox37CheckBox52
    [CheckBox66][CheckBox67]

    [CheckBox68]

    Here's the code I came up with that day, but it does not just anyone, although when I used it it worked just to 2 columns. (just added the part about the third column in the instructions 'or')

    (In the script for the calculation of box 66)

    //larger values than other columns
    if ((Row1.CheckBox20.rawValue == "") + (Row2.CheckBox21.rawValue == "") + (Row3.CheckBox22.rawValue == "") > (Row1.CheckBox35.rawValue == "") + (Row2.CheckBox36.rawValue == "") + (Row3.CheckBox37.rawValue == "") || (Row1.CheckBox50.rawValue == "") + (Row2.CheckBox51.rawValue == "") + (Row3.CheckBox52.rawValue == ""))
     {this.rawValue = "0";}
    
    //smaller values than other columns
    if ((Row1.CheckBox35.rawValue == "") + (Row2.CheckBox36.rawValue == "") + (Row3.CheckBox37.rawValue == "") || (Row1.CheckBox50.rawValue == "") + (Row2.CheckBox51.rawValue == "") + (Row3.CheckBox52.rawValue == "") > (Row1.CheckBox20.rawValue == "") + (Row2.CheckBox21.rawValue == "") + (Row3.CheckBox22.rawValue == ""))
     {this.rawValue = "1";}
    

    I'm new to JavaScript for all advice is appreciated.

    Looking at the conditions, it seems you are trying to say "If column 1 column 2 or column 3, then do something." JavaScript cannot read conditions like that. It's playback "if (column 1 column 2) GOLD (column 3), ' and he doesn't know what to do with this issue of column 3, except if it is 0 or 1.

    Here is an example of use of only two lines and three columns. The rawValues are 0 and 1 for each check box. I have it set so that if column 1 has several checkboxes, then Col1 gets checked. Similarly, the col2 or 3 boxes will be checked if their columns are the most populated. I don't get the opportunity to have several boxes marked if there are two columns that have the same number of boxes checked. (You can do this by just changing > to > = in the conditions.)

  • Check the boxes based on the value in a text field

    Hello.

    I'm building a pdf form in Acrobat Professional X. I want to add JavaScript to two checkboxs to achieve the following objectives:

    If the value of a text field (TLigne) is equal to 61, 64, 66 or 67, the first box (PlanACheck) has the value of the object of an audit.  If the value of a text field (TLigne) is equal to 60, 62 or 63, the second box (PlanBCheck) has the value of the object of an audit.

    I have no other than copy and paste Javascript experience, so I'm not sure I use the right language to research. If anyone can provide guidance, I would be very happy.

    Thank you very much!

    Usually this kind of thing will run the custom calculation of the target field script, but the boxes is not a calculation script, so we'll use the text for field Validation script do, with this code:

    this.getField("PlanACheck").checkThisBox (0, (event.value == "61" | event.value == "64" | event.value == '66' | event.value == "67"));

    this.getField("PlanBCheck").checkThisBox (0, (event.value == "60" | event.value == "62" | event.value == "63"));

  • by the way check box values in the WHERE clause

    Hello

    I created a data block - 'CONTACT' (block of data in database)

    and has an element of database - 'Code', 'Descr '.

    The number of records displayed has the value 5.

    When enabled - value 'Y '.

    Value when disabled - n

    Box mapping of other values - "unchecked."


    I write the code inside "WHEN the BUTTON PRESS. My main goal is to return the number of records from

    According to several conditions and one among them is the CODE which can be single or multiple based on the checked checkbox.

    The requirement is when I check one or more boxes, I should pass the "Code" element values in the WHERE clause.

    I tried to use the simple loop but things havmt worked as shown below.

    The next_record refers to the COCHEE BOX as well, and thus return all the eventhough lines if it is not checked.

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

    -LOOP

    IF: contact.cb = 'Y' THEN

    LOOP

    IF p_where is null then

    p_where: =: contact.code;

    on the other

    p_where: = p_where | «, » || : contact.code;

    end if;

    When the output: system.last_record = "TRUE";

    next_record;

    END LOOP;

    end if;

    -END LOOP;

    MESSAGE ("p_where :'|| p_where);

    MESSAGE (' ');

    END;


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

    And even if I write the LOOP before the first CASE, it returns me the current value and move to the last record.

    Please suggest

    Try something like this:

    FIRST_RECORD;
    
    LOOP
    
      IF :contact.cb = 'Y' THEN
        IF p_where is null then
           p_where := :contact.code;
         else
           p_where := p_where ||','||:contact.code;
         end if;
       END IF;
      exit when :system.last_record = 'TRUE';
      next_record;
    END LOOP;
    
    -- END LOOP;
    MESSAGE ( 'p_where :'||p_where);
    MESSAGE (' ');
    
    END;
    
  • Conditional display in the text box based on the calculated value

    Hello

    I have radio buttons that each have a numerical value. For example = 1 A = 2 C = 0. In the example below, the total is equal to 5.
    examplescreen01.gif

    The sum is displayed at the bottom of the document and is passed to another text box:

    examplescreen02.gif

    Instead of '5' displayed in the text box on the right, it should display a "Control" Word like this:
    examplescreen03.gif

    The displayed word is based on the totals through this range:

    1-2 = 'absorbing '.

    3-4 = 'practitioner '.

    5 to 6 = "control".

    The script I used to pass the value from the left to the right text box in the chart above is:

    name of the field to text box;

    var cTextBox = 'Cabinet Talent strategy knowledge - total';

    get the value of the field with the name in cTextBox;

    var sTextBox = this.getField ("cTextBox") .value;

    Set the value of this field;

    Event.Value = sTextBox;

    That I need to add to this script to show one of the words, such as "control" above?

    I am a complete novice to scripting. I found the above script online and somehow got it to work.

    I thank very much for any help or pointers, you can provide.

    Best regards

    Chris

    Sorry, there were some errors in the code that I provided above. Try this:

    If (sTextBox > = 1 & sTextBox)<= 2)="">

    Event.Value = "absorbing";

    } ElseIf (sTextBox > = 3 & sTextBox)<= 4)="">

    Event.Value = "practitioner";

    } ElseIf (sTextBox > = 5 & sTextBox)<= 6)="">

    Event.Value = "master";

    } else {}

    Event.Value = "";

    }

    If it still does not respond, you can send me the file at [email protected] and I'll check...

  • Created the form based on the table - created new line - how to retrieve line editing?

    Hello

    Sorry for such a stupid question, but being new in APEX, I don't know much about how the end user on a form.

    I have created a new form (not in a table), based on a table.

    I ran the form and created a new line.

    After the line was created, the form comes back ready to create another line (all the values in the fields).

    How can I go on the recovery of the line, I added just to make a few changes?

    Again, please forgive my ignorance.

    Mason

    Masong says:

    Sorry for such a stupid question, but being new in APEX, I don't know much about how the end user on a form.

    Or about how best to use this forum. Always include all the details of your environment and your application when you post a question so that we can provide a solution version - and context, case-specific: How to get the answers from the forum

    I have created a new form (not in a table), based on a table.

    I ran the form and created a new line.

    After the line was created, the form comes back ready to create another line (all the values in the fields).

    How can I go on the recovery of the line, I added just to make a few changes?

    Ensure that the attribute key back to point in the line process of... The ARP process is defined to return the value of PK of records inserted in the element of key primary page and delete any Reset Page clearly session state process created by the wizard page.

  • based on the table line oaf page filter lines

    Hello

    Right now, I have the search page where the results are displayed in the region of the table.

    In addition, I have situation where I need to filter the lines and display the results in the background region based when you click on the row of table area...

    How can I achieve this?

    Please let me know.

    Thank you

    MK

    Managed to get this working?

  • check box for fills the fields


    Hello

    I have a column of text fields named date1, date2, date3... all the way to date10.  I would like to include a check box if the user enters a date in the field "date1" then checks the checkbox, it could fill the remaining fields with this value.  Someone would have the script for this.

    Thank you very much.

    You can use this code as the script of the mouse upward to the checkbox:

    if (event.target.value!="Off") {
        var v = this.getField("date1").valueAsString;
        for (var i=2; i<=10; i++) {
            this.getField("date"+i).value = v;
        }
    }
    
  • Check box to hide the subform does not

    I have what I think it's a pretty simple dilemma. I have a check box that will be used to show/hide a subform when checked/unchecked.

    However, any code that I have written seems to work. The box is an object in page1 and not wrapped in subforms. The subform has simply two inside text fields. the properties of the box have been defined for bind values are 1 for archiving, 0 for uncontrolled. The fields in the subform exploit the value "invisible" because I don't want to see these fields in the form (unless the box is checked).

    My code is:

    Form1. Page1.newspaper::click - (JavaScript, client)

    If (this.rawValue == 0) {}

    xfa.resolveNode ("form1..") Presence Page1.Newspaper_Subform") ="hidden ";

    }

    else {}

    xfa.resolveNode ("form1..") Presence Page1.Newspaper_Subform") ="visible ";

    }

    This code is located in the under JavaScript click event. The form is saved in a dynamic XML form to Adobe. I use Adobe Pro XI and LC ss4

    I can do this work in the generator of the action, but I want the subform back to hidden when unchecked.

    Obviously, a beginner in Java script, ideas/help you might have would be appreciated.

    What exactly is the problem?  Is this not not showing or hiding not when you change the box?  According to your description, you have two text boxes the invisible value but your script changes only the presence of the subform.  If you show the subform without changing the presence of text boxes, they will remain invisible.  If you want all show/hide together, set the presence visible text boxes and simply change the subform presence as you are now.

  • Total of a column when the check box is selected in table form

    Hi all

    Total of a column when the checkbox is enabled in the form of tables, but is not work, help

    https://Apex.Oracle.com/pls/Apex/f?p=82062

    My credentials for my worksapce:

    https://Apex.Oracle.com/pls/apex/

    Workspace: GB

    USERNAE: [email protected]

    PASSWORD; GB

    Thank you.

    abb.JPG

    abcd.JPG

    abcde.JPG

    Kind regards

    GB

    Hi user13028844,

    user13028844 wrote:

    Please change your login username of "user13028844" to something meaningful. Reference: Video tutorial how to change username available

    The second button is a javascript function call, which is not a summary. the javascript function has a problem

    This function has the problem help me correct, whereas we can summarize the amount of lines checked

    I have made changes to your page. Check the "Display of Javascript" button, now it shows the correct amount for active items.

    Made the following changes:

    • The following are removed from the section "run when Page Loads:
    Declare
      p_qty          number;
      p_total_qty    number := 0 ;
    Begin
    for i in 1..APEX_APPLICATION.G_F01.COUNT LOOP
      select nvl(qty,0) qty into p_qty from DURATION
        where id = to_number(APEX_APPLICATION.G_F01(i));
       p_total_qty := p_total_qty + p_qty;
    end loop;
        --htp.prn(p_total_qty);
    htp.prn('');
    apex_application.g_print_success_message := 'Checked total qty:'||p_total_qty  ;
    End;
    

    NOTE: The section "run when Page Loads" is intended for JavaScript code to perform the loading of the Page and NOT PL/SQL code.

    • The following code removed from the section "Header HTML":
    
    

    This code was going nowhere, so removed and replaced with code below.

    • Added the following code in the section "function and Global Variable declaration:
    function enableButton() {
        // code goes here
    }
    
    function total_checked() {
       var total = 0; var qty = 0;
       $( 'input[name="f01"]' ).each(function() {
         if ( $(this).is(':checked') ){
           qty = $(this).closest('tr').find('td[headers="quantity"]').text();
           total += parseFloat(qty);
         }
       });
       alert("Checked Total Quantity : " + total);
    }
    

    Your APEX_ITEM. BOX calls a JS "enableButton" function, but it has no definition, dummy definition so added.

    Kind regards

    Kiran

  • A JAPANESE BOX APPEARS ON THE TABLE EVERY TIME THAT I TURN ON THE COMPUTER! HOW CAN I GET RID?

    2 DAYS AGO, A BOX APPEARED ON MY DESK-TOP & IS PERMANENTLY ON THE SCREEN. IT IS A KIND OF SCAM ASKING MY INFO/CREDIT DETAILS ETC. I CAN'T REDUCE ITS SCREEN SIZE OF QUARTER, HE CANNOT REMOVE, & WHEN I CLICK ON 'X' TOP RIGHT IT DISAPPEARS & RETURNS 30 SECONDS LATER. WHEN I SELECT (IN JAPANESE - I'M NOT TALKING ABOUT) HAS A MESSAGE AT THE BOTTOM OF THE BOX I GET COMPUTER AN ERROR MESSAGE "AN ERROR HAS OCCURRED IN THE SCRIPT ON THIS PAGE" & IT GIVES A URL, BUT WHEN I CLICK ON 'YES' OR 'NO' TO CONTINUE TO RUN SCRIPTS NOTHING HAPPENS.

    WHAT CAN I DO?

    topblanchflower wrote: well, I tried SuperAntiSpyware download - no luck - the annoying box in Japanese is still on my table as soon as I open it. Someone at - it any ideas what to try to get rid of it?

    Hello topblanchflower, you can try to run a Windows Restore Point, date back to the time before this problem arose.

    To do this, go to the start ORB, all programs, accessories, System Tools, System Restore.

    Click Restore and system in a short period of time, a window will open that shows a restore point. Look in the lower left corner, then check the box to show more restore points and select one before the Popup began.

    The system reboot and return to the office and advisor than the Windows Restore Point has been successful or not successful.

    Sometimes malware such as this will be disable and remove all Windows Restore Points to prevent the user to rid the system of the malware.

  • Check box adds to the Total

    Hey there,

    Anyone happen to know if there is a script so that when a box is checked, it adds the correlation price altogether?

    Screen Shot 2016-06-21 at 8.48.08 AM.png

    Thanks in advance!

    JW

    Use the code I provided the custom calculation of the total field script.

    I had assumed that the prices are fixed. If indeed they are dynamic and you have a text field for each award, then you can use something like this:

    var total = 0;
    if (this.getField("CheckBox1").value!="Off") total+=Number(this.getField("Price1").value);
    if (this.getField("CheckBox2").value!="Off") total+=Number(this.getField("Price2").value);
    if (this.getField("CheckBox3").value!="Off") total+=Number(this.getField("Price3").value); // etc.
    event.value = total;
    

Maybe you are looking for