Checkbox in Tabular Form

Hi,
I am fairly new to APEX and need some help please.
I am nrunning Apex 4.1 on 11g database.
I have a tabular formrunning off the rowid which needs to show a checkbox for several columns which contain Y or N.
When I set the field type to simple checkbox, none of the checkboxes are ticked for any columns with a Y.
Can someone please tell me what I need to do to get a simple checkbox on a tab form to work without too much effort?
I can use a select list OK, but really just want a tickbox to reflect the Y or N in the column (ticked, unticked).
I have tried using the apex_item.checkbox() in the query, but that doesn't seem to work.
Example of select statement:-
select
"ROWID",
"DEPARTMENT_REFERENCE_U",
"NAME",
"AUTHORITY_FLAG", -- tickbox
"AUTHORITY_NAME_CODE",
"DEFAULT_VALUE", -- tickbox
"ROADS", -- tickbox
"ANSWER_SET", -- tickbox
from ....
I tried apex_item.checkbox(1, rowid, decode(roads,'Y', 'checked','unchecked')) "ROADCHECK", but just get missing right parantheses
If someone can give me some pointers I would be really grateful.
Thanks,
Carl.

Hi,
Thanks for the info.
The whole SQL statement for the tabular form now reads:-
select apex_item.checkbox(1, rowid, decode(roads,'Y', 'checked',null)) "ROADCHECK",
"ROWID",
"DEPARTMENT_REFERENCE_U",
"NAME",
"AUTHORITY_FLAG",
"AUTHORITY_NAME_CODE",
"DEFAULT_VALUE",
"ROADS",
"ANSWER_SET"
from ....
... And returns error of missing right paranthesis. As soon as I take out the apex_item, the query runs.
I don't really want to use apex_item if I don't have to (or any other complex coding to make things work) and have been instructed to let Apex do all the work through its automatic functionality (probably for anyone else picking it up in the future. I am in the process of evaluating Apex so we can change over from Oracle Forms). All I want is for the checkboxes to be ticked if the column contains Y. Historically, the columns will contain Y or N, but it seems in Apex/HTML the unticked default is null, which we can live with. I have tried the 'checkboxes the easy way' as in URL earlier in this thread and it seems OK, but don't really want to have to go down that road, just for a tickbox, especially on this form where I need 4 of them.
In my tabular column attributes for the column I want as a tick box I have:-
Display As Simple Checkbox, render form field without template, LOV = STATIC:;Y (the Named LOV drop down box is greyed out and disbaled).
When I run the form, all tickboxes for this column are displayed as unticked, where as in the database they are all Y.
Is there something obvious that I have done wrong/need to do?
Regards,
Carl

Similar Messages

  • Issue with checkbox on tabular form

    Hi (to all my friends in deperate times),
    I have a tabular form on a page, which i use for addition of record only. So it always displays me a blank row, which is ready to be inserted after user has filled in data and clicked submit button.
    Now I have a checkbox field on this tabular form. Since all the columns i show as null, I also show this checkbox as unchecked when page shows up. Here is the query for the source region of this form:
    SELECT null "Client",
    null "Currency",
    HTMLDB_ITEM.CHECKBOX(40,'YES',null) critical_box,
    FROM dual
    I have used 'YES' as return value of this checkbox( when user has checked it, else i assume it will be not equal to 'YES').
    I have my own update process, which gets fired on click of 'Submit'.
    this is my insert clause in this update process:
    INSERT INTO table1
    (client, currency,critical_level)
    values
    (APEX_APPLICATION.g_f01(i), APEX_APPLICATION.g_f02(i), decode(APEX_APPLICATION.g_f40(i),'YES','YES','NO')
    Now problem is that when i click checkbox and save it, it adds record correctly. But when i dont click checkbox during insertion, at that i get error message that no data found. It should insert 'NO' for 3rd column when checkbox is not clicked.
    Please help here. Not sure why its giving no data found error when checkbox on tabular form is unchecked.
    Thanks and Regards,
    Rave.

    Hi,
    In the linked thread, the solution was to provide a second, hidden, item that always returned a known value. This item, also created using the APEX_ITEM package, uses the same index number as your checkboxes - so, if your checkboxes use index 40 (to get "f40"), then the hidden item uses 40 as well. This way, we always get at least one value for each row and the last possible value in a row will be known.
    So, assume that the hidden item values are "NO", you have 10 rows on the page and the user ticks items 1, 2 and 5. The f40 items submitted would be:
    YES:NO:YES:NO:NO:NO:YES:NO:NO:NO:NO:NO:NO
    so, there will ALWAYS be 10 "NO" items and the YES item immediately before it will be the checkbox on the same row. So, if we loop through all f40 items, the YES values mean the checkbox and the NO values mean end-of-row - and, if we keep track of the NO values, we know which row we are on.
    So, the code to find the data in f01 and f02 relating to the the YES values (the checked checkboxes) would be something like:
    DECLARE
    vROW NUMBER;
    vF01VALUE VARCHAR2(100);
    vF02VALUE VARCHAR2(100);
    BEGIN
    vROW := 1; // current row number
    FOR x IN 1..APEX_APPLICATION.G_F40.COUNT
    LOOP
      IF APEX_APPLICATION.G_F40(x) = 'NO' THEN
       vROW := vROW + 1; // end of the row, so move to next row
      ELSE
       // found a checkbox, so get related data
       vF01VALUE := APEX_APPLICATION.G_F01(vROW); // f01 item on the same row as the checked item
       vF02VALUE := APEX_APPLICATION.G_F02(vROW); // f02 item on the same row as the checked item
      END IF;
    END LOOP;
    END;Andy

  • Checkbox in tabular form - help needed

    I'm trying to build a tabular form, with a checkbox for a field that can have value 'Y' or 'N'. Adding the checkbox is no problem, with the htmldb_item.checkbox API.
    However, processing it is.
    On this forum I found a way to process the checkboxes, by looping through all the records (with the help of htmldb_item.hidden in which the id is stored) and reading the value from the checkboxes and updating the column if the checkbox is checked. (see Re: Report with updateable checkbox)
    however, as soon as I add a htmldb_item.hidden item, I receive the following error when I submit the tabular form to the Multi Row Update process:
    "Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. "
    My query:
    Select id
    ,htmldb_item.hidden(1,id)
    ,htmldb_item.checkbox(2,id, decode(field, 'Y', 'CHECKED', NULL))
    from table
    What am I doing wrong?
    is there a better way to process a tabular form with checkboxes?
    Or should I process all the rows manually by updating every record even if it hasn't changed (with a loop through all the records)?

    Tonnie, did you ever get an answer to this question?
    Michael Cunningham

  • Checkbox in Tabular Form (Solution to span multiple pages)

    Hi,
    We had a case where a large report needed to have check boxes. These check boxes would populate a list of id's which we then processed for a specific task. By default APEX doesn't support this.
    After spending some time on this, I thought I'd post my solution to help any others who experience the same problems. For this example we will use P10
    1. Create a new "normal" report.
    SELECT e.*, APEX_ITEM.CHECKBOX(1,e.EMPNO,'onClick="updateList(this);"',:P10_LIST, ',') AS Cancel,
    FROM emp e
    2. Create a hidden item called P10_LIST
    3. Add an HTML region to the page whose template is "No Template" (do this so it doesn't show up. Call the region "JavaScript". Set its sequence to 1
    4. Add the following in the JavaScript region:
    <script src="http://SERVER_NAME/String.js" type="text/javascript"></script>
    <script src="http://SERVER_NAME/Ajax.js" type="text/javascript"></script>
    <script type="text/javascript">
    function updateList(pObject){
    vItem = 'P10_LIST';
    myAjax = new Ajax();
    vList = myAjax.getItemValue(vItem);
    //Determine to remove or add from list
    if (pObject.checked) {
    //Add item
    vList = vList.listAppend(pObject.value);
    else{
    //Remove from list
    vList = vList.listRemoveItem(pObject.value);
    }//if
    //Set the session value
    myAjax.setItemValue(vItem,vList);
    //Set the HTML value
    document.getElementById(vItem).value = vList;
    </script>
    This script:
    - Loads the List from the session
    - Modifies the list
    - Stores it in the session
    5. The JavaScript region references 2 files, which you'll need to add to your server. They are as follows:
    Ajax.js
    function Ajax(){
    // TODO: Enter proper names etc.
    this.appProcessNameNull = 'AJAX_null';
    this.appProcessNameReturnItem = 'AJAX_ReturnItem';
    this.tempItem = 'P0_AJAX_TEMP';
    * TODO: Document
    * Sets Item in session
    Ajax.prototype.setItemValue = function(pItem,pValue,pAppProcess){
    if (pAppProcess == null)
    pAppProcess = this.appProcessNameNull;
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=' + pAppProcess,0);
    get.add(pItem,pValue);
    gReturn = get.get();
    * TODO: Document
    * @param pItem Name of item to get
    * @param pTempItem Name of temp item
    * @param pAppProcess Application Process to call which will return item
    * @return session value
    Ajax.prototype.getItemValue = function(pItem,pTempItem,pAppProcess){
    if (pTempItem == null)
    pTempItem = this.tempItem;
    if (pAppProcess == null)
    pAppProcess = this.appProcessNameReturnItem;
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=' + pAppProcess,0);
    get.add(pTempItem,pItem);
    gReturn = get.get();
    return gReturn;
    String.js
    // From http://www.somacon.com/p355.php
    String.prototype.trim = function() {
         return this.replace(/^\s+|\s+$/g,"");
    // From http://www.somacon.com/p355.php
    String.prototype.ltrim = function() {
         return this.replace(/^\s+/,"");
    // From http://www.somacon.com/p355.php
    String.prototype.rtrim = function() {
         return this.replace(/\s+$/,"");
    * Appends value to list
    * @param pValue Value to add to list
    * @param pDelimeter Defaults to comman
    String.prototype.listAppend = function(pValue, pDelimeter){
    if (pDelimeter == null)
    pDelimeter = ',';
    vStr = this;
    if (vStr.length == 0)
    vStr = pValue;
    else
    vStr = vStr + pDelimeter + pValue;
    return vStr;
    * Removes a value from list
    * @param pValue Value to remove from list
    * @param pDelimeter Defaults to comman
    String.prototype.listRemoveItem = function(pValue, pDelimeter){
    if (pDelimeter == null)
    pDelimeter = ',';
    vStr = this;
    vStr = pDelimeter + vStr + pDelimeter;
    // Remove value
    vStr = vStr.replace(pDelimeter + pValue + pDelimeter, pDelimeter);
    //Remove prefix and suffix items
    if (vStr.length > 0 & vStr.charAt(0) == pDelimeter){
    vStr = vStr.substring(1);
    if (vStr.length > 0 & vStr.charAt(vStr.length-1) == pDelimeter){
    vStr = vStr.substring(0,vStr.length - 1);
    return vStr;
    6. On Page 0 Create a hidden Item called: P0_AJAX_TEMP
    (Note: this is can be used for all your AJAX calls)
    7. Create an Application Process called: "AJAX_null". Process Text: null;
    8. Create an Application Process called: "AJAX_ReturnItem". Process Text:
    begin
    htp.prn(v(v('P0_AJAX_TEMP')));
    end;
    If you look at the Ajax.js you'll notice points 6,7, and 8 are all customizable etc... I just put it in so you can test right away.
    Now the user can select items on multiple pages (if pagination applies). Once they hit a submit button you can use P10_LIST to process your values.
    Hope this helps.
    Martin

    Hi Martin,
    I was trying to use your funda in my App. But i dont know why it is not doing anything.
    Also i'm facing a very small but severe problem with one of my report. I am using checkbox. So that user will be able to select all those records he/she wants. but the problem is that when i'm selecting few records with the help of the check boxes, selections are there. When moving to other page and coming back to that page, selections are gone. I think selections should not go like this. Otherwise the user will get confused.
    Can you tell me how can retain the check box selections??
    Thanks
    Sudipta

  • Having some trouble with hidden and checkboxes on tabular forms

    My query is as follows:
    select distinct tt.name tasktype,ct.name costtype,htmldb_item.checkbox(3,1,NULL,'Y:N',':') "Add Cost", htmldb_item.text(4,defabscost,9) defabscost,
    htmldb_item.hidden(5,tt.tasktypeid) tasktypeid, htmldb_item.hidden(6,ct.costtypeid) costtypeid
    from acct.defabscost d
    inner join work.tasktype tt
    on d.tasktypeid = tt.tasktypeid
    inner join acct.costtype ct
    on d.costtypeid = ct.costtypeid
    I have it wrapped within a function, which works fine. My issues are that I want to have the checkboxes function as row selectors. Basically, not pointing to primary keys (I have a compound primary key on this table). If selected, fill in the table, if not selected, erase from table. Also, My hidden items kinda contain the "primary keys". When I set these as hidden, I see the column, but there is no data. I don't want to see the columns at all, but when I set these to "hidden" in the attributes, I can't reference them with htmldb_application.g_FXX. Any suggestions?

    I actually figured out how to get the htmldb_item.hidden part working properly. I misread the guide, thought it was a comma between fields and not a concatenation. Works fine. But I still need to get the checkbox to work like I want.

  • Tabular Form Populate from a query of other tables

    I am sure this can be done but we are especially new to Master-Detail relationships in Apex and to Tabular Forms (updateable reports).
    We are trying to populate a tabular form (updateable report) with values from a query. The user is simply going to click yes/no per row and then we need to insert those rows into a table..
    I tried following the logic of creating a Master-Detail relationship, and noticed the AddRow Button and the process to add rows to the Tabular Form. I also noticed several MRUUpdate processes that fire to update existing rows.. I am assuming that I need to first add the number of rows that the query which populates the tabular form pulls in and then update the rows after that. I tiried doing a count and storing the value in a Page Text Field/Hidden Field and then in the AddRows to the MRU I put the field name with & and . around it. That did not work (it could not add rows and came up with an ora-6502 error) , I then tried to put a : in front of it and that failed too.
    Any suggestions on how to proceed.
    Thank you in Advance,
    - Brian

    Here is the issue quickly... I am trying to create a Master/Detail Screen. The master record always inserts, the details are populated from a query into a tabular form/updateable report and always inserts. The user will check certain details and the checked details will be marked as Y, unchecked marked as N and saved to the detail table. And tried to do some research into the issue..
    Possible Solutions I found where: 1) http://htmldb.oracle.com/pls/otn/f?p=31517:170:2680852007789839::NO:::&success_msg=0%20Row(s)%20Updated%2C%202%20Row(s)%20Inserted.%2F838A7BC908323107AD95920713AFD5FD%2F and 2) http://www.inside-oracle-apex.com/checkboxes-in-tabular-forms-the-easy-way/
    I went with 1).. but modified the code and simplified it since I always know that I should be inserting..
    I am trying to insert into a table called bd45vbjbsel
    CDSELECTED VARCHAR2(1)
    CDBILL VARCHAR2(20)
    NUXRBILL NUMBER
    NATITLE VARCHAR2(500)
    CDMEMBER VARCHAR2(20)
    DECRITERIA VARCHAR2(500)
    NUCRITERIA NUMBER
    NUXRBSELECT NOT NULL NUMBER
    NUXRBSEL NOT NULL NUMBER
    NATXNORGUSER NOT NULL VARCHAR2(20)
    DTTXNORIGIN NOT NULL TIMESTAMP(6)
    NATXNUPDUSER NOT NULL VARCHAR2(20)
    DTTXNUPDATE NOT NULL TIMESTAMP(6)
    CDSTATUS NOT NULL VARCHAR2(1)
    My Tabular Form Select is:
    select apex_item.checkbox (1,
    '#ROWNUM#',
    'onclick="highlight_row(this,' || ROWNUM || ')"',
    NULL,
    'f01_' || LPAD (ROWNUM, 4, '0')
    ) cdselected,
    cdbill, nuxrbill, natitle, cdmember, decriteria, nucriteria , 0 NUXRBSELECT, 0 NUXRBSEL, USER NATXNORGUSER, systimestamp DTTXNORIGIN, USER NATXNUPDUSER, systimestamp DTTXNUPDATE, 'A' CDSTATUS from
    (select nuxrbill, nubill, cdbill, natitle, cdmember, nurevision, MAX(NUREVISION) OVER (PARTITION BY NUBILL) nurevisionmax,
    CASE
    WHEN INSTR(':'||:P200_NUXRBILL||':',':'||NUXRBILL||':') > 0 THEN 'BILL# MATCH'
    WHEN INSTR(':'||:P200_NUXRBILLCAL||':',':'||NUXRBILL||':') > 0 THEN 'CALENDAR# MATCH'
    WHEN INSTR(':'||:P200_CDCOMMITTEE||':',':'||CDCOMMITTEE||':') > 0 THEN 'COMMITTEE: '||CDCOMMITTEE
    WHEN INSTR(':'||:P200_CDMEMBER||':',':'||CDMEMBER||':') > 0 THEN 'MEMBER: '||CDMEMBER
    WHEN INSTR(':'||:P200_DESUBJECT||':',':'||DESUBJECT||':') > 0 THEN 'SUBJECT MATCH'
    WHEN INSTR(':'||:P200_DTCOMAGNDA||':',':'||DTCOMAGNDA||':') > 0 THEN 'COMMITTEE AGENDA: '||DTCOMAGNDA
    WHEN INSTR(':'||:P200_CDPRIORITY||':',':'||CDPRIORITY||':') > 0 THEN 'PRIORITY: '||CDPRIORITY
    ELSE NULL
    END DECRITERIA,
    CASE
    WHEN INSTR(':'||:P200_NUXRBILL||':',':'||NUXRBILL||':') > 0 THEN 1
    WHEN INSTR(':'||:P200_NUXRBILLCAL||':',':'||NUXRBILL||':') > 0 THEN 2
    ELSE 3
    END NUCRITERIA
    from BM46BILL
    where cdstatus = 'A'
    AND ( INSTR(':'||:P200_NUXRBILL||':',':'||NUXRBILL||':') > 0
    OR INSTR(':'||:P200_NUXRBILLCAL||':',':'||NUXRBILL||':') > 0
    OR INSTR(':'||:P200_CDCOMMITTEE||':',':'||CDCOMMITTEE||':') > 0
    OR INSTR(':'||:P200_CDMEMBER||':',':'||CDMEMBER||':') > 0
    OR INSTR(':'||:P200_DTCOMAGNDA||':',':'||DTCOMAGNDA||':') > 0
    --OR (:P200_CDACTIVE = 'Y' AND
    OR INSTR(':'||:P200_DESUBJECT||':',':'||DESUBJECT||':') > 0
    OR INSTR(':'||:P200_CDPRIORITY||':',':'||CDPRIORITY||':') > 0
    ) a
    where a.nurevision = a.nurevisionmax
    I created an Anonymous PL/SQL Block Process called InsertMRU which fires right when a SUBMIT button is pressed after the Master information is inserted, the code for it is...
    DECLARE
    v_insertcount NUMBER := 0;
    v_updatecount NUMBER := 0;
    BEGIN
    :p200_detail_update := apex_application.g_f02.COUNT;
    FOR i IN 1 .. :P200_NUCOUNT -- Number of records pulled in from query.
    LOOP
    INSERT INTO bd45vbjbsel
    (cdselected,
    cdbill,
    nuxrbill,
    natitle,
    cdmember,
    decriteria
    VALUES (apex_application.g_f01 (i) -- cdselected
    apex_application.g_f02 (i) -- cdbill
    apex_application.g_f03 (i) -- nuxrbill
    apex_application.g_f04 (i) -- natitle
    apex_application.g_f05 (i) -- cdmember
    apex_application.g_f05 (i) -- decriteria
    commit;
    v_insertcount := v_insertcount + 1;
    END LOOP;
    :p200_detail_insert := v_insertcount;
    END;
    I am getting an ORA-01403 No Data Found error when submitting..
    Even though I am manually inserting the records do I still need to store the MD5checksum?
    Could there be another reason why I am getting a no data found on submit?
    Thank you again in advance...
    -Brian

  • Check all checkboxes in a column of a tabular form

    Hi,
    I think this can be useful for some people.. I have a tabular form with several columns containing checkboxes. I wanted to be able to check or uncheck a whole column. The problem is that I didn't find a function to do this. So I modified (and renamed) the $f_CheckFirstColumn(pNd) function.
    In "edit page > JavaScript Function and Global Variable Declaration", add this :
    function $f_CheckNthColumn(c,n){
         var e=$x_UpTill(c,"TABLE");
         for(var d=0,a=e.rows.length;d<a;d++){
              var b=$x_FormItems(e.rows[d],"CHECKBOX")[n];
              if(b){
                   if(b.checked != c.checked) {
                        b.click();
         return;
    }EDIT : The status of the checkboxes checked with the function below is not passed when submitting the form (it is passed when clicking on every checkbox). This is why I had to use the click() function (so that onClick is triggered).
    --function $f_CheckNthColumn(c,n){
         var e=$x_UpTill(c,"TABLE");
         var f=[];
         for(var d=0,a=e.rows.length;d<a;d++){
              var b=$x_FormItems(e.rows[d],"CHECKBOX")[n];
              if(b){
                   f[f.length]=b;
         $f_CheckAll(false,c.checked,f);
         return f;
    And in the report column header :
    <input type="checkbox" onClick="$f_CheckNthColumn(this, NUMBER);" />NUMBER being the column number (1st column containing checkboxes = 0, 2nd column containing checkboxes = 1, etc.)
    I'm using APEX 4.1.1.00.23, so I can not guarantee It'll work on other versions.
    Hope this can help !
    Edited by: ben0123 on Jul 13, 2012 12:12 AM
    Edited by: ben0123 on Jul 13, 2012 1:17 AM

    Glad it helped :)
    If you have only one checkbox that is conditional, you could change the $f_CheckNthColumn function by adding this kind of condition :
    if ($x_FormItems(e.rows[d],"CHECKBOX").length == max_number_of_checkboxes || n < position_of_conditional_checkbox) toggle checkbox(n); // all the checkboxes are displayed, or the nth checkbox is before the conditional checkbox
    else // one (or more?) checkbox is missing
      if (n == position_of_conditional_checkbox) do nothing;
      else toggle checkbox(n-1);

  • Checkbox disable/ enable in tabular form

    Hi,
    I am using apex4.2,
    i have column "ACTIVE" in tabular form. it is simple check box type return value "Y/N".
    i want if i tick on one check box of active column then other check box should disable , and selected checkbox should have a value of "Y" and other check box should have value of "N".
    how i can do this?
    Thanks & Regards
    Vedant.

    Vedant wrote:
    Hi,
    Could you help me to write the code. My column in tabular form are 13,14,15,16
    If i enter value in field 13 then 14 and 16th column should disable and
    If i enter value in field 14 then 13 and 15th column should disable.
    How i can do this?
    Thanks & Regards
    VedantI haven't tested this code; but the following can be your approach:
    In the "Element Attributes" field of the 13th column, you can call a javascript function as:
    onblur = "javascript:updateCols(this);"In your browser, right-click each of your columns (one at a time) and choose "inspect element" to check the HTML element attributes. Assuming that the 13th column in your tabular form is rendered in the HTML as f13, 14th column as f14, 15th column as f15 and 16th column as f16, write this JS function in the page HTML header:
    <script language="JavaScript" type="text/javascript">
    function updateCols(pThis)
        var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
       if (pThis.value.length > 0)
           $('#f14_'+vRow).attr('disabled',true);
           $('#f16_'+vRow).attr('disabled',true);
       else
           $('#f14_'+vRow).attr('disabled',false);
           $('#f16_'+vRow).attr('disabled',false);
    </script>The above JS function is fired when the user tabs out of the 13th column. The function then checks the length of the value entered by the user in the 13th column. If the length is greater than 0, it disables the 14th and 15th columns. Else, it enables them.
    The above code is for your first scenario:
    If i enter value in field 13 then 14 and 16th column should disableYou can do the same for the other scenario.
    Hope this is clear. Or else, give me access to your workspace and I can try the above there.

  • How to disable row in tabular form when checkbox checked?

    Hi.... this is what i want to do....
    I created tabular form for offering items... there is a checkbox that is used to select item with lowest price...
    But i have also one column that shows item options ( option is for example... i want offer for 22" monitor Samsung, but seller have only 22" LG monitor.... so in my offering will be shown item (22" monitor Samsung) that i want, and in row below item (22" LG monitor) that seller have... both items will have same order id....
    Next thing i want to do is when i select checkbox with item (22" LG monitor) as lowest price, i want that row with same order id (22" samsung monitor) is disabled.
    Is that possible to do?
    This is my code for creating tabular form:
    SELECT
    CASE WHEN RED_BR_OPCIJE = 0 THEN '-' ELSE TO_CHAR(RED_BR_OPCIJE) END RED_BR_OPCIJE,
    apex_item.hidden(1, ID_STAVKE)||
    apex_item.hidden(2, ID_STAVKE_IZ_ZAHTJEVA)||           ---order_id
    apex_item.hidden(3, ID_PONUDE)||
    apex_item.hidden(4, ODABIR_NAJPOVOLJNIJE_STAVKE)||     
    apex_item.checkbox(5, '#ROWNUM#', null, decode(ODABIR_NAJPOVOLJNIJE_STAVKE, 'X', '#ROWNUM#')) Odabir,    ---checkbox_lowest price
    apex_item.textarea(6, NAZIV_ARTIKLA_TRAZENO, 3, 40, 'readonly="readonly"') NAZIV_ARTIKLA_TRAZENO,
    apex_item.textarea(7, NAZIV_ARTIKLA, 3, 40, 'readonly="readonly"') NAZIV_ARTIKLA,
    apex_item.text(8, SIFRA_ARTIKLA, 8, 20, 'readonly="readonly"') SIFRA_ARTIKLA,
    apex_item.text(9, JMJ, 5, 20, 'readonly="readonly"') JMJ,
    apex_item.text(10, KOLICINA, 6, 20, 'readonly="readonly"') KOLICINA,
    apex_item.text(11, JEDINICNA_CIJENA, 12, 20, 'readonly="readonly"') JEDINICNA_CIJENA,                                      ---price
    apex_item.text(12, IZNOS_STAVKE, 12, 30, 'readonly="readonly"') IZNOS_STAVKE,
    apex_item.text(13, IZNOS_RABATA, 12, 20, 'readonly="readonly"') IZNOS_RABATA,
    apex_item.text(14, JEDINICNA_CIJENA_NAKON_POPUSTA, 12, 20, 'readonly="readonly"') JEDINICNA_CIJENA_NAKON_POPUSTA,
    apex_item.text(15, IZNOS_STAVKE_NAKON_POPUSTA, 12, 20, 'readonly="readonly"') IZNOS_STAVKE_NAKON_POPUSTA
    from PONUDE_STAVKE
    where ID_PONUDE = :P34_ID_PON
    ORDER BY ID_PONUDE ASC, ID_STAVKE_IZ_ZAHTJEVA ASC, RED_BR_OPCIJE ASC
    And this is example table with a few column names:
    order_id      option_number               item_name                      price         checkbox_lowest price
    1086                    -                Samsung 22" monitor              100$                 null                ---this row should be disabled because next row is selected as lowest price
    1086                    1                LG 22" Monitor                    90$                 X                   --- both rows have same order_id
    1050                    -                Router                            100$                X

    Hi snake2903,
    {thread:id=998140}
    {thread:id=1554583}
    {thread:id=2249233}
    Hope it helps!
    Regards,
    Kiran

  • Issue with APEX_ITEM.CHECKBOX in Manual Tabular Form report

    Hi,
    I have a simple manual tabular form report with query :
    SELECT
    APEX_ITEM.CHECKBOX(1,order_id) ,
    APEX_ITEM.TEXT(3,Ord_number) ,
    APEX_ITEM.TEXT(4,ord_flag)
    from
    tbl_order
    and a process to update the value of Ord_number & ord_flag columns for the selected (Checked) rows.
    FOR i in 1..apex_application.g_f01.count
    loop
    UPDATE
    tbl_order
    SET
    Ord_number = apex_application.g_f03(i),
    ord_flag = apex_application.g_f04(i)
    WHERE
    order_id = apex_application.g_f01(i);
    END LOOP;
    But the values getting updated wrongly , how can I ensure the exact values is retrieved in apex_application.g_f03(i) & apex_application.g_f04(i) ?
    Regards.
    Benz

    I think the row selector is there if you create an tabular form. However, you can create it yourself following this example:
    http://apex.oracle.com/pls/otn/f?p=31517:170
    Basically,
    apex_item.checkbox (30,
                               '#ROWNUM#',
                               'onclick="highlight_row(this,' || ROWNUM || ')"',
                               NULL,
                               'f30_' || LPAD (ROWNUM, 4, '0')
                              ) delete_checkboxDenes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Changing tabular form column to checkbox

    I have a tabular form in 3.2. There is a column that is a text field, but really should be a checkbox. I have tried changing the region source to something like, select a, b, APEX_ITEM.CHECKBOX(3, PRIMARY FLAG) "PRIMARY_FLAG", d
    from my_table
    WHERE a = :P52_XPROD, but the column still shows up as a text field, displaying a value like "<input type="checkbox" name="...etc.
    Is it possible to change a tabular form column to a checkbox in 3.2?

    edit your report attributes, then edit your column and change "display as" to "standard report column"
    Thanks
    Tauceef

  • Tabular forms, referencing current row and using checkboxes

    I've searched through the whole forum and read over 50 threads on referencing other columns in a tabular form only to find this impossible. Many of these threads were outdated so I would like to ask it again.
    Can I use references between columns of tabular forms? So that value of one column equals the other's. (select a, b from c where d=othercolumn)
    How can I get a workaround for lack of checkboxes in dynamically created tabular forms? (Standard tabular forms come with checkboxes for deleting multiple rows, can they be used in the same way but without writing manual reports?)
    Please do not send me to
    http://htmldb.oracle.com/pls/otn/f?p=18326:54:17962256093711784584::::P54_ID:1282
    I am looking for strictly dynamic, apex-like solution. Thanks in advance.

    That supposed to be a query for LOV, should have mentioned that probably. By dynamically created tabular form I mean the wizard-created form which transforms query results into a form on the fly. I consider the HTMLDB_ITEM-style the manual way. After all, I'll probably stick to the manual method because I am creating this form on a view with INSTEAD OF triggers so the processing still needs to be done separately.
    The question I asked referred to the internals of tabular forms' processing, behind the screen wizards there has to be some loop based on the query, I just wanted to reference other columns on the current iteration. (wwv.g_f01(0) ?...)

  • Add rows to tabular form with apex_item.checkbox?

    Hi,
    I have created a data manipulation process to add a row to a tabular form. The issue is that I have some checkboxes and when I click the button to call the add row process it doesn't
    create any of the checkboxes only the text fields. Is there anyway for me to accomplish creating the checkboxes in this manner?
    Thanks in advance!

    Hi,
    So any existing data on the table must be hidden from view, so that this tabular form is, in effect, for inputs only?
    If so, you can create dummy rows using something like:
    SELECT NULL EMPNO, NULL ENAME, etc
    FROM DUALAs long as the process still refers to the EMP table that should be ok. If you still needed to include data from the EMP in certain circumstances, you could then just do a UNION ALL to the above and provide a WHERE clause:
    SELECT NULL EMPNO, NULL ENAME, etc
    FROM DUAL
    UNION ALL
    SELECT EMPNO, ENAME, etc
    FROM EMP
    WHERE :P1_SHOW = 1You could also delete the rows using javascript but you would lose any entered changes by the users - either of the above would be used during a page load, though, so any entered data would be saved when the page is submitted (unless you conditionally disabled the process)
    Andy

  • Tabular Form - Checkbox

    This is a simple requirement which I have for the first time. I want to have a checkbox in a
    tabular form, which will show checked value for 'Y' and unchecked for NULL. This sounds
    simple and is actually a usual requirement in many cases. However, I can't get it working
    in this example:
    http://htmldb.oracle.com/pls/otn/f?p=31517:123
    1. Checking some of the rows and then trying to update the table is resulting in a no data
    found error message,
    2. Checking all the values will not result in an error,
    it will update the other columns but it will not update
    the checkbox column.
    Can someone please explain how to handle something like that?
    Thanks in advance,
    Denes Kubicek

    Hello Denes,
    " However, the hidden item is not a problem"Sorry about that. Didn't notice you changed it to editable field.
    " … but G_F10 array "Yes. The G_F10 array will contains values only for the checked rows. So if you'll take row 5, which is not checked, the i index will be 5, but you don't necessarily have HTMLDB_APPLICATION.g_f10 (5) if you didn't check 5 rows.
    If you want to act only on the checked rows, you need to loop on the (currently) G_F10 elements. You should attach the checkboxes to the empno column – HTMLDB_ITEM.CHECKBOX(1,empno) – and then use it as your key in the where clause.
    I believe your report query should look something like this (and of course you need to show this column):
    SELECT  HTMLDB_ITEM.checkbox (1,empno) " ", ename,
           HTMLDB_ITEM.select_list_from_query
                                         (3,
                                          job,
                                          'select distinct job, job from emp'
                                         ) job,
           HTMLDB_ITEM.popupkey_from_query (4,
                                            mgr,
                                            'select ename, empno from emp',
                                            10
                                           ) mgr,
           wwv_flow_item.date_popup (6, NULL, hiredate) hiredate,
           HTMLDB_ITEM.text (7, sal, 10) sal, HTMLDB_ITEM.text (8, comm, 10) comm,
           HTMLDB_ITEM.select_list_from_query
                                         (9,
                                          deptno,
                                          'select dname, deptno from dept'
                                         ) deptno,
           check_char check_char_value
      FROM emp_garbageand your update process, something like this:
    BEGIN
       FOR i IN 1 .. HTMLDB_APPLICATION.g_f01.COUNT
       LOOP
          UPDATE emp_garbage
             SET job =
                      REPLACE (HTMLDB_APPLICATION.g_f03 (i), '%' || 'null%', NULL),
                 mgr =
                      REPLACE (HTMLDB_APPLICATION.g_f04 (i), '%' || 'null%', NULL),
                 hiredate = HTMLDB_APPLICATION.g_f06 (i),
                 sal = HTMLDB_APPLICATION.g_f07 (i),
                 comm = HTMLDB_APPLICATION.g_f08 (i),
                 deptno =
                      REPLACE (HTMLDB_APPLICATION.g_f09 (i), '%' || 'null%', NULL),
                 check_char = 'Y'
           WHERE empno = to_number(HTMLDB_APPLICATION.g_f01 (i));
       END LOOP;
       COMMIT;
    END;Regards,
    Arie.

  • Custom error message in a tabular form

    Hello,
    I try to implement a solution for a custom error message in a tabular form.
    My intention is, that a error message about a foreign key constraint violation should told the end user what happens in a friendly way.
    So I try to implement my own delete-process, where I can catch the exception and display my own error message.
    In the process I use the following code to delete the selected row:
    begin
    for i in 1..apex_application.g_f01.count loop
    delete from d_cmp_campaign
    where campaign_id = apex_application.g_f02(i);
    end loop;
    end;
    And this is the select of the tabular form:
    select
    "CAMPAIGN_ID",
    "CAMPAIGN_ID" CAMPAIGN_ID_DISPLAY,
    "NAME",
    "CAMPAIGN_NO",
    "DWH_DEF_TIME",
    "DWH_DEF_USER"
    from "#OWNER#"."D_CMP_CAMPAIGN"
    The problem is, that the first row is deleted always, whatever row is selected.
    Can anyone help me with that issue?
    Thank you,
    Tim

    Every checkbox has a value which is the corresponding row. You got to get the row number
    first and based on that you select the record. For example, if you click the rows 1 and 5,
    you first need to know which rows are selected. Then, you would loop twice and get the
    first and the fifth array values.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

Maybe you are looking for

  • Connected to Internect but itunes store won't connect

    If anyone can help that would be great. I've run through the troubleshooting guides and nothings worked. I made sure itunes was being allowed by the firewall and made sure the port was open...what do I do? Please find below the diagnostic report. Tha

  • Cursor size limited to 32x32?

    Hi, I'm trying to implement a custom cursor on my DnDTable, and the idea is that it must display the name of the dragged object. I already found out how to change the cursor to one of my own (Toolkit.createCustomCursor()), but the problem is that I c

  • Slide Oddity

    Hi, I'm brand new to Spry and am trying to add a simple slide effect to a short view / detail list page. The detail div is empty and set to display: none in the stylesheet. display: hidden still shows the top border and about a line break worth of sp

  • Looping intro media?

    I'm creating an iBook textbook to be used at a convention.  I need the intro media to loop continously until someone slides over to the TOC for Chapter 1.  In the Inspector panel i have the repeat option set to "Loop" but no matter what at the end of

  • Mapping 0LOC_CURRCY to 0ORDER_CURR

    Hi, I'm a bit confused here. In the update rules 2LIS_02_ITM on e.g. 0BBP_INV I see a mapping: 0ORDER_CURR   <-    0LOC_CURRCY While the extractor provides both WAERS (order currcy) and HWAERS (Local currcy). Isn't there a conflict? Or is there a cur