2 conditional display for link column

Hello

I use Oracle Apex 5.0.2 and I have a report that contains a link to the column. The report contains various user_ids and shows some qualities of these users. I want to make the link in the column of conditional display based on two conditions.

1. If the user who is viewing the page is an administrator

2. If the user who visits the page is not an administrator, but sees its own information in this report.

The 1st condition, I know how to implement it using PL/SQL expression. I stored the role: APP_USER in a P1_USER_ROLE and check if P1_USER_ROLE = "administrator."

For condition 2, I know how to implement it using the "value of the element / the expression 1 column = Expression 2.» And I put just expression 1 #USER_ID # and expression 2 P1_USER ID (an element which stores: APP_USER).

I was wondering if there is a way to simultaneously implement these two conditions together. Thank you!

kevinsun91 wrote:

I use Oracle Apex 5.0.2 and I have a report that contains a link to the column. The report contains various user_ids and shows some qualities of these users. I want to make the link in the column of conditional display based on two conditions.

A "report"? Always tell exactly what you mean by this term: standard report, interactive, component report shared report query or some sort of tabular form?

1. If the user who is viewing the page is an administrator

2. If the user who visits the page is not an administrator, but sees its own information in this report.

The 1st condition, I know how to implement it using PL/SQL expression. I stored the role: APP_USER in a P1_USER_ROLE and check if P1_USER_ROLE = "administrator."

For condition 2, I know how to implement it using the "value of the element / the expression 1 column = Expression 2.» And I put just expression 1 #USER_ID # and expression 2 P1_USER ID (an element which stores: APP_USER).

Here are the two different requirements. The first is a restriction on the level of columns that can be implemented with the help of a condition on a column in report or a link. The second is a restriction on the level of the lines who cannot. It is not possible to report using #COL_ALIAS # overrides row values in the State of the reference column. It would be unwise to do so: how APEX can determine if the column should be included or not until all rows are retrieved?

The conditions of type 'values in the column"referred to value of element / column expression... are those generated by the tabular form wizard, which can be referenced in these expressions for run level row and process validation conditionally based on the submitted values. An example might be triggering a validation not Null in COMMISSION when JOB = 'SELLER '.

Conditional display of level line in the reports always is possible by including the necessary logic to the report using CASE or other expressions query.

I was wondering if there is a way to simultaneously implement these two conditions together.

It is not possible to do in a State of the column. It must be made in the report query using a CASE expression:

...
case
  when    :p1_user_role = 'Administrator'
       or user_id = :p1_user_id
  then
    ... --- Construct link URL
else
  null
end col_link
...

In other circumstances where it is possible to combine several conditions, use a PL/SQL Expression condition with several predicates and required Boolean.

Tags: Database

Similar Questions

  • Conditional display for interactive report columns

    The APEX 4, one of the options in the conditional displays for the columns was 'PL/SQL function body returning Boolean ". I had a function that returns a Boolean value, and I stuck my function call in the text like this:


    return DISPLAY_FIELD (: APP_USER( )

    "I don't see" ""PL/SQL function body returning Boolean " option 5 APEX. What should I use to call the same function to hide and show the column in the report?

    bobmagan wrote:

    Thank you. Using PL/SQL Expression will give best performance? Some of my reports have 80 + items, which must undergo this check.

    Probably not what you have seen. Have less well.

    And if I use PL/SQl Expression, what is the syntax I need?

    this:

    DISPLAY_FIELD(:APP_USER) = TRUE

    For functions that return a Boolean value, just use the function call:

    display_field(:app_user)

  • Interactive report, conditional display of the column binding

    Hello

    We have obligation to disable editing in case this field is 1 (1 = closed).

    Is it possible to disable it on interactive report.

    -case when status = 1 link in the column should be disabled (not visible) in order to prevent future changes on the payroll.

    SELECT payroll_no, status

    OF hr_payroll

    ORDER BY payroll_no DESC;

    I tried the link below, but it does not work in my case.

    http://nerd.NET.au/24-Apex-application-express/report-layout/92-conditionally-show-report-link-column-based-on-value-of-...

    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production

    Request Express 4.2.2.00.11


    Thank you in advance,

    Best regards, FM

    Status of the INCIDENT WHEN 'ACTIVE' = then


    '
    OTHER END null deactivate_employee.

    Of

    EMPLOYEES

    What exactly is the error you get? What HTML is displayed in the HTML source code?

    Just by looking at it, I would say that you need to remove the "/" before the f? p

    Don't forget not this way could cause problems if you start using the checksum, then you might want to look at the use of APEX_UTIL. PREPARE_URL to create your URL.

  • Conditional display of links - using dynamic application example "Actions".

    I have a similar to the one shown on the page need delete and refresh the application "Sample of dynamic Actions" on Apex.Oracle.Com.  However, in my case, the application must be selective.

    How can show us the cross out 'X' for people in the SALES Department.

    I tried this using a case statement to return the EMP_IDS for people in the SALES Department and NULL values for all others (in a new column called Sales_Emp_IDS.  My attempts failed but that each record in this new column shows red X if the emp in the sales department or not.

    Is this possible?

    Here are the changes I made to the EMPLOYEES area

    Adds the source code of the next column

    SELECT e.ROWID

    e.EMPNO ID

    case when 'd.dname =' SALES

    then e.EMPNO

    Another null

    end Sales_Emp_IDs

    e.EMPNO

    e.ENAME

    e.JOB

    m.ename MGR

    e.HIREDATE

    e.SAL

    e.COMM

    DEPTNO d.dname

    OF #OWNER #. E EBA_DEMO_DA_EMP

    #OWNER #. EBA_DEMO_DA_EMP m

    #OWNER #. EBA_DEMO_DA_DEPT d

    WHERE e.mgr = m.empno (+)

    AND e.deptno = d.deptno (+)

    Then on the report to the report ineractive attributes I copied the link column to delete settings

    Text link < img src = "" #IMAGE_PREFIX #red_x_16.png "alt ="Remove"> "

    Link attributes = id' #ID # "class ="delete" "

    Target URL

    URL                 #

    Thank you

    Gene

    Hi Gene Lowy,

    you see X for each column because you made conditional, only the column don't value not the link,.

    Need to add X in the query itself.

    1. remove this part of the column binding

    The link textDelete

    Link attributes = id' #ID # "class ="delete" "

    Target URL

    URL                 #

    2 change your query, added X in the query.

    Replace with your report query

    SELECT e.ROWID
        ,  e.EMPNO ID
        ,  case when d.dname='SALES'
                then 'Delete'
                else null
           end Sales_Emp_IDs
        ,  e.EMPNO
        ,  e.ENAME
        ,  e.JOB
        ,  m.ename MGR
        ,  e.HIREDATE
        ,  e.SAL
        ,  e.COMM
        ,  d.dname DEPTNO
    FROM #OWNER#.EBA_DEMO_DA_EMP e
    ,    #OWNER#.EBA_DEMO_DA_EMP m
    ,    #OWNER#.EBA_DEMO_DA_DEPT d
    WHERE e.mgr = m.empno ( + )
    AND   e.deptno = d.deptno ( + )
    

    3. change your Sales_Emps_IDs column-> column-> display attributes as-> change to Standard report column.

    Hope this helps you,

    Kind regards

    Jitendra

  • Conditional display for the links in the column?

    Hi all

    For a report, if you configure a column under the 'attributes of column' binding so that the report has a link to turn an edit form, is it possible to set a condition on this somewhere so that only certain LINES has an icon link (or text)?

    NT

    You can use a case statement?

    select case
              when column1 = 'x' then '' || column2 || ''
              else column2
           end
    from table
    

    Minh

  • display edit link based on a condition problem

    Hello

    Someone can such me how I can display the link change in every line of my report based on a condition... is the query on which my report is formed, as shown below

    SELECT COMPUTER_ID,
    COMPUTERNAME, BATCH, DESCRIPTION, OPERATING_SYS.
    PRIMADMIN_PHONE, PRIM_ADMIN, PRIMADMIN_CNID,
    SECONDADMIN_PHONE, SECONDARY_ADMIN, SECADMIN_CNID,
    RACK_NUM, MAINTENANCE_WINDOW from cts_masterserverview where ACTIVE_STATE = 'Active'.


    All these data are from several fields. If city and Andy see, probably they will remember... They helped me to change this option much... my problem is now
    I did the columns computer_id, which is the key in all other tables as a button change. And when the user clicks this edit button, data row respective are filled in the form, where the data can be changed...

    My requirement is now, at each change of line button should appear only if the user logged on as long as the PrimAdmin of this line... I am recovery PrimAdmin_CNID so that it can be compared against: APP_USER. All others should be able to view the data, but not modify... I am not able to figure out how I can conditionally display as I do for the other buttons.

    Can someone give an idea on how to do...


    Thank you
    Yvette

    Published by: user0012 on May 1st, 2009 13:25

    Hi David,

    Use the following query to conditional change the link,.

    SELECT
               CASE WHEN PRIMADMIN_CNID = :APP_USER THEN
                  ''
                ELSE
                         ' '
                END Edit
               ,COMPUTER_ID
               ,COMPUTER_NAME
               ,STATUS_ID
               ,DESCRIPTION
               ,OPERATING_SYS
               ,PRIMADMIN_PHONE
               , PRIM_ADMIN
               ,PRIMADMIN_CNID
               ,SECONDADMIN_PHONE
               ,SECONDARY_ADMIN
               ,SECADMIN_CNID
               ,RACK_NUM
               ,MAINTENANCE_WINDOW
               from cts_masterserverview
    where ACTIVE_STATE = 'Active'
    
    Add onclick= before "javascript above and Change the number 7 in the javascript to the page where you have edit form.
    

    Thank you
    Manish

  • Under certain conditions changing IMG link Standard report column

    Apex 4.0.2

    I have an application that includes photos of employees. I want to display a link to the column in a report of the employee who opens a page to manage the photos of a given employee. Worked well when using an image of compatible icon for all employees.

    But I want to do is have two images of icons. If a photo already exists. Another case a photo has not yet been added.

    I have included a select with the following CASE statement in the Source of my region.

    (CASE WHEN p.person_id IS NULLTHENIMG alt = "nophoto" src ="#WORKSPACE_IMAGES #nophoto.png" > "
    ON THE OTHERIMG alt = "photo" src ="#WORKSPACE_IMAGES #photo.png" > "
    END) "PHOTO".

    I believe it works. I ran in SQL Developer, and it produces the following-

    < img alt = "photo" src = "#WORKSPACE_IMAGES #photo.png" >

    < img alt = "nophoto" src = "#WORKSPACE_IMAGES #nophoto.png" >

    I created a link to the column as a COLUMN of REPORT STANDARD. I put the TEXT of the LINK to #PHOTO #. I put the binding TARGET, PAGE and EMPTY the CACHE settings. The column displays as empty. Firebug shows an empty TD.

    I remove the binding TARGET settings, PAGE and CLEAR the cache. The img is displayed correctly. Firebug shows the < img > properly. But of course, it is therefore more a link.

    I'm doing something wrong here. But do not know what it is.

    Walt K wrote:

    Apex 4.0.2

    I have an application that includes photos of employees. I want to display a link to the column in a report of the employee who opens a page to manage the photos of a given employee. Worked well when using an image of compatible icon for all employees.

    But I want to do is have two images of icons. If a photo already exists. Another case a photo has not yet been added.

    I have included a select with the following CASE statement in the Source of my region.

    (CASE WHEN p.person_id IS NULL THEN 'nophoto'
         ON THE OTHER 'photo'
    END) "PHOTO".

    I believe it works. I ran in SQL Developer, and it produces the following-

    photo

    nophoto

    I created a link to the column as a COLUMN of REPORT STANDARD. I put the TEXT of the LINK to #PHOTO #. I put the binding TARGET, PAGE and EMPTY the CACHE settings. The column displays as empty. Firebug shows an empty TD.

    I remove the binding TARGET settings, PAGE and CLEAR the cache. The img is displayed correctly. Firebug shows the correctly. But of course, it is therefore more a link.

    I'm doing something wrong here. But do not know what it is.

    That's because the behavior of standard report is to strip the HTML code of column values used in the expressions of HTML, links in the column and the report when the data is exported as CSV files. This is controlled by the attribute of HTML report of band, which by default is set to Yes. Change this setting to No. , and link images to be displayed.

    A solution with a better separation of concerns that are compatible with the Strip HTML and display text default settings is:

    1. Select only the image name in the query [ nvl2(p.person_id, 'photo', 'nophoto') photo is simpler than the previous CASE expression] and make this hidden column
    2. Add a link in the column to the State ('add column link' in the bar of tasks )
    3. Set the property of the new column binding Expression in HTML to#PHOTO#
    4. Specify the column link attributes as required

    Last suggestion would be to display thumbnails of the photos used here where they exist rather than an arbitrary generic image...

  • Conditionally display column report

    Hello

    I want to display the column report under certain conditions.

    I've created a report. There are several columns as. BILL BILL NO, DATE, METHOD OF PAYMENT, CHECK, CHECQUE DATE, THE TOTAL AMOUNT

    Now, I want to display only no. BILL, BILL DATE, MODE of PAYMENT, TOTAL AMOUNT when I select the MODE of PAYMENT in cash in the select an ITEM list

    And

    I want to display only BILL No., DATE of INVOICE, PAYMENT METHOD, CHECK number, CHECK DATE, TOTAL AMOUNT when I select the check PAYMENT METHOD in the select an ITEM list

    How can I conditionally display column of the report.


    Thank you
    Ed

    If you go to report attributes, you can specify conditions for specific columns.

    As you wait to conditionally display items based on what is selected in the selection list, you now have the page to refresh. For example, change the selection list to select the list to submit.

    Then you should be able to add a condition, according to the value of the selection list.

  • Apex 5 - where can I configure the link column for interactive report?

    Using APEX 5 on apexea.oracle.com

    I can't work where the attributes of column layout link for an interactive report using the interface of the designer of the Page?

    Thanks in advance

    PaulP

    Paul,

    the customer_id column is defined as a hidden at the Start column, and then there is no attribute of link for this column type. You must define the type 'Link' to get the attributes. There is no attribute of link on "Plain text" either.

  • Conditional display based on the value of line

    I have a report table with several lines on it.  I need to post a link to another page of user action if a value in the line corresponds to an attribute of the user's role, so they can act on the item.  Other display or update the document would not be able to run the link.

    The logic of nickname would go something like this:

    If user_role = role_this_line_item then

    display approval_link

    on the other

    Hide approval_link

    end if

    I know how to write pl/sql to return to the display of the correct state of true/false, but I can't find out how to reference the value on the display line.  I tried: role_this_line_item, role_this_line_item, #role_this_line_item # and none of them return one value other than false.  How to refer to an attribute on the current line of the decision to hide/show correct?

    Al

    Al Wondra says:

    I use V4.2.6 Apex in local installation of Oracle 11 g XE.  I tried with IE, Firefox and Chrome.  None has the conditional display.

    The report is a standard report created using the Apex report wizard.  I'm one of the columns (the ID of the line) changing to conditionally a link to a page to data entry.  I only need one line at a time to be the active link.  No line should have a link, if the user is not the role is required to perform this action.

    You have described my question exactly, it seems, that the conditional rendering is applied to the entire column.  I need that it is applied to specific lines.  Some lines (1) will be the active link.  All other lines does not display the link.  Is this possible?

    If you want the value of the ID to display for each row returned by the report, but only rendered as a link, if the condition is true? The values used in the State come "role_this_line_item" seems to be a value of a column in the report. "User_role" is also a column value?

    The simplest option is to modify the column attribute display as for the Standard report columnID column and conditionally generate the link in the report query:

    select
        ...
      , case
          when user_role = role_this_line_item
          then
            'where DATA_ENTRY is the 'data entry page' target number or alias of the page.

  • Conditionally display different images in a report

    Hello. I have a simple report. In a column of it, I have a link to another report. Display a picture using the column rather than display the value of the column, text of the link to the column binding property.

    I put in the link text field, a < img src = "#WORKSPACE_IMAGES #my_image.jpg" > tag.

    Works like a charm - on the report that the column displays the images of small icon that can be clicked take the user to another page.

    I would conditionally (based on the real value of the row of the column) show two different images. Think of a green arrow pointing at vs a red down arrow.

    How can I do?

    Or can I at least have the image above display under certain conditions and if the condition is not met, not display anything?

    I noticed that each page an attribute of the column in the report has the conditional display section. How does for a column?

    Thank you
    Boris

    Use an expression box in the query, for example

    ...
    case
      when x <= 50 then 'down.png'
      else 'up.png'
    end icon
    ...
    

    Change the link text field to

    <img src="#WORKSPACE_IMAGES##ICON#" alt=""/>
    
  • Link column shows no Images

    Hello

    I have a classic report with a column like this:

    Decode (gemischter. BEMERKUNG, null, "< img src =" #IMAGE_PREFIX #1px_trans.gif "> ',' < img src =" #APP_IMAGES #lupe_15.gif "(>') as BEMERKUNG"

    It works very well.

    If I try to add a link to the column for this column then reports shows no images. I use like text link #BEMERKUNG #. ' Display as ' has the value 'Standard report column.

    What's wrong?

    Kind Reagards,

    Mark

    Hello

    I think that's not good add HTML to the query.

    You can try to change your query to

    SELECT
    ..
    decode(orgu.BEMERKUNG,null,'1px_trans.gif','lupe_15.gif') as BEMERKUNG
    ..
    FROM
    

    And place the link column text

    
    

    Kind regards
    Jari

  • How to trigger a conditional display based on a dynamic Action without submitting the Page

    Hello

    Using Oracle APEX v4.2 on 11g, I have the following scenario and wanted to take other people on how to accomplish what I'm trying to do, i.e.:

    In region 1, I have a select item list page called P1_SELECTION, which contains selections from drop down to the user to choose from the following three: A1, B2 and C3

    In region 2, I have two checkbox elements:

    P1_CBOX1 I gave a conditional display of ' point value / Expression 1 column! = 2 expression, where Expression 1 = P1_SELECTION and Expression 2 = B2, so P1_SELECTION! = B2

    P1_CBOX2 I gave a conditional display of ' value of the point / column Expression 1 = Expression 2 where Expression 1 = P1_SELECTION and Expression 2 = B2, then P1_SELECTION = B2 .

    Use of dynamic Action on the evolution of the P1_SELECTION in region 1, how can I trigger the correct display of the checkbox in region 2, with the default view of the region 2 checkbox being P1_CBOX1, without submitting the entire page, just refreshing each of the elements checkbox to trigger the conditional display correct?

    For example, on the changes of P1_SELECTION = B2 then entire submission without page, only P1_CBOX2 is presented to the user in other P1_CBOX1 is displayed.

    Is this possible?

    Thank you.

    Tony.

    Hi Tony,.

    condition your dynamic action on P1_SELECTION with the following condition of javascript: this.triggeringElement.value = "B2".

    Add real actions that will show P1_CBOX2 and hide P1_CBOX1

    Add false actions and going hide P1_CBOX2 show P1_CBOX1

    Set the dynamic actions to fire on Page load

    Kind regards

    Erik-jan

  • How to create dynamic action of the link column in the classic report

    I have an apex page to display a modal window using jquery. In the modal window, I have a classic report with a column of link I want to capture its click event.
    I thought I could create a dynamic action with selection of type = jquery selector. Not sure if I need to do anything on the link column and do not know the syntax
    jquery selector. Would appreciate help or direction?

    Always zip code using .

    ...\
    

    tags as described in the FAQ.

    I created a region of report with the following query:

    Select empno, ename, 'SELECT' from emp
    where (ename like '%'||ltrim(rtrim(:P2_SEARCHPU))||'%'
    or :P2_SEARCHPU is null)
    

    There is no alias specified for the "SELECT" column, Oracle uses so the content of the column as a default alias. It comes

    'SELECT'
    

    Instead of

    SELECT
    

    The necessary jQuery selector would be:

    td[headers="\'SELECT\'"] a
    

    However the need to release the single quote everywhere is a ticking time bug. SELECT an Oracle reserved word means use it as any type of identifier is either too smart.

    You should always use a valid Oracle identifier as an alias explicit when a column contains a literal value or a complex expression:

    select
        empno
      , ename
      , 'SELECT' link_text
    from
        emp
    where
        (  ename like '%'||ltrim(rtrim(:P2_SEARCHPU))||'%'
         or :P2_SEARCHPU is null)
    

    APEX will use the column alias LINK_TEXT as the ID attribute of the column header and the cells in the column will reference it in their headersattributes. The jQuery selector is:

    td[headers="LINK_TEXT"] a
    
  • Set the line report radio group when it is clicked on a link column.

    Can Hi anyone help?

    I have a sql report with a group on the left radio record selector, it is used on click to fill out some additional fields in the page. I also have a column of link on the right side of the report that is used to display another page in popup. What I want is to synchronize the group radio selector when the link is clicked (i.e. Select and click on the current online radio group when the link column is selected).

    Page layout

    RG1 link pencil icon line details
    RG2 link pencil icon line details
    RG3 link pencil icon line details

    additional field 1
    additional field 2

    Report of the attributes - link URL column.
    JAVASCRIPT: modalWin2 ('f? p = & APP_ID.: #SHOW #: & SESSION.: SAVE_STATUS: no);



    I guess I can call another function of javascript in the URL from the link above, and somehow, I get the number of the line of the selected link. I think that if I can get that I can use the code below, where n is the row number of the selected link.

    JavaScript: -.

    var l_check = $x_FormItems ($x('EVENT_HIST1'), 'radio');
    checked l_check [n] = true;
    var l_click is l_check [n] ravishing ();.

    Thanks, Pete

    Pete:

    One way to resolve your condition is as below

    Modify the report query to be something similar to

    select
    apex_item.radiogroup(40,empno,null,null,'id=rg_'||rownum) rad,
    ename,
    '' link_column
    from emp
    

    And the JS function fx as

    function fx(emp,rgId) {
    $x(rgId).checked=true;     // checks radio on this row
    modalWin2('f?p=&APP_ID.:' + emp + ':&SESSION.::::SAVE_STATUS:N'); // popup page call
    }
    

    CITY

Maybe you are looking for

  • Cannot detach tab (uTube video) because it does not appear in the taskbar &amp; automatically plays

    After watching the two videos uTube yesterday, I clicked the option "pin tab" so that I could watch them again and closed the program. Now, I find that the sound of these videos is read automatically when I launch Firefox. Can't find TABS anywhere, s

  • in my device it says 'no device.'  What should I do?

    My iCloud used to work properly.  I haven't looked for a while, but the last time I did, find my phone worked.  Now it says my devices are offline. I have the computer and the iPhone. The two are connected and both are online on the wifi.   When I tr

  • What can I do to get the shader 3.0?

    Hello I Joust received: Lost Planet (the game)And I need a shader 3.0 to play...When I start the game a message pops up and say that I only have shader 2.0... What can I do to get the shader 3.0?The graphics card is: MOBILITY RADEON X600SE 256 MB Hyp

  • Hexadecimal, binary string.

    I have 33 bytes of data in hexadecimal format and do not know how he analysis of eleven pieces of 24 bits of binary data. I tried different configurations of hexadecimal string, number and Type of Casting, but have not yet been successful. I would li

  • 601 battery error

    I have a HP laptop. Model number g6-1b79dx. He said that there is an error in the internal stack at startup. Would that be about the long black of the battery which can be removed from the rear? If so, what type of battery/model would I need shop? Th