Conditional formatting of elements in tabular form

I'm using APEX 4.1.
I would like to hilite any updateable cells in the form where the value in the cell is not '0.00'. This is not an error condition. It is just meant to assist the user review relevant entries.
As perhaps a further complication, I'm using a PL/SQL function for my column headings.
Any suggestions?

ddb wrote:
I'm using APEX 4.1.
I would like to hilite any updateable cells in the form where the value in the cell is not '0.00'. This is not an error condition. It is just meant to assist the user review relevant entries.I did something like this a few months ago to put values < 0 in red. Try something like
select case
  when to_char(amount) != 0 then '<font color=red>'||to_char(amount)||</font>'
  else to_char(amount)
  end;A style sheet would probably be more elegant but this should be easy

Similar Messages

  • Detect changes on tabular form

    HI guys!
    Is there any way to detect that there were some changes made on tabular form? My Client wants me to create items which are conditional upon changes made on tabular form. IE button X is only visible if there were no changes made on tabular form.
    With regards,
    PsmakR

    Hello Konrad,
    >> Stronger should be hiding button because there are changed cells …
    OK. This is the simpler scenario.
    The button should be rendered upon loading the page, as at this point there are no changes to the form.
    You should leave the checkbox column, which selects your rows, unchanged (event free), as it doesn’t affect the visibility status of the button – it should remain visible even if rows were selected (without changing any other cells).
    As I suggested in my first post, you should use the onchange event with all the other editable columns. The event should call a JavaScript function that hides the button, because when fired it means something has changed in one of the cells.
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Author of Oracle Application Express 3.2 – The Essentials and More

  • Tabular Form: Conditional column based on another column in table/form?

    Hi!
    I have 4 columns in table A:
    number (the question number)
    question (the question to be asked)
    type (TEXT, LOV are the 2 valid values)
    answer (the answer with text or a selection from the lov table below)
    I have 2 columns in table B:
    number (the question number)
    values (a single value for the lov's)
    In table B there can be mutiple rows for each number. Table A and table B
    join on the number.
    I want to build a tablular form on table A where for each row either a text
    box or a select list is displayed depending on the contents of the type column.
    So row 1 would display a text box when the type value is text; row 2 would
    display a select list when the type value is lov.
    Is this even possible? How do I refer to the type column in the conditional for the
    answer column? I am guessing that I will need to have 2 answer columns one
    that displays when the type column is TEXT and one that displays when the
    type column contains LOV. This is OK. Setting up the conditional is display is the issue at this point.
    Hopefully I have explained this well enough! :)
    Thanks!
    Dave Venus

    Hi Dave,
    Sorry for not responding sooner - I finish work at 3pm GMT.
    I'll take your first question first (3:28PM posting according to my display - not sure if you are on GMT time?):
    As far as I understand it, using the select_list_from_query() function generates the options that are required in the select list as HTML tags. Each instance of this function should create a SELECT tag and the results of the query should generate one or more OPTION tags within it.
    Second question (4:20PM posting):
    The HTMLDB_ITEM functions are listed in the documentation - here's a link to the online version:
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14303/api.htm#sthref2524
    Most of the examples that I have seen have been on this forum - simply search for HTMLDB_ITEM or one of its functions.
    I tend to leave the generation of tabular forms to the wizard as much as possible. The only exceptions are when I need to have access to more than the Primary Key for a row but don't want to show the field on screen. There are examples on the forum about concatenating the HTMLDB_ITEM functions into a single value - this hides ID fields from the user but makes them available to PL/SQL code.
    Third question (5:29PM posting)
    I did try using DECODE in my questionnaire but not for the feature that you needed. Originally, I wanted to use this to display one of a number of different fields (ie, my date, number or string field as appropriate to the question) but this didn't help as I couldn't get back to the right field during the update. If you have decode working for the select lists, then that's great!
    The first column should be hidden or sitting behind a checkbox as this should be the Primary Key for the row and should not be editable by the user nor would it normally be displayed.
    As long as your select statement creates the correct output (albeit that you may need to work on the layout!), you should have an updatable form. However, you will need to have the MRU processes in place and the appropriate buttons that trigger these. When I did my questionnaire, I created the form using a wizard to get all of the processes and buttons and then changed the select statement. If you haven't got the processes and/or buttons, we can go through adding these onto your page.
    Last question (9:08PM posting)
    As explained above, column 1 should normally be hidden. The INPUT tag you detail above is what I would expect to see. The value="6" attribute indicates that 6 is the Primary Key for that row - every row will have the same tag but different values for the "value" attribute. So, if it is hidden and these are the tags you see doing a View Source on the page, then everything is correct.
    OK. So now we have the data on screen and (hopefully?) we have the correct processes and buttons on the page.
    The next step would be validation and update of the data.
    Validation of the data can be handled by a normal page process - I can let you have example code if you want to validate the data (this will also explain how to loop through the rows - there are also methods that you can use to do this in javascript if you want). Updates should be handled by the processes and buttons on the page - again, if you haven't got these we can go through adding them in (although, if you haven't yet formatted your page, you may find it quicker to copy your select statement and create the page again using the same select statement).
    ORA-20001 errors are user defined errors. Do you mean the "data has changed" errors? If so, you will probably need to include the MD5 checksum functionality (it's shown in the document linked above).
    Finally, we'll keep this thread going so that you have all of your workings and my responses in one place, if that's ok with you?
    Regards
    Andy

  • 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.

  • Bug: 4.1.1 Tabular form with all columns conditional

    I need to make all the columns in a tabular form conditional because in some situations the editable elements should not be shown. For some reason just changing the columns to conditional stops the form working, the ApplyMRU/ApplyMRD process runs but does not action the changed rows. I can't figure out why at all or any workaround.
    You can easily reproduce this in 4.1.1 by creating a tabular form with the wizard selecting one column in the form. Then make the row selector colunn and your editable column conditional using the plsql expression 1=1. The form is displayed the just the same with these true conditions but it doesn't work. How weird is that?
    Rod West

    Rod,
    In your scenario the tabular form rendering engine is unable to place the hidden, internal tabular form status columns in your form, i.e. the columns that contain checksums, etc. The logic that places these columns looks for the last unconditional, visible column in your tabular form, and includes the hidden fields there. So you need at least one column that's always shown for this to work. This can be an otherwise empty column. I filed a bug (#13881803) for this, so we can look into improving this logic.
    Regards,
    Marc

  • Conditionally disable items in tabular form

    I built a tabular form . One of the column has dropdown called 'Type'. If users select type 'R' i want to disable 2 fields(text3 and text4) and in type is 'P' i want to disable other 2 fields(text5 and text6).
    I started off by including the foll. in the HTML header for page
    <script language="JavaScript1.1" type="text/javascript">
    function disableItem(pThis) {
    //alert(html_SelectValue(pThis));
    var l_soft = (html_SelectValue(pThis)== 'R');
    html_disableItems(l_soft,'TEXT3','TEXT4');
    </script>
    In the Column Definition of LOV, I added the onchange="javascript:disableItem(this);" for Element Attributes.
    The problem is, this code is disabling column header for TEXT3 and TEXT4 rather than disabling the fileds. Can someone help me to make this work.
    Thanks in advance.

    I'm using a similar thing in my app and it works fine. I have the disableFields() function in HTML header. Then in footer, I have something like:
    <script language = "javascript">
    if($x('type').value=="P" || $x('type').value=="R")
    {disableFields();}
    </script>
    Make sure the item named "type" is a select list with submit, and there is a page branch going to the same page. Also, in javascript, everything is case sensitive...make sure ur item names are in the proper case.

  • 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.

  • Tabular form condition type value of item / column in expression 1

    Hi
    Question 1
    I was wondering if anyone can help with the necessary syntax so that I can set a Condition Type for a column in a Tabular Form.
    What I'm trying to do is show or hide a column based on the contents of another column in the same row for instance show column DETAIL or DETAIL_READ_ONLY if column READ_ONLY is set to 'Y'
    Value of item / column in expression 1 = #READ_ONLY# or READ_ONLY (alas neither works)
    Expression 2 = Y
    I can set all the DETAIL or DETAIL_READ_ONLY columns to either hide or show at the same time by
    Value of item / column in expression 1 = P100_READ_ONLY (works well but lacks granularity)
    Expression 2 = Y
    Question 2
    Are Tabular Forms such that all fuctionality has to be global, what effects one column must be the same for all
    I know that Oracle prefers that developers don't use tabular forms but they are usefull for data visability when setting up related data in the same table.
    e.g. surveys, questionnaires etc apps the web was made for
    Thanks
    Derek

    Hi Sandro
    Thanks for replying
    The problem I have is Tabular Forms
    Detail Text Detail Read Only Read only
    Event 1a Event 1b Y
    Event 2a Event 2b N
    Event 3a Event 3b Y
    What I want it to look like is
    Detail Text Detail Read Only Read only
    ___________Event 1b__________ Y
    Event 2a_____________________ N
    ___________Event 3b__________ Y
    This would mean that the Text Field containing Event 2 could be updated but the Display Only fields containing Event 1 and Event 3 cannot be changed.
    The trick is to be able to mix and match data types for the same data because Tabular Forms columns don't have a conditional read only choice.
    Sorry about the rudimentary diagram, but its the old 80 / 20 rule =>20 percent functional
    Edited by: derekf on 4/02/2013 17:50

  • Tabular Form - Read only condition for certain users

    Is it possible to make a select list field in a tabular form read-only to certain users? Here's the situation:
    The tabular form lists the users who need to select "Approve" or "Reject" in that field (they are approving or rejecting an engineering change)
    I want all of them to see the approval/rejection of their team, but only have access to edit the select list associated with their record.
    Thanks in advance.
    Apex 4.0.0.00.46

    You could use either "authorisations" tab or "conditional display" for the relevant column attribute.
    Report Attributes->Column Attributes->authorisationsIt would be better to have some more detail about what you are trying to get (maybe a quick mock up of the form, for example) but, I can envision something along the lines of the following:
    For each approval/rejection field:
    1. Create an authorisation appropriate for access to to each approval/rejection field e.g. authorisation scheme "FOO"
    2. In the relevant fields column attributes, set the authorisation to "FOO"
    3. now create a read only "public" copy of the above field, using the "display as text (based on LOV does not save state)" - set the authorisation for this field as "{NOT FOO}"
    (if you don't want to use authorisations, you could build an equivalent using "conditional display" instead, which is basically the same thing, except column specific)
    The downside is of course that you're duplicating fields in your query, which creates a bit of redundancy. There may be better ways to achieve this (maybe you could make use of the APEX_ITEM api, for example) but this is fairly easy to set up IMO.

  • Refer to Tabular Form field in Condition of Dynamic Action

    I tried to filter on this topic but didn't come up with anything.
    Is there a way to refer to a field in a tabular form as a condition of a dynamic action?
    For example, I want to pop up a message (javascript 'alert') when the value of one field in a tabular form is changed, but only if another field for that same row meets a certain condition.  So let's say the field in the condition is XYZ.  So in the condition section, i would have PL/SQL Expression - XYZ IS NULL.  Something like that.  How would I refer to that XYZ field from my tabular form in the condition section of a dynamic action?
    Thanks in advance.
    John

    Thanks for your help on this.  I think going with the action being an 'execute javascript code' is a good approach.  So here is my situation - I have a tabular form.  I have 2 fields (among others) - SPECIES and WEIGHT.  The SPECIES is a select list in the tabular form.  The WEIGHT is a text box in the tabular form.
    To make this simple, let's say this is for only one species - SNSG.  If the person changes the select list to SNSG and the associated WEIGHT field is NULL, I need to pop up a message that says 'Fill in weight field if selecting SNSG'.
    So here is what I have:
    Event: Change
    Selection Type: jQuery Selector
    jQuery Selector: :.speciesClass
    Condition: In List
    Value: SNSG
    True Action: Execute JavaScript Code
    ** Here is where I am stuck: In the JavaScript code I need to this:
    If WEIGHT is null THEN:
    confirm('Warning: Enter weight if entering SNSG species.');
    I am not sure how to write that "If WEIGHT is null THEN" part in javaScript and be able to refer to the WEIGHT field associated with the SPECIES value I just changed in the tabular form.
    I hope that makes sense!
    I appreciate your help!!
    Thanks,
    John

  • Date format in a tabular form

    I can create a date field (with date picker) in a tabular form created manually. However, I cannot change the format to mm/dd/yyyy. I am using the wwv_flow_item.date_popup package. Thanks!

    our online doc would be a good place to start. try...
    http://htmldb.oracle.com/i/doc/mvl_api.htm#sthref1316
    ...for instance.
    regards,
    raj

  • Conditional display in a tabular form

    Hello,
    I've a tabular form with fields Cert Id, Cert Name, Cert Total & Comments. In this only 'Comments' is editable and all others are display only items. This form has 50 rows
    In this 'Cert Total', should either be a link or a normal text based on some conditions (Say, 'Cert Id' in (3,6,9) ).
    For 'Cert ID' 3,6 & 9, 'Cert Total' will be a link and for others it will not be.
    Similarly, 'Comments' should either be read-only or editable based on some conditions (Say, 'Cert Id' in (3,6,9) ).
    For, 'Cert Id' 3,6 & 9, 'Comments' will be editable and for other rows it will not be.
    When i include conditions for 'Read-Only', it gets applied to all rows and not really conditional. How to resolve this issue?.
    Thanks and Regards,
    Siva

    You could try to do it using javascript. It's a dirty approach, but worth a shot.
    Use Firebug to determine the IDs of Cert Id and Comments. Then loop through the tabular form, check the values of Cert Id in each row, and based on that, change the attribute of Comments, from read only to editable, and vice versa.
    For instance, lets say the ID of Cert Id is f03_x, and ID of Comments is f04_x.
    You need to do something like this:
    var tab = document.getElementsByName('f03');
    for (var i = 0; i < tab.length; i++) {
      var vRow = tab[i].id.substring(4, 8);
      var CertId=$('#f03_'+vRow).val();
      if (CertId=="3"){
      $('#f04_' + vRow).attr( 'disabled',false);
      else{
      $('#f04_' + vRow).attr( 'disabled',true);
    Hope this helps,
    Ana

  • How To Make A Tabular Form Field Conditionally Readonly

    Hello.
    I am using Apex 4.0.1. I've created a tabular form on the EMP table and have made the ENAME column a select list that is being sourced from a simple SELECT query like:
    select distince ename d, ename r from emp order by 1
    When a user selects "KING" as the value, I would like this ENAME field on this specific row in the tabular form to become readonly. If some other value is chosen from the ENAME drop down, then this ENAME field should remain "changeable".
    If the user clicks the "Add New Row" button on the form, a new row should be added to the bottom of the form with this ENAME field as "changeable". Only if the user selects the "KING" value from this ENAME drop down should this filed become readonly.
    Does anyone know how to go about doing this kind of conditional readonly on a tabular form field?
    Thank you for any help.
    Elie

    Hi Little Foot (I do like that name).
    Here's the link to my thread: "How to conditionally make a specific row in a tabular form readonly":
      Re: How To Conditionally Make A Specific Row In A Tabular Form Read Only.Hope this helps you as much as it does me.
    Elie

  • Manual Tabular Form Formatting Questions

    Hello, this is my first time using a tabular form and am now trying to tackle creating a manual tabular form. So, now I have some questions on formatting.
    1. Is it proper on this forum to lump several similar questions together or should these be separate postings?
    2. I have a hidden column that I do not want to display on the screen at all. However, I need access to the column later when saving. I am currently using the htmldb_item.hidden function to retrieve the field. This works. However, the column still displays but the value does not display. I then tried to uncheck the show attribute for the column to unchecked. Unfortunately, if this is not selected, when using the htmldb_application.g_f01 function, I would receive an error as if the column did not exist. How do I make the column totally hidden so that it does not display at all?
    3. I have a number column where I want the column to display in dollars (i.e. $100, 000). I tried to set the number format on the column in the report attributes. However, no luck. To retrieve the column, I am using the function htmldb_item.text to retrieve the column. I am not sure if I should be able to format the column in the report attributes or if the htmldb_item.text function has a parameter that I could use for formatting. Suggestions?
    4. Similarily, I would like to right justify this column. How is this accomplished?
    Thanks

    Hi everyone,
    Is there any way to not to display the hidden columns in the manual tabular forms,when we create the manual tabular form using htmldb_item.hidden.
    But need to refer that column in the process.
    In the wizard generated tabular form if the column is of type HIDDEN we dont see that column on the report.
    How can i achieve the same in manual tabular forms..
    Thanks

  • Conditionally highlight a column in a tabular form. How can this be done ?

    Hi,
    I am making a timesheet application where the rows are activities and the columns are the days of the month.
    Now I want to give the background of the weekend-days a different color. In the header of the column we have mon,tue,wed etc.
    So the color has to be changed conditionally (i.e. when the columnheader is sat or sun).
    How can I do this ? Probably it can be done using javascript, but I don't know how and where. I hope somebody can help me.
    We are using Apex 4.01. I also looked at the new option of dynamic actions, but can not find the appropiate event (page load?) and condition.
    Any help is appreciated.
    Rob

    >
    The detail part is a tabular form. (this is the part where I want to add the background or highlight).
    I use theme 16. Dark blue. Everything still 'out-of-the-box'.
    >
    OK. Take a look at using a custom report template with conditional column templates, or a custom named column template.
    To start with a custom report template with conditional column templates, make a copy of the theme 16 report template the detail form is currently using. Switch the form to use the new report template. Modify the new report template to use conditional columns.
    A custo named column template is more complex as none are provided out-of-the-box, so it has to be started from scratch.

Maybe you are looking for

  • Issue with Excel output in BI Publisher(OBIEE 11g)

    Hi All, I have designed my BIP report in RTF Layout, it contains pivot table( with one column and one row and a measure column).  when i export the report in Excel output format, i have 3 issues. i) I have fixed the pivot table row height as 13.75 pi

  • HTTP POST from ECC 6.0 to XI

    On ECC 6.0, I have an XMLstring that I need to post to an external URL.  I need this to go through XI.  It is actually an HTTPS post.  How can this be accomplished?  Can anyone point me in the right direction as far as how this would work in XI?  Her

  • I had projects edited in the trial version and when I bought FCPX I can't find them.  Can I get them back?

    I had a project edited and one I was currently editing in the Trial version, then when I bought FCPX I can't find it.  How can I get it back?

  • I changed my apple id now can't access iCloud

    I got hacked, the support center gave me new I'd with new email. Now I can't access iCloud because it is stuck on old Id, help please I don't want to lose everything from pictures to downloaded apps. How do I access iCloud with new email and Id? How

  • Spark List alternating ItemRenderer

    Hello, lets say that I what a Spark List display its content like the following: [Picture]  text text  [Picture] Is there a way to define two (or even more,e.g: as  template) custom ItemRenderer and toggle between them? How is that solved in the Data