Make some lines in a table based on a condition.

I have a table based on a View object that displays four columns: Secure, Description, username and Date.

Currently it displays all the data based on the request of the VO.  When a user clicks on a line, the complete 'Description' is showed in a below - rich text editor where it can be updated and saved in the database.

I am facing a problem of application of security for the page.  The scenario is as follows:

If a logged-in user (defined in the flowrate range of Page), does NOT match the user name on a specific line (user name of the database), AND "Safe" is TRUE (in the case of the database, '1'), then the 'Description' should NOT be visible.

Looks like I can set the property 'Lent' on the specific Description column, but if it is not made and the user clicks on the line, the value of the Description always displayed in the below rich text editor.

What would be the best way to do this?  Is it possible to manually set the Description of the '< Secured >"(or something) in the table and the text of the editor if the condition is true? I hope that this is possible is because I want that line to be always present, just the Description hidden in both components.

This should be done by programming or can be done with an EL expression?

If by programming is the only way, how can I write logic for Page loading?

Thank you!

This can be done with an EL expression. You can write an EL expression for visible or properties readonly or disabled of the elements present within af: column.

The EL expression can look like the line is #{pageFlowScope.userName. The name}, click the line if you have written the code to display Description in your bean to manage programmatically you can access pageFlowScope username and apply the same condition.

Tags: Java

Similar Questions

  • Insert data into the same table based on certain conditions

    Hello. I'm new to this forum.
    I have to write a stored procedure to insert data in a table MYTABLE say, having a structure like:

    Col1 Col2 Col3... TotalInstallments CurrentInstallment PaidAmount MonthYear
    I have to insert all the data that it is in the same table (MYTABLE) except change some fields based on certain conditions:

    1. if PaidAmount > 0 & & CurrentInstallment < TotalInstallment then

    CurrentInstallment = CurrentInstallment + 1

    2. in the field MonthYear I have data ex. 01/2012, 11/2012 formate(month/year)...

    So, I have to insert data by incrementing the month and year. for example:

    If currentdata is 11/2012 next data will be 12/2012

    But following will be 01, 2013
    I have to select all records that belongs to the previous month (across the field MonthYear) and put the audit on each record selected and insert data and then turns them into table (MYTABLE) even.

    How to achieve that?

    Thank you.

    978184 wrote:
    Hello. I'm new to this forum.
    I have to write a stored procedure to insert data in a table MYTABLE say, having a structure like:

    Col1 Col2 Col3... TotalInstallments CurrentInstallment PaidAmount MonthYear
    I have to insert all the data that it is in the same table (MYTABLE) except change some fields based on certain conditions:

    1. if PaidAmount > 0 & CurrentInstallment

    CurrentInstallment = CurrentInstallment + 1

    2. in the field MonthYear I have data ex. 01/2012, 11/2012 formate(month/year)...

    So, I have to insert data by incrementing the month and year. for example:

    If currentdata is 11/2012 next data will be 12/2012

    But following will be 01, 2013
    I have to select all records that belongs to the previous month (across the field MonthYear) and put the audit & on each of the selected data record and insert then turns them into table (MYTABLE).

    You can do this way:

    This is not tested, but if you can provide the example of table structure and data (IN create table and insert scripts), it can be put to the test.

    insert into your_table
    (col1, col2, col3...current_installment, month_field)
    select col1, col2, col3..,
           current_installment +
           case when paidamount > 0 and current_installment < total_installment then
            row_number() over (
                                partition by column1, column2,.. columnn      -->You may choose partition if you want the
                                                                              --Increment of Current_installment to reset after particular combination ends
                                order by primary_key        -->Order the Increment, you may choose to add more columns to order by
                              )
          else
            0                                               --> if condition is not met, then Add 0
          end curr_installment,
          add_months(to_date(month_field, 'MM/YYYY'), 1) nxt_month
      from your_table;
    
  • Hide the line of adf table based on the transient attribute does not

    I have a JSF page where the user can insert new line in View object . this View object contains a transitional attribute which indicates whether or not the record is newly created.

    On the same page, I have a table adf which is bounded on the city view object . This table should show only newly created records. my approach is to use expression language of in the renditions property to hide all the other lines that are not newly created. I changed the render property for the columns of the table as: rendered="#{row.bindings.RowStatus.inputValue eq'new'}" , but the table does not show anything.

    Then, I tried to change the made not for the column property, but to the outputText inside the same way. It worked, but the problem is that the blank line is always on display.

    So, basically because I do not hide the entire line, instead I'm hiding the text in the lines and lines with spaces empty is still on display in the page aside.

    The Table of JSF page where the made property is applied on outputText inside the column:

    <af:table value="#{bindings.UplodedFilesView1.collectionModel}" var="row"
      rows
    ="#{bindings.UplodedFilesView1.rangeSize}"
      binding
    ="#{CreatSR_UserBean.fileTable}">

      
    <af:column sortProperty="#{bindings.UplodedFilesView1.hints.FileName.name}"
      headerText
    ="File Name" id="c1">

      
    <af:outputText value="#{row.bindings.FileName.inputValue}" id="it1"
      rendered
    ="#{row.bindings.RowStatus.inputValue eq'new'}"/>

      
    </af:column>

      
    </af:table>

    I use Jdeveloper with ADF technology 11.1.2.3

    Thanks Timo,

    You are right. Its to late to hide lines after stamping in the row set. I solve the problem by filtering the view object, based on the transitional attribute in the section of liaison page. The steps as follows: (assuming that the object from view with the temporary attribute has been created, and the transient attribute contains the filtered values)

    1. Drag the view object on the page and also make the Table (in my case it might otherwise listen)
    2. On the page, go to the connection tab.
    3. Double-click the object desired in the links column.
    4. New window will appear titled with (change the binding tree)
    5. Check the option (enable filtering)
    6. Select the (filter attribute) and (filter value) for the selected filter attribute.
    7. Select (Display attribute) you want to appear in the page.
    8. Press OK
  • How to upgrade a selection one line of the table based on values in another table when there is exactly one matching entry and negligence if there is more than a football game

    Hello

    I'm trying to achieve the following objectives:

    1. in table A, select rows based on the values in column 2. something like SELECT * FROM TABLE A WHERE (COLUMN2 = 'X' or Column2 IS NULL)

    2 and these values selected, I want to update Column3 from Table A if TableA.column1 = TableB.column1, but only if there is exactly one game. If there are multiple matches, column 3 of the table article updated.

    That's what I've tried so far.

    UPDATE TABLE_A

    SET

    TABLE_A.COLUMN3 = (SELECT COLUMN3 OF TABLE_B

    WHERE ((TABLE_B.COLUMN1 = TABLE_A.COLUMN1) AND ( TABLE_B.COLUMN1 IN (SELECT Column1 FROM TABLE_B GROUP BY COLUMN1 , HAVING COUNT (*) = 1)))

    WHERE EXISTS (SELECT * FROM TABLE_A)

    WHERE ((TABLE_A.COLUMN2 = 'X' OU TABLE_A.COLUMN2 = 'Y') AND (TABLE_A.COLUMN4 IS NULL OR TABLE_A.COLUMN4 = ' ')));

    More details on my DB environment:

    Version Info:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production

    PL/SQL Release 11.2.0.4.0 - Production

    Toad, but, depending on whether the query updated all lines. I would really appreciate if someone could tell me how to fix my request.

    Thanks in advance.

    Exists it predicate in the block of update will be set to true if there is at least one row in table_a where column2 is X or Y and column4 is null or a space. You need to correlate exists it with the outer query query (I'm guessing on column1) to get the result I think you want.  However, who would update all rows in table_a who meets the criteria, there is a corresponding row in table_b, affecting Column3 lines form null not matched or not.  (Again), I'm guessing that's not your intention.  If you only want to update the lines in table_a which have a corresponding line in table_b and meet the other predicate, then I think you want something more like:

    Update table_a

    Set table_a.column3 = (select column3 of table_b

    where table_b.column1 = table_a.column1 and

    Table_B.Column1 in (select column1 from table_b

    Group by column1, having count (*) = 1))

    where ((table_a.column2 = 'X' ou))

    table_a.Column2 = 'Y') and

    (table_a.column4 is null or)

    table_a.column4 = ' ')) and

    table_a.Column1 in (select column1 from table_b

    Group by column1, having count (*) = 1)

    John

  • insert into a final table based on a condition

    Hello
    create table table1(invoice_number varchar2(4), covg_date date, employee_number varchar2(5),
     service_option varchar2(2), FEES VARCHAR2(5), AMOUNT NUMBER(9,2));
     
    insert into table1 values('1','01-JUL-2011','11','8','F1,F2',100);
    insert into table1 values('2','01-JUL-2011','12','2','F1,F2',110);
    insert into table1 values('3','01-JUL-2011','13','9','F1,F2',120);
    insert into table1 values('4','01-JUL-2011','14','3','F1,F2',130);
    commit;
    
    create table table2(invoice_number varchar2(4), covg_date date, employee_number varchar2(5), 
    service_option varchar2(2),FEES VARCHAR2(5), AMOUNT NUMBER(9,2));
    
    insert into table2 values('1','01-JUL-2011','11','88','F1,F2',100);
    insert into table2 values('2','01-JUL-2011','12','2','F1,F2',110);
    insert into table2 values('3','01-JUL-2011','13','9','F1,F2',122);
    insert into table2 values('4','01-JUL-2011','14','3','F1',130);
    insert into table2 values('4','01-JUL-2011','15','3','F1',130);
    commit;
    
    create table final_table(insert_type varchar2(1),invoice_number varchar2(4), covg_date date, employee_number varchar2(5), 
    service_option varchar2(2),FEES VARCHAR2(5), AMOUNT NUMBER(9,2));
    We need to insert in final_table based on the differences between table1 and table2. The condition for this is:
    For example: for a given employee number (11) for a covg_date(July-2011) given, if there is at least a difference in any value of the column that is in this case the service_option (8.88)...
    I need to insert record from table1 into final_table with insert_type as 'ELDERS '.
    and insert record of table2 in final_table with insert_type as 'NEW '.

    Same employee number 14, there is a difference between column fees and I should insert as in the example above
    Same employee number 13, there is a difference between the column AMOUNT and I must insert as in the example above.

    For example employee number 15, there is no record in table1 but found in table2 and which will be inserted as it is...

    What my idea was to go through separate employee_number, covg_date in table1 and check every value in table2 to the same disease and insert into final_table...

    But if there is a better option as insertion directly using select clause or a sort of direct insertion without loop...

    Thanks for the help in advance

    Maybe a modified version of something like this:

    INSERT INTO final_table
    ( insert_type
    , invoice_number
    , covg_date
    , employee_number
    , service_option
    , fees
    , amount
    )
    SELECT insert_type
         , invoice_number
         , covg_date
         , employee_number
         , service_option
         , fees
         , amount
    FROM   (
         SELECT invoice_number
              , covg_date
              , employee_number
              , service_option
              , fees
              , amount
              , 'OLD' AS insert_type
         FROM   table1
         MINUS
         SELECT invoice_number
              , covg_date
              , employee_number
              , service_option
              , fees
              , amount
              , 'OLD' AS insert_type
         FROM   table2
         UNION ALL
         SELECT invoice_number
              , covg_date
              , employee_number
              , service_option
              , fees
              , amount
              , 'NEW' AS insert_type
         FROM   table2
         MINUS
         SELECT invoice_number
              , covg_date
              , employee_number
              , service_option
              , fees
              , amount
              , 'NEW' AS insert_type
         FROM   table1
           )
    WHERE  employee_number = :emp_number
    AND    covg_date       = TO_DATE(:date_string,'MM/DD/YYYY')
    ;
    
  • How to get the columns of the table based on different conditions in one column?

    Hello

    I have two sql queries-

    Select sum (col1) sum1 Tab1
    where join_date > (sysdate - 1).

    Select sum (col1) sum2 of Tab1
    where join_date > (sysdate-4)

    I need to use a single query to get sum1 and sum2 data in a single line.


    Can someone help please how?

    Like this?
    
    select sum(case when join_date > (sysdate - 1) then col1 else null end) sum1
         , sum(col1) sum2
      from tab1
     where join_date > (sysdate - 4)
    
  • Get the multiplication of values in column on an attached table based on the condition

    The title was the best I could find to explain my question, I do not think that it does help. in any case, I have two tables:

    CREATE TABLE YEARLY_RATES

    ( RATE_YEAR NUMBER(4,0),

    RATE NUMBER(6,4)

    );

      CREATE TABLE PERSON_ACCOUNT

    ( PAID_YEAR NUMBER(4,0),

    PAID_AMOUNT(10,2)

    );

    I need select PERSON_ACCOUNT. PAID_YEAR, PERSON_ACCOUNT. PAID_AMOUNT, PERSON_ACCOUNT. PAID_AMOUNT * multiplication of the YEARLY_RATES. RATE WHERE YEARLY_RATES. RATE_YEAR > = PERSON_ACCOUNT. PAID_YEAR. So for example if I have the following data in PERSON_ACCOUNT

    PAID_YEAR|PAID_AMOUNT

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

    2006   2150.69

    2007   3290.40

    2008   3000.35

    and YEARLY_RATES tables

    RATE_YEAR|RATE

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

    2006   1.067

    2007   1.208

    2008   1.057

    Then I should be able to have the following result:

    PAID_YEAR|PAID_AMOUNT|INDEXED_AMOUNT

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

    2006    2150.69    2150.69*1.067*1.208*1.057

    2007    3290.40    3290.40*1.208*1.057

    2008    3000.35    3000.35*1.057

    with

    yearly_rates as

    (by selecting RATE_YEAR 2006, double the RATE of 1.067 in union all the)

    Select 2007,1.208 from all the double union

    Select double 2008,1.057

    )

    indexed_rate Select rate_year, rate, exp (sum (ln (rate)) (order by rate_year desc))

    of yearly_rates

    RATE_YEAR RATE INDEXED_RATE
    2008 1,057 1.05699999999999999999999999999999999999
    2007 1,208 1.27685600000000000000000000000000000001
    2006 1,067 1.36240535200000000000000000000000000001

    Concerning

    Etbin

    model clean air solution

    Select rate_year, indexed_rate

    of yearly_rates

    dimension of the model by (rate_year)

    measures (rate, 1 indexed_rate)

    rules

    (

    indexed_rate [any] rate_year desc = order rate [cv ()] * nvl (indexed_rate [cv () + 1], 1)

    )

    RATE_YEAR RATE INDEXED_RATE
    2006 1,067 1.362405352
    2007 1,208 1.276856
    2008 1,057 1,057

    Update of the first solution proposed by ChrisHunt


    What about recursive with

    with

    yearly_rates as

    (by selecting rate_year 2006, double the rate of 1.067 in union all the)

    Select 2007,1.208 from all the double union

    Select double 2008,1.057

    ),

    indexed_rates (rate_year, spleen, indexed_rate) as

    (select rate_year, indexed_rate

    (select rate_year, rates, indexed_rate, row_number () over (order by rate_year desc) step

    of yearly_rates

    )

    the stage where = 1

    Union of all the

    Select yr.rate_year, yr.rate, ir.indexed_rate * yr.rate

    to indexed_rates ir,.

    yearly_rates year

    where yr.rate_year = ir.rate_year - 1

    )

    Select rate_year, indexed_rate

    of indexed_rates

    RATE_YEAR RATE INDEXED_RATE
    2008 1,057 1,057
    2007 1,208 1.276856
    2006 1,067 1.362405352

    Post edited by: recursive Etbin with solution added

  • How to display the image in the table based on certain conditions

    Hi all

    I have a table of search results which has a column as error.
    The data that appears in this column after research is 1 or 0.

    I want to display an image of success for "1" and a picture of error to the '0' value in the table.

    How to get there?

    TIA,
    Bob

    You must use the af:switcher component - http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_switcher.html

    For example








  • How can I delete pages in a 3D table, based on the conditions in two columns

    Given the enclosed 3D range I would delete any page that has BOTH 3 900002 chain in the second column AND the string "00 00 00 00 00 00 00 00" in column 5. Any ideas on how to do this?

    Thank you.


  • deactivation of line in af:table

    Hello
    I want to disable the lines of af: table based on certain conditions. I do this with the following help:
    Disabled = "#{myBean.blnDisable}". " I use the tag < af:tableSelectMany > under < af:table >.

    When I check the line and click on button 1, all lines of af: table get disabled. When I click on the button 2 (to perform an operation), check-in check (checked earlier in the rows disabled) gets disappear.

    Could someone help me please. I want to check-in to check.

    You can use an expression based on a flag that is unique for each row in the related table and which is equivalent to true or false, for example: -.

    Disabled = "#{(boundTable.strSelectEnabled=='N')} '"

    It worked for me.

  • 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

  • Hide an entire column based on a condition

    Hello

    I'm trying to completely hide a column in a table based on a condition, if the column was not present. I wrote two conditional regions for the header and data, but it is still showing up. Any help would be appreciated. The XML model RTF, the PDF generated and the output I'm looking is attached. Thank you.

    Please check your email that I have forwarded to update the model.

    I counted occurrences of January in your xml and formed the condition based on the fi

    MONTH

  • Add lines to insert a table based on the box and the values in the LOV

    I have two options (1) the list of values (2) box (2 values) .the are required field.when I click on create lines button and then insert table/slot (fire) form of table, based on my selected lov values (for example 3 selected then 3 rows only) and the value of the checkbox.

    If I select 3 values LOV and then check the box 1

    SEQ / / desc box SL (1)
    1DESC 11
    2DESC 22
    3DESC 33

    If I select 5 values LOV and then check the box 0

    Header 1 / / desc box SL (0)
    1DESC 10
    2DESC 21
    3.. 5DESC 3... 52.. 5

    my workspace: ram_r & d

    username/password: aramani/apex

    App: https://apex.oracle.com/pls/apex/f?p=72423:1:102019883635814:NO

    Thank you

    RAM

    It has achieved the goal, thread:multi line table based on LOV

  • insert into the table based on the difference in line (or using less)

    Hello

    Oracle Version: 11g

    Operating system: Solaris 10.

    I was wondering if it is possible to insert data in a table based on the operator 'less' Please?

    We have a very large table in a database, we moved to a different database. The table is cleared by a line for a certain range of dates, and we wondered if it is possible to insert this line of data in the remote database using the difference of rank between the two tables.

    Here's the query that we are running:

    SELECT ID , TO_CHAR (creation_datetime, 'yyyy-mm-dd')
    from TABB10 
    where TO_CHAR (creation_datetime, 'yyyy-mm-dd')='2014-03-18' 
    minus 
    SELECT ID , TO_CHAR (creation_datetime, 'yyyy-mm-dd')
    from TABB10@TABB_LINK.APDB00 
    where TO_CHAR (creation_datetime, 'yyyy-mm-dd')='2014-03-18'
    

    TO_CHAR (CR ID

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

    2.4111E + 17-18 / 03 / 2014

    Any ideas please?

    Thank you

    If I don't get me wrong, you can insert as below

    INSERT INTO REMOTE_TABLE@DBLINK

    SELECT ID, TO_CHAR (creation_datetime, "yyyy-mm-dd")

    of TABB10

    where TO_CHAR (creation_datetime, 'yyyy-mm-dd') ='' 2014-03-18

    less

    SELECT ID, TO_CHAR (creation_datetime, "yyyy-mm-dd")

    of TABB10@TABB_LINK. APDB00

    where TO_CHAR (creation_datetime, 'yyyy-mm-dd') ='' 2014-03-18

    Concerning

  • divide the table based on the number of lines

    Hello

    I am trying to split a table based on the number of lines and then treat.
    Say I have a TEST_XXX table that contains 50 lines, what I would do is.
    to access multiple lines of 10. How can we achieve this?

    What I thought is, once the table is created and the line are filled.
    Add a new column to the table and perform a procedure that inserts of 1 to 10 first lines
    and 2 to 10 lines and 3 to 10 next ranks... etc. Based on this, that we can treat
    the first set of lines then play next or etc...

    is there a better way to do it?

    Code to create the table:
    CREATE TABLE TEST_XXX
    (
      A_ID   VARCHAR2(10),
      B_ID   NUMBER,
      c_ID   VARCHAR2(10),
      D_ID   NUMBER
    )
    Code to add lines:

    DECLARE
    BEGIN
      FOR I IN 1..50
      LOOP
          INSERT INTO TEST_XXX VALUES('ABCDE',123,'ZYXWV',321);
      END LOOP;
      COMMIT;
    END;
    The original problem is, I have a huge table, and I write a sql query to process,
    When I treat him by selecting all the values in the table, it is very slow.
    But when I have treat small Coulon (say 100 rows), it works very well.
    That's how I got the approach described above in mind.

    You can use NTILE.

    See:
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/functions101.htm#SQLRF00680
    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:47910227585839

Maybe you are looking for

  • vibrations of the keyboard while typing

    Hi I have no vibration when typing and would like to have that. I can't do it. How can I activate the vibrating keyboard?

  • ListField character press

    Hi, this is my first post, and I would like to ask a question about ListField. How to make a listfield, who has similar function to ChoiceField: character presses will move to the first letter of the next item beginning with the character. Thanks in

  • 2015 first CC metadata export

    I started a project to create on a personal computer. In the project, I created metadata tags custom in the reports of the camera that gave me on the set. Basic text information: scene, Take, Clip, rate. I duplicated the project file to open it on my

  • new license

    I recently had to change hard drives.  The installation program will not take my serial number.  I think I used my licenses on my other computer and a change of previous hard disk.  How can I get a new license?Thanks in advance.

  • Latest version of Photoshop CC fails on Windows 10

    Hi, since update Photoshop CC in December, he started working very very bad... when switching between different tools, it becomes unresponsive for a few seconds (3-5 seconds)... If you press CTRL + ALT + DELETE to bring the the Task Manager to the to