Column value substitution in tabular form element attributes

We started to discuss this at Re: Tabular form with Ajax
I also mentioned this at Re: how to make only some rows editable in html db.
but thought that this deserves its own thread.
In Doug's sample Sudoku application in that thread, he uses #COLUMN# substitution in the Form Element Attributes and it works fine, but in my example page at http://htmldb.oracle.com/pls/otn/f?p=24317:219 I used the same technique and no matter what I do, the #COLUMN# substitution is not expanded by the Apex engine.
This is driving me nuts, any ideas why it works in one application but not in another?
Thanks

Hm, you might be right.
I copied your row template and modified it at http://htmldb.oracle.com/pls/otn/f?p=24317:219
The styling looks terrible, not sure why, the template is simply
<tr>
<td class="t10data">#EMPNO_DISPLAY#</td>
<td class="t10data">#ENAME#</td>
<td class="t10data">#JOB#</td>
<td class="t10data">#MGR#</td>
<td class="t10data">#HIREDATE#</td>
<td class="t10data">#SAL#</td>
<td class="t10data">#COMM#</td>
<td class="t10data">#DEPTNO#</td>
</tr>I had a lot of trouble getting this to work because the wizard generated tabular form appends 2 hidden fields containing the PK and the row-checksum to the last (editable?) field on each row. If the last editable field has #COL# substitution, it expands the substitution and forgets to close the INPUT tag thus causing malformed HTML (I think this is a bug in the rendering engine).
The readonly condition is sal>1000 which now works. The SAL>1000 fields are now readonly.
But now the update process is broken. If I enter a number in the first blank SAL field (empno=3641) and click Submit, I get no errors but the change is not saved. Wonder why.
Hopefully, Scott (Spadafore) will take mercy on our amateurish experiments and give us some definitive answers soon!
Thanks.

Similar Messages

  • Passing Session Values to the Tabular Form Element of a Report Column

    Hello,
    I'm running application express version 2.0 with a 10.2.0.2.0 database on a 32 bit windows box. I'm trying to figure out sneaky a way to pass the &APP_PAGE_ID., #APP_PAGE_ID# or V('APP_PAGE_ID'); as an element attribute of a Report Tabular Form Element set to display as a Select List (named LOV).
    It seems that whatever option I choose, the Element Attributes field will only render the literal value of what I have entered. This is part of the solution but I would like to find a way to pass the current page id.
    What I'm trying to do is utilize the ONCHANGE attribute to redirect to a report page in my application when the value from a Select List (named LOV) is selected.
    I could work around this by creating my own table output with PL/SQL and HTP.P commands but would really be interested in finding out if I can use the reporting structures which are already available through Application Express.
    Any ideas?
    Thanks.
    Justin.

    Thanks for the response Earl. To clarify this is what I've done and what I hope to achieve:
    I currently have a LOV for my application that identifies a number of database report types: DB Options, DB Parameters, DB Version, and so on.
    I have an application express report being generated for the databases I'm monitoring and it displays as follows:
    - HOST -- DBTYPE -------- DBNAME - DBREPORTS
    =====================================
    - SVR 1 - Oracle 9.2.0.1 - DEV -------- [LOV HERE]
    - SVR 2 - Oracle 9.2.0.7 - TST --------- [LOV HERE]
    I am displaying the LOV on my report the the options under the reports attribute tab in my application builder. I insert my LOV select list by editing the DBREPORTS column and set the "Display As:" option under Tabular Form Element to "Select List (named LOV)"; I have also added my LOV to the "Named LOV" option under List of Values.
    So far this achieves everything I would expect and works quite well (a select list with my report types appears in my monitor report for each DB that is returned).
    What I'm interested in doing now is opening a DBREPORT for a given database by simply choosing the report type from my LOV. I can set the "Element Attributes" option under Tabular Form Element to execute a javascript call for any valid event (in my case I'm using ONCHANGE).
    My only issue is that I cannot find a way to pass any session values from my page to my Element Attribute. If, in the Element Attributes field I enter:
    onchange="alert(this.value);" //my dialogue box will display the value of my current selection when I choose a report type.
    What I'd love to be able to do is something like:
    onchange="alert('&APP_PAGE_ID.');" //so my current page id is written to the element.
    Unfortunately, only my literal text seems to be rendered. Rather than having my dialogue come back with my page number, say 75, I receive the literal value &APP_PAGE_ID.
    Notwithstanding any quote issues, I've tried to dump a test html attribute to my source html by entering any of the following in the Element Attributes field:
    test=&APP_PAGE_ID.
    test=#APP_PAGE_ID#
    and as a shot in the dark knowing that I'm not using PL/SQL:
    test=V('APP_PAGE_ID');
    In every case when I view source I see the literal value of what was entered in the Element Attributes field (ie "test=&APP_PAGE_ID." instead of "test=75").
    What makes things a little more frustrating is that I can drop &APP_PAGE_ID. into the Column Heading field (ex My Heading &APP_PAGE_ID.), it renders as I would expect; "My Heading 75". If we could find a solution to this, I could see a number of slick uses for this type of functionality.
    Hope this helps,
    Thanks.
    Justin.

  • How to set a column value in a tabular form via button

    Hi All,
    I am using Apex 3.0.1. And to create the form I am using the APEX interface tool
    I have tabular updateable report. In the same page I have a LOV field where I can choose some possible results.
    I want to have a button so I can select a value in the LOV, take this value and populate the column value to the LOV value for all rows in the tabular form.
    The LOV and the buttons are done.. to update the column I tried creating a pl/sql that is executed when the button is pressed and has the following update in a loop for each element:
    begin
    for i in 1..APEX_APPLICATION.g_f01.count loop
    APEX_APPLICATION.G_F02(i) := :P1_MY_LOV_VALUE;
    end loop;
    commit;
    end;
    When I press the button, the page refreshes but nothing happens. I don't see any changes in the Values for the column I am trying to update
    Thanks

    Hi user477501,
    If you are doing this after a SUBMIT, then try updating your data table instead of the g_f02 array. When you page is re-rendered, it should re-query your data table.
    If you do not want to submit the page, then try your hand at JavaScript.
    A good reference for this is Mike Hichwa's article at:
    http://www.oracle.com/technology/oramag/oracle/06-nov/o66browser.html
    Be sure to download the example application, it is very helpful.
    I hope this helps.
    Patrick

  • How to Set Default Value into a Tabular Form Element

    Hi,
    Hoping someone can assist with my Tabular Form query.
    I am using Oracle ApEx v3.0.1
    I was wondering how one can set a default value to one of my tabular form columns within Oracle ApEx v3.0.1 as I cannot see how to do it?
    Thanks.

    Hi Tony
    can you pl. help me how you resolve this? I have one tabular form and I am trying to set default value as :APP_USER, I type this in default value but somehow it is not displaying this value.
    thanks
    Dax

  • Issue with setting a default value to a Tabular Form field

    Hi -
    I'm running into an issue setting the default value of a tabular form column. I'm trying to set the default value to the row number (#rownum#). This used to work in previous versions, but now it's returning 0. Is there a was to set this value in the default value attribute of the field with a substitution string?
    Thank you in advance for help!

    Share with us what worked in previous versions.
    Jeff

  • Setting a Default Value within a Tabular Form

    Hi All,
    Using Apex 2.2.1
    Hoping someone can assist. I have the following two scenarios where I would like to set a default value to a column within a tabular form.
    Scenario One:
    Prior to actually displaying the tabular form on the page, I have a region on this page where I ask the user to select a Application No. first (using a Select List with Submit). Once this item, say P50_APP is set to a value, the Tabular Form region is then presented to the user by where I then allow them to enter certain information required using the 'Add Row' button. One of the columns within this tabular form also represents the Application No.
    My questions are:
    a) I have made the Application No. within the tabular form as a LOV, so when the user hits the 'Add Row' button, how can I set the initial value to P50_APP value using the 'Default Type and Default' items within the column?
    b) Since I am trying to achieve a master-detail type scenario here, if (a) above is not possible, if I hide the Application No. column within the tabular form, how can I set it to P50_APP when the user presses either the 'Add Row' or 'Submit' buttons?
    Scenario Two:
    Is it possible to pass a value from a tabular form, i.e a column within this tabular form on one page, to another tabular form column on a another page (when the user presses the 'Add Row' button) within the same application?
    For example, on page 50 I have the column #APP_NUMBER# passed onto page 60 which is another tabular form that also holds the same column name #APP_NUMBER# , so when the user on page 60 hits the 'Add Row' button, I would like the App Number column default to the one just passed over from page 50.
    Is this possible?
    Apologies if I am asking the same things in both scenarios - just want to make sure I understand MRUs.
    Thanks.
    Tony.

    Hi Andy,
    Thanks for getting back to me but I think you are referencing these default values in the wrong section.
    What I am actually trying to set is the value of a column within a tabular form to P50_APP and it seems to me that the only available options for setting default values on a tabular form column are by using:
    Default Type: which can be one of:
    No Default
    Item (application or page item name) or
    PL/SQL Expression or Function
    and then actual source is set against:
    Default:
    Unsure as to how to actually set the value of P50_APP which is in session to the individual tabular column mentioned above.
    FYI, I have tried selecting for Default Type: Item (application or page item name) and then specifying for Default:&P50_APP. as well as Default Type:PL/SQL Expression or Function and specifying for Default: :P50_APP but to no avail.
    Tony.

  • Two HTML in one HTML Form Element Attributes........

    In my HTML Form Element Attributes i already have one *<INPUT readonly name="Customer Code"/>*, then i tried to add another HTML onmouseover="toolTip_enable(event,this,'Customer Code')" , i.e, like this both HTML in one Element Attributes +<INPUT readonly name="Customer Code"/>+ onmouseover="toolTip_enable(event,this,'Customer Code')" but its not working .
    how do i put both HTML in one HTML Form Element Attributes?
    Skud :(

    Hi,
    I think this is duplicate post
    Delete the symbol........
    What you try archive. Form element attributes is not place where you enter HTML. You enter only attributes there like
    onmouseover="toolTip_enable(event,this,'Customer Code')"PS: when posting code wrap it to {noformat}{noformat} tags
    Regards,
    Jari

  • Coloring the changed values  in a tabular form

    Hi,
    I have a tabular form (Sql query updatable report) which displays the data from table1, in this I need to color code the fields whose value is different from a similar column in table2. In simple how can I add color tag in the sql query. I tried using the below
    select <&ltdiv style="background:red;color:red">||LAST_NAME||<&lt/div> LAST_NAME, first_name from table1
    but it sets the div tag part as LAST_NAME input field's value.
    Any suggestions please ?
    Thanks,
    Pourush
    Edited by: Pourush Gopal on Apr 1, 2009 10:41 AM
    Edited by: Pourush Gopal on Apr 1, 2009 10:41 AM
    Edited by: Pourush Gopal on Apr 1, 2009 10:41 AM

    Try this (with quotes around the div tags):
    select '&lt;div style="background:red;color:red">'||LAST_NAME||'&lt;/div>' LAST_NAME, first_name from table1

  • Change column to update on Tabular Form

    Hello
    I created a tabular form on a table and when creating it, I made one of the columns not updateable. Is there a way I can change the properties of this column to updateable without having to delete the tabular form and start again.
    Regards
    Craig

    Hello
    I created a tabular form on a table and when creating it, I made one of the columns not updateable. Is there a way I can change the properties of this column to updateable without having to delete the tabular form and start again.
    Regards
    Craig

  • How to set a value of a hidden form element

    I want to add a hidden element to form and set the value
    from javascript before calling submit().
    My javascript function
    function getBdSubmit()
    alert('getBdSubmit function called');
    document.forms.DataForm.event.value="getBd";
    document.forms.DataForm.submit();
    The Javascript is called from onChange of a poplist as
    DataForm:getBdSubmit();
    I am getting alert message, but an error in next line as object document.forms.DataForm.event.value is null or note a object.
    How can access the hidden element in form?

    I got a work around. I gave a name to the form in the datapage and set the type to the type specified in the struts-conf.xml file. Then i was able to access the hidden field "event" from the javascript as
    document.forms.DataForm.event.value to set different event names
    Joshy

  • How to assign values to columns in a tabular form

    hello,
    my tabular form allows insert on a table.
    some of the fiels in that table are not null and are hidden from the user.
    before submitting a new row the hidden columns needs to get their values
    from a database function.
    is there a way to do it in a tabular form? and how?
    Thanks,
    Iris.

    HI,
    depends you can use a bunch of different approach, however if you want to use tabular forms note that if you change the qry on wich is based the tforms usually you get an error (if you read around the forum this is because the MULTI PROCESS ROW is built on a table the time you use the wizard).
    If you need this function to 'work' with null value go to
    Tabular Form Element
    --> pl/sql expression or function and call your function in the db.
    Under my opinion if you want to have more control build a tabular form of yours and write your DELETE / UPDATE / INSERT statement and build your tabular form / report using the APEX_ITEM synthax.
    You can use as well a checkbox and loop to build your multirow process (that conditionally process the checked item).
    And if you have a common rules for a specific table i suggest you to manage these rules directly on the that table using triggers.
    hope it helps

  • Tabular form default column value bug when using named notation?

    Hi,
    I am using Application Express 4.0.2.00.07
    After exporting and importing an application, the default value of a tabular form column results in an "ORA-00907: missing right parenthesis" error.
    My original application uses named notation while calling my function (no problem here):
    Report Attributes > Column Attributes > Tabular Form Attributes > Default type = PL/SQL Expression or Function > Default = pkg_customers.some_funtion (*in_param =>* :P15_FK_CUSTOMER_ID).
    When I change this in my imported application to ... > Default = pkg_customers.some_funtion (:P15_FK_CUSTOMER_ID) everything works fine again.
    Is this a known bug or is there something I do not see?
    Regards,
    Frederik Van de Velde.

    yes it is
    p_column_default=> 'calpa_pkg_klanten.fun_sm_betreft_default (in_pk_klant_id => :P9_FK_KLANT_ID)',
    p_column_default_type=> 'FUNCTION',
    by default it is set exactly the same, but when running the page the tabular form does not render because of the usage of " =>".
    thx

  • Enable/Disable item Based Value from Select in Tabular Form

    Hi Guys
    I want to Disable text field in Tabular form, Based on the Select List Item Value.
    Let's Say
    I'm having one select lista and text box in each record in tabular form.
    Select List having 2 items ... Add Text(return value 1) and No Text(return value 2)
    if value =1 then i want to enable text box , so user can enter value.
    if value=2 then text box won't allow to add text or will become disalbe.
    Please Help
    Thanks

    Hi,
    You can do this by using a small java script
    <script language="JavaScript" type="text/javascript">
    <!--
    function FldEnableDisable(pThis)
    if (pThis == 50)
      $x('P2_TEXT').disabled=true;}
    else
    { $x('P2_TEXT').disabled=false; }
    //-->
    </script>Here P2_Text is the text box whose value I am enabling or disabling based on the selected value from a List box. On The list box I have onChange="javascript:FldEnableDisable(this.value)" ( You can specify this under HTML Form Element Attributes)
    Thanks,
    Manish Jha

  • Form Element Name, is it possible to set in "Column Attibutes" ?

    Is it possible to set the "Form Element Name" for a column e.g. in tabular form in the "Column Attributes" which can be found from:
    Page --> Report region --> Report Attributes --> and select Column --> Column Attributes: for the selected column.
    The idea is to avoid coding the form element names with e.g. like:
    SELECT APEX_ITEM.SELECT_LIST_FROM_LOV(2,job,'JOB_FLOW_LOV')
    FROM emp
    Where the 2 is the Form Element Name for the column and a bit confusingly to F02, which can be seen e.g. with Firebug.
    Another question is that is it possible then to override the Form Element Name if the query has hardcoded different P_IDX in the apex_item.xxx ?
    Perhaps it would be very good to have a mapping too in the "Report Attributes"l for the columns order vs. collections order vs. Form Element Name order .
    rgrds Paavo

    I want to have control over certain 'dimension type of' columns in the classic report / tabular form with APEX_ITEM.* in the sql for the report while some of the columns are from Collection with their collection column names. C001, C002 etc..
    ...clips
    SELECT
    APEX_ITEM.SELECT_LIST_FROM_LOV(35
    ,C035,'LOV_ANIMALS'
    ,'style="width:50px"','YES',NULL,NULL
    ,'f35_' || LPAD (seq_id, 4, '0'),NULL) animals
    ,to_number(c001) c001
    ,to_number(c002) c002
    FROM apex_collections WHERE collection_name = 'SLEEPY_ANIMAL'
    ...clips
    When there are several columns in the report, it is easier to maintain C001...columns appearance in the Report Attributes-->Column Attributes.
    Oh yes, I have adapted Denes dynamic cascading lov for tabular forms which is the reason for having the "APEX_ITEM..." in the query and from some blog I read that it is very good to toss those 'dimension' type of columns to high-end numbers in the collection, so there will be space for the entry columns.
    E.g. firstrow in the tabular form
    c035 -- animals --> f35 --> f35_0001 (select list with lov LOV_ANIMALS)
    c001 -- "what ever I have said in Column attributes"--> f01 --> f01_0001 (text area, editable column)
    c002 -- "what ever I have said in Column attributes"--> f02 --> f02_0001 (text area, editable column)
    So the numbering is the same for the www-form and collection columns.
    Everything is ok if the columns c001 and c002 are editable e.g. 'text area' type, but if I change c001 to 'Display..' type then the order for item_id's change.
    c035 -- animals --> f35 --> f35_0001
    c001 -- "what ever I have said in Column attributes" (display as text (escape special chars...))
    c002 -- "what ever I have said in Column attributes"--> f01 --> f01_0001
    So now the collection column c002 accidentally is mapped to forms f01-column while I might assume it is f02.
    rgrds Paavo

  • Not null and enable or disable  column in tabular form

    Hi,
    Using apex version 4.1 and working on tabular form.
    ACT_COA_SEGMENT_MAS is Master table
    and
    ACT_SEGMENT_VALUES_MAS is detail table
    I have entered 8 rows in master table and PARENT_SEGMENT_ID is column in master table which is null able. If i specified PARENT_SEGMENT_ID with value in master table then in detail table there is column PARENT_ID that should not be null and enable.
    How i can enable or disable column when in master table PARENT_SEGMENT_ID column is null then in detail table PARENT_ID column should disable and vice versa.
    I have created tabular form on Detail table. before insert into the tabular form Check in master table in first entry if PARENT_SEGMENT_ID is not null in first row of master table then in tabular form PARENT_ID should enable and not null able in corresponding to this first row id's lines in tabular form.
    Same should check for second row in master table if PARENT_SEGMENT_ID is not null then entered rows with PARENT_ID into tabular form corresponding to 2nd id in master table should not nullable and column should enable in tabular form.
    Thanks & Regards
    Vedant
    Edited by: Vedant on Jan 9, 2013 9:12 PM

    Vedant,
    You need to create you own manual tabular form and not use the wizard.
    Using APEX_ITEM api you should be build you own form and you will be able to control how you wan to display the rows. (See Link [Apex Item Help|http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_item.htm#CACEEEJE] )
    select case when PRIMARY_TABLE_COLUMN is null then APEX_ITEM.DISPLAY_AND_SAVE(3 , DETAIL_COLUMN ) else APEX_ITEM.TEXT(2,detail_column) end "ALIAS" from detail table
    Hope that help.
    Vivek

Maybe you are looking for