Set a value of Application using PL/SQL element

I have a question of enforcement F101_MAINTENANCE it needs is the value set according to the values in a table. The value would be a piece of HTML code.

Ideally this would be verified every time that a page is loaded and the value is printed on the screen on every page.

Is there a way to do this?

I use 4.0.2 on 11g

Hi Craig,.

To set an application using PL/SQL item value:

// some examples
:F101_MAINTENANCE := 'some value';  // a varchar
:F101_MAINTENANCE := 123;           // a number
:F101_MAINTENANCE := SYSDATE;       // a date

The varchar 'some value' could be HTML and could be HTML with the values of a table concatenated, like this:

DECLARE
   l_ename VARCHAR2(100);
BEGIN
   SELECT ename INTO l_ename
   FROM emp
   WHERE empl_id = 123;

   :F101_MAINTENANCE := 'Empl name: ' || l_ename || '';
END;

(Take the space out of the style attribute - it's just there because the forum keeps style stripping attribute when displaying the post values.)

This could be in a process of page to fire when the page loads. If she has to work for all pages, it could be in an application process set on fire during the loading of each page. If it should work for all but a few pages, you can place the code in an application process on fires during each page load, but then put a condition on it so it is not fire for specific pages.

Now that the application is defined, it can be used on the pages where you need. If it is used for display only, remember to not escape special characters, or else it will just display the HTML rather than surrender. And if the value of the element of the application only needs to be set in PL/SQL, be sure to set the protection of session state so that he can "Restricted - cannot be resolved in the browser.

Hope this helps,
John

If you find this information useful, please indicate the 'useful' or 'correct' post so that others benefit. *

Tags: Database

Similar Questions

  • How to set the value of QUERY using PL/SQL process?

    Hello

    I use APEX 4.2...
    How to set the value of the REQUEST using process of PL/SQL which lies before the header - where the value of the REQUEST should appear on the URL?

    Kind regards
    Fateh

    You cannot set a value of demand in a PL/SQL block. You can run a PL/SQL block on a request which is the id of a button for example.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Apress.com/9781430235125
    http://Apex.Oracle.com/pls/Apex/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • Setting a value to variable using an sql and javascript

    Hello

    I'm trying to be a value of variables using javascript and sql. The code is as below:


    < script >
    function getDueDate() {}
    function getVal (item) {}
    If ($x (point) .value! = "")
    Return parseFloat ($x (item) .value);
    on the other
    Returns a null value.
    }
    $x('P26_DUE_DATE').value = select sysdate + $x ('P26_PAY_TERM') of the double
    }
    < /script >

    Can this be achieved?

    Hello

    JS and SQL are 2 different languages, so you can't do what you want to do using this script. The good thing is that you can still do so using JS.

    $x('P26_DUE_DATE').value = select sysdate + $x ('P26_PAY_TERM') of the double

    the "Select Sysdate" try to use the date JS Object (http://www.w3schools.com/jS/js_obj_date.asp) to add dates together.

    Martin
    -----
    [http://apex-smb.blogspot.com/]
    [http://apex.stackexchange.com/]

  • How to set the value of the point of application using pl/sql in the application process

    Hi guys,.

    I want a global variable (application point) whose value will be set to start when a user logs on to the application. The value will be retrieved from the database by using a sql query. I don't exactly know the syntax to set the value of the point of application in the application process. Also, I want to know what type of enforcement process should I use to set the value of the point of application, when a user starts a session. The value of the point of application varies from one user to the user.

    Help, please.

    I use apex 4.2

    Kind regards

    Waqas

    You can use the application element as a link with his name. That is to say. your point of application is named G_MY_APPLICATION_ITEM, then you can / set of access using: G_MY_APPLICATION_ITEM.

    For example

    BEGIN

    -assign as a variable

    : G_MY_APPLICATION_ITEM: = 'LARRY ';

    --

    -use in a SQL statement

    SELECT WHATEVER_COLUMN

    IN: G_MY_APPLICATION_ITEM

    FROM MY_TABLE

    WHERE USERNAME =: APP_USER

    ;

    END;

    Peter

  • Set the 'Not available' application via the SQL statement

    Hi, I am trying to automate the deployment of applications and wonder if anyone knows how I could define the "Unavailable" via a SQL script application. In the views of the APEX_030200 scheme, there is a view called "APEX_APPLICATIONS" with "AVAILABILITY_STATUS" and "UNAVAILABLE_TEXT" columns What I want to do is to run a statement that sets the 'Not AVAILABLE' application before you run the import script.
    Thanks, J

    Hello:

    You can use the 'wwv_flow_api' to set the State of the application

    DECLARE
    ws_id number;
    BEGIN
    select max( workspace_id) into ws_id from apex_applications ;
    wwv_flow_api.set_security_group_id(ws_id);
    
    wwv_flow_api.set_flow_status (
        p_flow_id => :app_id,
        p_flow_status => 'UNAVAILABLE',
        p_flow_status_message  =>'Application being updated...')
        ;
    end;
    

    The valid values for p_flow_status are
    'AVAILABLE. '
    "AVAILABLE_W_EDIT_LINK,"
    "AVAILABLE_W_INLINE_EDIT,"
    "DEVELOPERS_ONLY,"
    "UNAVAILABLE_URL,"
    "UNAVAILABLE_PLSQL,"
    "RESTRICTED_ACCESS,"
    "UNAVAILABLE".

    CITY

  • Cannot assign point values to application using HREF

    Hello

    calling application request process with the link href = DOWNLOAD_EXCEL and assigning values to application T_EXCEL_NAME, P180_EVENT_ID item.

    Here is the HREF link that I wrote could not assign values to elements of applications T_EXCEL_NAME, P180_EVENT_ID.

    the two item application values pass as null.

    can someone please check in below mentioned URL and suggest me what changes need to be made to assign values to these elements.

    Select ' < a href = "f? p = & APP_ID.:110 :'|| : APP_SESSION |': D OWNLOAD_EXCEL: & DEBUG.:T_EXCEL_NAME, T_EVENT_ID:test,' | E.EVENT_ID |' "> ' | ' < img src =" #WORKSPACE_IMAGES #ics.jpg "" height = "22.5" width = "30" > "|" "< /A > 'like 'execl_file'"

    OF EVENTS;

    Thank you and best regards,

    gwendoline says:

    If I use link above

    It is showing below error

    Try to save point T_EXCEL_NAME in session state when the treatment of show, no internal protection.

    Contact your administrator for the application.

    This is because the Session State property about to T_EXCEL_NAME application has Restricted - can not be set to the browser. See the documentation and online help for this property for more information about the implications of this change.

  • Set the value from one point to another element at run time

    Hello

    I use APEX 4.2

    My question is on the same page, we form another, I create two region region html

    I'm filling out the form and press on create button then the value created by primary key must be in

    page HTML element area (whereas it only displays in editable form mode)

    I want after click on create region html button get refreshed and value should appear displaying the only element of the page

    any idea?

    Thank you

    go

    Hi, go,

    I modified your page, I just created the sub process of PL/SQL after the presents.

    Start

    Select empno in: P3_EMPNO from emp where ename =: P3_ENAME;

    END;

    It assigns the value to point P3_EMPNO and session as well. Initially the P3_EMPNO point value is not inserted into the session.

    Please check and let me know.

    Thank you

    Lacombe

  • retrieve the value of xml in PL - SQL elements

    Hello

    I invoke the PL/SQL WSDL and WSDL is back after the release.

    + <? XML version = "1.0" encoding = "UTF-8"? > +.
    + < SOAP - ENV:Envelope +.
    xmlns:SOAP - ENV = "http://schemas.xmlsoap.org/soap/envelope/".
    xmlns:SOAP - ENC = "http://schemas.xmlsoap.org/soap/encoding/".
    container = "http://www.w3.org/2001/XMLSchema".
    xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" >
    + < SOAP - ENV:Header +.
    xmlns:SOAP - ENV = 'http://schemas.xmlsoap.org/soap/envelope/' > < / SOAP - ENV:Header > < SO
    AP - ENV:Body >
    + < ser-root: soapIntefraceASVOutput +.
    xmlns:SER - root = http://eai.corpit.microsoft.com/microAccountValidation/provider/Acc «»
    ountStringValidator' > < acctStringValidateOutput >
    + < 112 > status < / status > +.
    + < message > in +.
    account segment is valid
    code < / message > < / acctStringValidateOutput > < / ser-root: soapIntefraceASVOutput > < / SOA
    P ENV:Body >
    + < / SOAP - ENV:Envelope > +.

    I tried to analyze this XML in my PL/SQL block and wanted to retrieve a State <>and < message > element Value.

    Please help me on this.

    Thank you
    AB,

    ABA says:
    Since it is a generic procedure, and we do not know the number of output items... Is it possible to retrieve all the elements of output using pl/sql (without knowing the name of the output items).

     with tab
            as (select xmltype.createxml('
      
     
     
     
        
           
               112
               Invalid account segmentcode
          
        
     ')
                          xml
                 from dual)
     SELECT column_value
       FROM tab t ,
      xmltable( xmlnamespaces('http://schemas.xmlsoap.org/soap/envelope/' AS "SOAP-ENV",'http://eai.corpit.microsoft.com/microAccountValidation/provider/AccountStringValidator' AS "ser-root"), 'data(//SOAP-ENV:Envelope/SOAP-ENV:Body/ser-root:soapIntefraceASVOutput/acctStringValidateOutput/*)' passing t.xml )
    

    Ravi Kumar

  • Assigning value Varibale Global using the SQL statement

    Hi OTN Experts.

    CREATE OR REPLACE PACKAGE start_discussion
    AS
    g_variable VARCHAR2(10)  := (SELECT tag FROM fnd_lookup_values WHERE lookup_type = 'LEDGER No. 1')
    PROCEDURE start_procedure_one
    IS
    BEGIN
    SELECT * FROM start_table_one
    WHERE code = g_variable
    .
    
    .
    .
    
    PROCEDURE start_procedure_two
    IS
    BEGIN
    SELECT * FROM start_table_two
    WHERE code = g_variable
    .
    
    .
    
    .
    PROCEDURE start_procedure_three
    IS
    BEGIN
    SELECT * FROM start_table_three
    WHERE code = g_variable
    
    

    Kindly inviting you to watch above code and advise if I can use this kind of functionality in oracle.

    I tried but its gives error below when compiling the code.

    DECLARE
      v_value VARCHAR2(40) :=
      (SELECT tag
      FROM fnd_lookup_values
      WHERE lookup_type = 'LEDGER'
      );
    BEGIN
      dbms_ouput_.put_line(v_value);
    END;
    /
    
    
    PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
    

    Kind regards

    Shivaya

    Well, kind of, but not really.

    Who compiles or the other.

    something like this maybe:

    create or replace package foo

    as

    procedure start_procedure_1;

    end;

    /

    create or replace package body foo

    as

    g_variable varchar2 (10);

    procedure start_procedure_1 is

    Start

    null; / * put what here * /.

    end start_procedure_1;

    Start

    Select to_char (sysdate, 'yyyy') in the double g_variable;

    end foo;

    /

  • How to use PL/SQL to create dynamic action to set the value of a selection by another list?

    Hello

    I would like to know how to use PL/SQL to create dynamic action to set the value of a list of selection by another selection list.

    1.PNG

    I wish can create dynamic action to manage the two above the Room select list (: P9_ROOM) and building (: P8_BUILDING).

    When you select "1074" in the bathroom, building highlights like "BRM BLD 5"

    When you select 'Area of the black box' in the room, building must assign the value "7 BLD BRM"

    When the room is Null, building should also be Null.

    I thank you,

    Alice

    I forgot to mention, for the PL/SQL Code, because you are working with items in the selection list, the return values are different from the display on your LOV values, you must instead use the return values.

    Thank you

    Erick

  • Set the values in cascade LOV (Skillbuilders SuperLOV used)

    Hello

    I install a simple page with a SuperLOV cascading.

    I'm trying to set the values of the first and the second SuperLOV based on the selection of a report.

    After the selection, a javascript function is called that sets the variable state and browser session P1_EMPNO

    function editRecord(pValue) {
       //set session state of P1_EMPNO to use in pl/sql query
       var a=new htmldb_Get();
       a.add('P1_EMPNO', pValue);
       var r=a.get();
    
       //set variable to trigger dynamic action
       $s('P1_EMPNO',pValue);
    }
    

    I use this point (P1_ITEM) to trigger a dynamic Action (when the value changes AND is not null) to SET the VALUE for the first LOV. This method works.

    Then one created a second dynamic Action that uses the event AFTER REFRESH for the first LOV to SET the VALUE for the second SuperLOV. It does not work

    Just to test the logic, I created a third standard LOV which is the same as the second SuperLOV and respective dynamic action. This one works.

    It's the http://apex.oracle.com/pls/apex/f?p=49044:1 application

    (PATRICK, demoadmin, 1234) application WORDERS.

    I would be very grateful for any help

    Thank you.

    OK, I discovered what was going on.

    I used a $('#P1_EMP').apex_super_lov of javascript for dynamic Action action to set the value of the SuperLOV.

  • Dynamic action to set the value of the point of Application

    Hello
    I want to display a form button that sets a value of the point of Application. Can someone please help and guide how to proceed?

    The requirement is, the user will receive a report, they can change a record and a button will allow him to SET the record for the session. When it accesses a different page within the application, they will see that the data relevant to the record that is DEFINED.

    Thanks in advance
    Aali

    Hi, Estelle,.

    You can use the dynamic action 'Code from PL/SQL Execute' to fix your application. For example, your code might look like

    begin
        :G_DISPLAY_MODE := :P1_DISPLAY_MODE;
    end;
    

    Page items to submit: P1_DISPLAY_MODE

    P1_DISPLAY_MODE would be the element on your current page where you select the desired value.

    Hope that you give something to play with.

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • How to set default cell format 'text' instead of 'general' sheet in excel using pl/sql code?

    Can someone please help me on how to generate excel file using pl/sql? I have generated csv files successfully, but now I need to generate a excel. I changed the code generation of the csv file, but the file gives me error when opening:

    "The file you are trying to open,"XXXX.xls", is in a different format than specified by the file extension. Do you want to open it now? »

    If I choose Yes then open the excel file, but it excludes the leading 0 in the front for one my column. How do I configure excel type default column as text rather than General, when you create the files? I also tried to generate excel file using xml. But I do not know how to set the type of column there, too. I'm using Oracle 11.2.0.3.0 and APEX 4.2.6.00.03. I'll call all these codes apex.

    Code1 is used:

    Declare

    output_header varchar2 (4000);

    fichier_en_sortie VARCHAR2 (255);

    Varchar2 (2) EOL: = Chr (13) | Chr (10);

    BEGIN

    output_header: = 'tls_tracking_id ' | Chr (9) | ' fnn_ext' | Chr (9) | "path_id' | EOL;

    fichier_en_sortie: = 'report_excel' |'. XLS;

    owa_util.mime_header ("application/octet ', false");

    HTP.p ('Content-Disposition: attachment; filename = "" | ") fichier_en_sortie |' « ') ;

    owa_util.http_header_close;

    HTP. PRN (output_header);

    for r in)

    Select tls_tracking_id, fnn_ext, DWD_DTOV_OUT_VW path_id

    where nbn_loc_id = 'LOC000138413115. '

    The order of tls_tracking_id LOOP)

    HTP. PRN (r.tls_tracking_id

    || Chr (9) | r.fnn_ext

    || Chr (9) | r.path_id

    || EOL

    );

    END LOOP;

    END;

    Code2 used :

    create or replace PACKAGE BODY IS pkg_excel_export

    PROCEDURE excel_open (l_xml_body IN OUT NOCOPY CLOB) IS

    BEGIN

    l_xml_body: = ' <? XML version = "1.0" encoding = "ISO-8859-9"? > ' | Chr (10) |

    "< workbook xmlns =" "urn: schemas-microsoft - com:office:spreadsheet" ' | "

    Chr (10) |

    ""xmlns:o ="urn: schemas-microsoft-com ' ' |

    Chr (10) |

    "xmlns: x =" "urn: schemas-microsoft-com: excel" ' | "

    Chr (10) |

    ""xmlns:ss ="urn: schemas-microsoft - com:office:spreadsheet" ' |

    Chr (10) |

                            'xmlns:html=" http://www.w3.org/TR/REC-html40 ">' ||

    Chr (10) |

    ' < ExcelWorkbook xmlns = "urn: schemas-microsoft-com: excel" > ' |

    Chr (10) | ' < WindowHeight > 8580 < / WindowHeight > ' |

    Chr (10) | ' < WindowWidth > 15180 < / WindowWidth > ' | Chr (10) |

    ' < WindowTopX > 120 < / WindowTopX > ' | Chr (10) |

    ' < WindowTopY > 45 < / WindowTopY > ' | Chr (10) |

    ' < ProtectStructure > false < / ProtectStructure > ' | Chr (10) |

    ' < ProtectWindows > false < / ProtectWindows > ' | Chr (10) |

    ' < / ExcelWorkbook > ' | Chr (10) | "< Styles > | Chr (10) |

    '< ss:ID of style = 'Default' ss:Name 'Normal' = >' | Chr (10) |

    "< ss:Vertical alignment = 'Bottom' / >" | " Chr (10) |

    ' < borders / > '. Chr (10) | ' < police / > '. Chr (10) |

    ' < Interior / > '. Chr (10) | ' < NumberFormat / > '. Chr (10) |

    ' < protection / > '. Chr (10) | "< / style > | Chr (10) |

    '< ss:ID of style 's22' = >' | Chr (10) |

    "< x: font family = ss"Swiss":"BOLD"="1"ss:Underline ="Single"/ >" | "

    Chr (10) | "< / style > | Chr (10) | "< / style >";

    END excel_open;

    PROCEDURE excel_close (l_xml_body IN OUT NOCOPY CLOB) IS

    BEGIN

    l_xml_body: = l_xml_body | ' < / workbook > ';

    END excel_close;

    / * Opens a worksheet in the Excel file. , You can open multiple worksheets. **/

    PROCEDURE worksheet_open

    (

    l_xml_body IN OUT NOCOPY CLOB,

    p_worksheetname in VARCHAR2

    ) IS

    BEGIN

    --

    -Create the worksheet

    --

    l_xml_body: = l_xml_body | "' < worksheet ss:Name = ' ' | p_worksheetname |

    "" > < table > ";"

    END worksheet_open;

    / *Farm the worksheet in the Excel file.   **/

    PROCEDURE worksheet_close (l_xml_body IN OUT NOCOPY CLOB) IS

    BEGIN

    l_xml_body: = l_xml_body | ' < / table > < / worksheet > ';

    END worksheet_close;

    / *Opens the tag line * /

    PROCEDURE row_open (l_xml_body IN OUT NOCOPY CLOB) IS

    BEGIN

    l_xml_body: = l_xml_body | "< row >."

    END row_open;

    / *Farm the tag line * /.

    PROCEDURE row_close (l_xml_body IN OUT NOCOPY CLOB) IS

    BEGIN

    l_xml_body: = l_xml_body | "< / row > | Chr (10);

    END row_close;

    / *After the opening of the line, we can write something the first cell* /

    PROCEDURE cell_write

    (

    l_xml_body IN OUT NOCOPY CLOB,

    p_content in VARCHAR2

    ) IS

    BEGIN

    l_xml_body: = l_xml_body | ' < cell > < data ss:Type = "String" > ' |

    p_content | ' < / data > < / cell > ';

    END cell_write;

    / * If you use this package of APEX, you get to download the excel file. **/

    PROCEDURE excel_get

    (

    l_xml_body IN OUT NOCOPY CLOB,

    p_filename in VARCHAR2

    ) IS

    XX BLOB;

    make the NUMBER;

    This NUMBER;

    BC NUMBER.

    LC NUMBER;

    w NUMBER;

    BEGIN

    DBMS_LOB.CREATETEMPORARY (xx, TRUE);

    make: = 1;

    so: = 1;

    BC: = dbms_lob.default_csid;

    LC: = dbms_lob.default_lang_ctx;

    w: = dbms_lob.no_warning;

    DBMS_LOB.converttoblob (xx,

    l_xml_body,

    DBMS_LOB.lobmaxsize,

    do,

    Thus,.

    British Colombia,

    LC,

    (w);

    owa_util.mime_header ("application/octet ', FALSE");

    -set the size so that the browser knows how to download

    HTP.p ("Content-length: ' |") DBMS_LOB.GetLength (xx));

    -the name of the file will be used by the browser if users only one save as

    HTP.p ('Content-Disposition: attachment; filename = "" | ") p_filename |

    '.xls ' | '"');

    -close the headers

    owa_util.http_header_close;

    -Download the BLOB

    wpg_docload.download_file (XX);

    END excel_get;

    END pkg_excel_export;

    I know it's a bit long code, but to better understand please consider...

    Thank you.

    I did worked putting just one extra line in my l_xml_body in the XML (Code 2 used). Now my excel generates with cells type 'Text' and there are no left falling to zero. Also the columns display not scientific format as 2.3D + 12. Current recording shows without default formatting.

    '

  • How to set the value of a * APPLICATION * with apex.server.process?

    If I have a page named point P1_MY_PAGE_ITEM, I could put its value in the session by doing this:

    $s('P1_MY_PAGE_ITEM', 'I Like Pie!');
    
    apex.server.process(   'dummy'
                           , { pageItems: "#P1_MY_PAGE_ITEM" }
                           , { dataType: "text",
                             async: false,
                               complete: function( ajaxResponse )
                                     {
                                          var ignoredReturn = ajaxResponse.responseText;
                                     }
                             });

    Which works very well. If you check the session, the P1_MY_PAGE_ITEM will now have the value: I like pie!

    However, if I have an Application element (not a page element!) named MY_APP_ITEM, how could I do the same thing? How can I use apex.server.process to set the value of MY_APP_ITEM in the session? I wouldn't be able to use "pageItems" because MY_APP_ITEM is not a page element, it is a part of the application.

    What is the correct syntax to do this?

    Thank you

    -Joe

    Hey Joe,

    Returning to that thread you made a couple of months ago, the answer is here:

    Post adjustment Application items in the apex.server.process for a * process application *.

    Defining a point of application is as easy as providing the name of the application element to p_arg_names Bay and set a corresponding value in the p_arg_values table.

    For example, in an application with article SOME_ITEM of the application, I can put the value as follows:

    (function(){
    var arrNames = [], arrValues = [];
    arrNames.push("SOME_ITEM");
    arrValues.push('some value');
    apex.server.process(   'dummy'
                         , { p_arg_names: arrNames, p_arg_values: arrValues }
                         , { dataType: "text"
                           });
    })()
    

    Any required application process. Should the item be free that you set it from the browser.

  • AF:inputListOfValues sets the value of the first item in the result set when using enter key or tab and component value autosubmit = true

    I use JDev 11.1.1.6 and when I type in a value in an af:inputListOfValues element and press enter or the tab key, it will replace the value I entered with the first element in the set of results LOV. If enter a value, simply click on the component af:inputListOfValues it works correctly. If I use the popup and find a value it works properly as well. I have a programmatic view object that contains a single transitional attribute (this is the view object that is used to create the list of the components of the value of) and then I have another object from view based on entities which defines one of its attributes in a list of the attribute value. I tried to use a base object view of entity to create the LOV to and everything works as expected, so I don't know if this is a bug when using programmatic view objects or if I need more code in the VOImpl. In addition, it seems after that first of the value being replaced by the first value in the result set that it will work correctly as well. Here are some excerpts of important code.

    Also, it seems that this does not work only if the text entered in the component af:inputListOfValues would have only a single game, returned in the result set. For example, given the result defined in code: Brad, Adam, Aaron, Fred, Charles, Charlie, Jimmy

    If we get into Cha, the component works as expected

    If we register A, the component works as expected

    If we get Jimmy, the component does not work as expected, and returns the first value of results IE. Brad

    If we get Fred, the component does not work as expected, and returns the first value of results IE. Brad

    I also checked that I get the same behavior in JDev 11.1.1.7

    UsersVOImpl (programmatic view with 1 transitional attribute object)

    import java.sql.ResultSet;
    
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    
    import oracle.adf.share.logging.ADFLogger;
    
    import oracle.jbo.JboException;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    
    // ---------------------------------------------------------------------
    // ---    File generated by Oracle ADF Business Components Design Time.
    // ---    Wed Sep 18 15:59:44 CDT 2013
    // ---    Custom code may be added to this class.
    // ---    Warning: Do not modify method signatures of generated methods.
    // ---------------------------------------------------------------------
    
    public class UsersVOImpl extends ViewObjectImpl {
    
        private static ADFLogger LOGGER = ADFLogger.createADFLogger(UsersVOImpl.class);
        private long hitCount = 0;
    
        /**
         * This is the default constructor (do not remove).
         */
        public UsersVOImpl () {
        }
    
        /**
         * executeQueryForCollection - overridden for custom java data source support.
         */
        protected void executeQueryForCollection (Object qc, Object[] params, int noUserParams) {
    
             List<String> usersList = new ArrayList<String>();
             usersList.add("Brad");
             usersList.add("Adam");
             usersList.add("Aaron");
             usersList.add("Fred");
             usersList.add("Charles");
             usersList.add("Charlie");
             usersList.add("Jimmy");
    
             Iterator usersIterator = usersList.iterator();
             setUserDataForCollection(qc, usersIterator);
             hitCount = usersList.size();
             super.executeQueryForCollection(qc, params, noUserParams);
    
        } // end executeQueryForCollection
    
        /**
         * hasNextForCollection - overridden for custom java data source support.
         */
        protected boolean hasNextForCollection (Object qc) {
    
             Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
             if (usersListIterator.hasNext()) {
         
                 return true;
    
             } else {
    
                 setFetchCompleteForCollection(qc, true);
                 return false;
    
             } // end if
    
        } // end hasNextForCollection
    
        /**
         * createRowFromResultSet - overridden for custom java data source support.
         */
        protected ViewRowImpl createRowFromResultSet (Object qc, ResultSet resultSet) {
    
             Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
             String user = (String)usersListIterator.next();
             ViewRowImpl viewRowImpl = createNewRowForCollection(qc);
    
             try {
    
                 populateAttributeForRow(viewRowImpl, 0, user.toString());
    
             } catch (Exception e) {
    
                 LOGGER.severe("Error Initializing Data", e);
                 throw new JboException(e);
    
             } // end try/catch
    
             return viewRowImpl;
    
        } // end createRowFromResultSet
    
        /**
         * getQueryHitCount - overridden for custom java data source support.
         */
        public long getQueryHitCount (ViewRowSetImpl viewRowSet) {
             return hitCount;
        } // end getQueryHitCount
    
        @Override
        protected void create () {
    
             getViewDef().setQuery(null);
             getViewDef().setSelectClause(null);
             setQuery(null);
    
        } // end create
    
        @Override
        protected void releaseUserDataForCollection (Object qc, Object rs) {
    
             Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
             usersListIterator = null;
             super.releaseUserDataForCollection(qc, rs);
    
        } // end releaseUserDataForCollection
    
    } // end class
    
    

    <af:inputListOfValues id="userName" popupTitle="Search and Select: #{bindings.UserName.hints.label}" value="#{bindings.UserName.inputValue}"
                                                  label="#{bindings.UserName.hints.label}" model="#{bindings.UserName.listOfValuesModel}" required="#{bindings.UserName.hints.mandatory}"
                                                  columns="#{bindings.UserName.hints.displayWidth}" shortDesc="#{bindings.UserName.hints.tooltip}" autoSubmit="true"
                                                  searchDesc="#{bindings.UserName.hints.tooltip}"                                           
                                                  simple="true">
                              <f:validator binding="#{bindings.UserName.validator}"/>                       
    </af:inputListOfValues>
    
    
    
    

    I found a solution to this problem. It seems that, when using a view object programmatic that has a transient as its primary key attribute, you need to override the methods in the ViewObjectImpl so that he knows how to locate the line related to the primary key when the view object records are not in the cache. That's why it would work properly sometimes, but not always. Here are the additional methods that you must override. The logic you use in the retrieveByKey would be on a view view object database object and would be different if you had a primary key consisting of multiple attributes.

    @Override
    protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, Key key, int i) {
        return retrieveByKey(viewRowSetImpl, null, key, i, false);
    }
    
    @Override
    protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, String string, Key key, int i, boolean b) {
    
        RowSetIterator usersRowSetIterator = this.createRowSet(null);
        Row[] userRows = usersRowSetIterator.getFilteredRows("UserId", key.getAttribute(this.getAttributeIndexOf("UserId")));
        usersRowSetIterator.closeRowSetIterator();
        return userRows;
    
    }
    
    @Override
    protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, Key key, int i, boolean b) {
        return retrieveByKey(viewRowSetImpl, null, key, i, b);
    }
    

Maybe you are looking for

  • View of album for CD with several discs

    When adding an album that has 2 or more drives.  Even if the information across all the disks, itunes combine under a single icon of album.  I did that record numbers are correct.  Artist, sort, etc...

  • Lenovo G505s stops...

    Hello! Last December, I bought a laptop Lenovo G505s (A8 - 5550M). Everything worked great since last week. Since then, the portable computer stops unexpectedly. This often happens when I play a video game. I think it's something about the cpu or gpu

  • How can I remove Age of Empires 3 save files?

    I'm trying to remove the old parts saved AoE3 and AoE3 - warlords, as my computer is running out of space. May not know how this - someone can help me?

  • SideWinder X 6 - how auto key macro?

    Is there a possibility of automatic repeat a macro key?   The "Cruise control" doesn't seem to work for the macro key and it seems impossible to store a macro button is clicked in a macro editing. Nor the key macro seems like other keys ddddddddddddd

  • X 230 new defects

    I got my x 230 today and he has three questions: Left button of the mouse makes noise as if there is something of crumpled behind it (similar to the noise if you WAD of paper tissue or waxed paper). Sometimes, it's just a pop (as paper bubble to burs