Dynamic creation of page items

How can I create page items dynamic, if I have their number and their titles in a page item?

More often than not you'll run into difficulties when trying to do something like this with APEX. However, you have two options:
1 - The htmldb_item API, embedding items into a report based on the values of your previous page items.
2 - Some combination of hidden fields and conditionals that makes use of your page item values for their label text.
The former is well documented on the forum.
Rgds
Ben

Similar Messages

  • Problem with dynamic change a page item value

    Hi,
    I'm trying to dynamically calculated the value of an item based on a simple formula that involves the multiplication of two elements from the same page.
    To do this, create dynamic action as follows:
    Event: Change
    Selection Type: Item(s)
    Item(s): P19_DURATION
    Action: Set value
    Fire on page load: TRUE
    Set Type: SQL Statement
    SQL Statement: SELECT :P19_DURATION * :P19_RATE FROM DUAL
    Page items to submit: P19_DURATION
    Selection Type: Item(s)
    Item(s): P19_AMOUNT
    When altering the P19_DURATION get no change in P19_AMOUNT
    Since my knowledge of javascript is almost zero, I'm trying to do this with pl / sql or sql. Try the dynamic action with a function or a PL / SQL statement and nothing works.
    Have to use javascript for this?
    Searching the forum I think it's something simple, but I did not find an example similar to what I need.
    Regards

    Event: Change
    Selection Type: Item(s)
    Item(s): P19_DURATION
    Action: Set value
    Fire on page load: TRUE
    Set Type: javascript
    javascript Code:
    amount = $v('P19_DURATION') *  $v('P19_RATE');
    $s('P19_AMOUNT',amount);

  • Dynamic alignment of report column and page item value

    Hi friends,
    I have an interactive report which contains the columns like
    <li>empno
    <li>Name
    In the above i have "empno" with a column alignment of left and a "Name" with a column alignment of left.
    Whether it is possible to override the data alignment that we set in the report according to the value of the application item like
    If my application item value is US, then i need the column alignment of both the column"empno" and "Name" to be left and if my application item value is AR, then i need the column alignment of both the column "empno" and "Name" to be right. Whether is it possible to achieve the dynamic alignment to the report data of both the columns "empno" and "Name" according to the application page item value.
    And also in the case of page item i have a page item with a name P1_NAME in which it has a Element Horizontal/Vertical alignment to left.
    I need that element alignment of the page item to behave dynamically according to the application page item, like if the application page item is US then the element alignment of the page item has to be left and if the application page item is AR then the element alignment of the page item has to be right.
    Whether is it possible to achieve my above two scenario's friends. Kindly help me with this.
    Thanks in advance.
    Brgds,
    Mini

    Kees,
    Your approach is excellent and brilliant:-)
    I tried with your steps and i can achieve those alignment in both ways like you said(either on page load/through DA).
    But im going with the DA way. I have certain query regarding this kees.
    <li>Suppose if the report, is classic whether i can go with the same approach that i have achieved alignment with the IR report.
    <li>Currently through the DA way, i used the page item in the condition. Is it possible to use the application item instead of page item in DA. Because im going to use the application item FSP_LANGUAGE_PREFERENCE for getting the code either 'AR' or 'US'.
    <li>Finally i need this kind of restriction for the page item also, consider like i have a page item P1_X with an Element Vertical/Horizontal alignment as left. Now i need to change that alignment to right according to the application page item value, hence i can give application item condition for the page item like below
    PL-SQL EXPRESSION: :FSP_LANGUAGE_PREFERENCE = 'AR'
    i need the element alignment of the page item to behave dynamically suppose if the application item value is AR then the element alignment of that page item has to be right if the application item value is US then the element alignment of that page item has to be left, irrespective of the page item Element Vertical/Horizontal alignment that was set to it.
    Thanks for your kind help
    Brgds,
    Mini

  • Dynamically changing the name of a page item

    Hello,
    I'd like to dynammically change the name/label of a page item depending on the user who logged in to the system.
    On my home page, there's a navigation region with some list entries in it. Currently its title is "Configuration".
    If a specific user signs on, I'd like to change that title to "Reporting". How can I manage to implement such a behaviour.
    I tried to get some results by using dynamic actions, but I couldn't get it working.
    Thanks for your help in advance!

    >
    I'd like to dynammically change the name/label of a page item depending on the user who logged in to the system.Create a hidden item called PXX_LABEL (where XX is your page number).
    Set the value of the hidden item via a PL/SQL process (when page loads, or when user logs in, or whatever).
    In the "Label" field of the actual item, enter &PXX_LABEL. (notice the dot at the end).
    When running the page, the label will dynamically be set to the value of the hidden item.
    - Morten
    http://ora-00001.blogspot.com

  • Dynamic where clause based on Page Items

    I need an example of how to build a where clause with values from page items.
    I want to do something like the following but do not know the syntax:
    sql_string := ' where lab.ceventno is not null and lab.cts_no_show is null ';
    if :P1_RECID is not null then
    sql_string := sql_string || ' and lab.recid = ' || :P1_RECID;
    end if;
    if :P1_CAS_NO is not null then
    if :P1_CAS_TYPE = 1 then
    sql_string := ' and upper(lab.cas_no) = ' || :P1_CAS_NO;
    elsif :P1_CAS_TYPE = 2 then
    sql_string := ' and lab.ceventno in (Select ceventno from msds_ing where cas_no = ' || :P1_CAS_NO;
    end if;
    end if;
    :P2_WHERE := sql_string;
    I put this in a process that I want to pass to Page 2 when search button is pushed. I'm not sure what I'm doing wrong, but this doesn't seem to work.
    When I print out :P2_WHERE, I only get the first line
    'where lab.ceventno is not null and lab.cts_no_show is null '
    Any help would be much appreciaed
    Thanks
    Pam

    Pam - We need more details about exactly what you are doing, e.g., how are you going to dynamically execute that SQL, what items are on page 1 that will be submitted (all search criteria), what happens on page 2, etc.
    But here are a few points:
    1. when building a query for dynamic execution, put the bind variables like ":P1_RECID" into the generated SQL, e.g., do this:
      sql_string := 'select ename from emp where empno = :P1_EMPNO';
    not
       sql_string:= 'select ename from emp where empno ='||:P1_EMPNO;They may appear to give you the same results but the first introduces non-reusable SQL into the shared pool (this is bad).
    2. When code runs that references user-entered item values on the current page, like "if :P1_CAS_NO is not null", you have to make sure those items have been submitted (as with a page-submitting button) before you reference them. So if the user enters search criteria into form fields, then submits the page, then you reference those items in the SQL-building process, you'll be okay.
    3. Watch for errors like your line: "sql_string := ' and upper(lab.cas_no) = ' || :P1_CAS_NO;" which you may have intended to be "sql_string := sql_string||' and upper(lab.cas_no) = ' || :P1_CAS_NO;".
    Scott

  • Dynamically Update a number field by summing of page item values.

    Hi,
    I'm trying to update a number field on an apex page by summing up the values of multiple page items. I've tried to follow this tutorial http://st-curriculum.oracle.com/obe/db/apex/r40/apexdynactions/apexdynactions_ll.htm , especially the "Create a Set Value Dynamic Action Using PL/SQL" part.
    In the tutorial example they return an page item value P3_SAL multiplied by a multiplier they've determined by another page item's case. What I want to do is much simpler in that I just want to add up multiple page item values and then display them in a number field at the bottom of the page.
    so the code I tried to use based on the tutorial is in the tab: Home >Application Builder>Application 103>Page 3>Edit Dynamic Action>Create / Edit Action
    Set Type: PL/SQL Function Body
    PL/SQL Function Body:
    BEGIN
    return :P3_ITEM1+P3_ITEM2+P3_ITEM3;
    END;
    Page Items to Submit: P3_ITEM1,P3_ITEM2,P3_ITEM3
    But it gives me an error that I need to declare the identifiers, yet it works if I only use one item and I can perform any arithmetic.
    ie.
    BEGIN
    return :P3_ITEM1+1000;
    END;
    Any help would be appreciated.

    PL/SQL Function Body:
    BEGIN
    return :P3_ITEM1+P3_ITEM2+P3_ITEM3;
    END;
    Page Items to Submit: P3_ITEM1,P3_ITEM2,P3_ITEM3
    But it gives me an error that I need to declare the identifiers, yet it works if I only use one item and I can perform any arithmetic.In your code is missing the ":" for the items P3_ITEM2 and P3_ITEM3.
    Try this:
    BEGIN
    return :P3_ITEM1+:P3_ITEM2+:P3_ITEM3;
    END;

  • How to modify page item dynamically

    Hi experts,
    I have a DB table called attribute in that i am having set of attributes namely att1,att2,att3....... And in application builder i had created a page called service request. When i run the page it have att1,att2,att3 and their corresponding page items. For example ATT1 has text field,ATT2 has a text field,ATT3 has select list. Now the user want to edit the page items(while the page running) ATT1 to select list and ATT2 to Select list and ATT3 to Text field after the changes it should reflect in the application page.
    Edited by: karthi on May 3, 2011 2:45 AM
    Edited by: karthi on May 3, 2011 3:22 AM

    hi,
    can you please tell me the steps. I had write the following code in pl sql->region->source.
    begin
    SELECT
    empno,
    APEX_ITEM.HIDDEN(1,empno)||
    APEX_ITEM.TEXT(2,ename) ename,
    APEX_ITEM.TEXT(3,job) job,
    mgr,
    APEX_ITEM.DATE_POPUP(4,rownum,hiredate,'dd-mon-yyyy') hiredate,
    APEX_ITEM.TEXT(5,sal) sal,
    APEX_ITEM.TEXT(6,comm) comm,
    deptno
    FROM emp
    ORDER BY 1;
    end;
    BUT IT SHOWS THE FOLLOWING ERROR
    *1 error has occurred*
    ORA-06550: line 3, column 1: PLS-00428: an INTO clause is expected in this SELECT statement
    Regards,
    Karthi
    Edited by: karthi on May 3, 2011 9:50 PM

  • Dynamic Creation of UI in adobe forms??

    Hi Experts,
    I need to create a dynamic interactive form and dynamic UI elements in the interactive form.
    As per my requirement I need to display a pdf and I will be getting values from the RFC's. I need to show the form segments and the UI elements only when there's a data from the RFC else not. I am unable to understand whether this requirement needs generation of the UI elements dynamically or I can do it statically as well.
    The form thus generated will be having data from the RFC which based on the data quantity may exceed to n number of pages.
    In case it needs dynamic creation can you suggest me please how to achive it in interactive forms?
    Helpful answers will be appreciated.
    Warm Regards,
    Gaurav

    Hi,
    subForm1:-
    Flow content
    Allow page breaks
    Place: following previous-----> This means when you are repeating the subform the previous one should be followed.
    Say you have a table and have 3 columns in it.
    After 1st column is completed, the next column should come with 1st comun
    After: Continue filling parent--->Continously fill the data with the parent element
    Repeat sub form min count is 1 : Minimum of 1 line item will be printed
    Height: Expand to fit is true.: If the field height is increased it automatically expands.
    For help in Adobe Press F1 or Goto Help--> Adobe Designer Help in Adobe Designer
    After installing Adobe Designer, goto the specific folder
    C:\Program Files\Adobe\Designer 8.0\EN you can get sample documents.
    For help press F1 after opening designer.
    Sub Form1: Content--> Flowed, Flow direction --> Top to bottom
                       Binding --> Check the checkbox Repeat Subform for each data item
    Subform 2: Content --> Positioned, No pagination No binding settings changes needed.
    Hey i forgot to mention the Header Subform where you create all these subforms should be flowed.
    Try it once like this and lte us know
    Edited by: Sankar Narayana on Oct 3, 2008 5:06 PM

  • Set page item from a stored procedure

    Dear reader
    We would like to have a stored procedure to run every 10 minutes. When the procedure starts, the user has to be warned that the update process is running.
    When the procedure is finished, the user should receive a message that the update process is finished.
    What I had in mind was to set a Page 0 item 'P0_REFRESH' and set his value depending on the status of the update. Then add a dynamic action with a change event. So everytime the value of this page item changes, the user will receive a correct message.
    Does anyone know if it is possible to set a page item from a stored procedure?
    Kind regards
    Xnni

    AndyPol
    I found a solution by querying the user_jobs table. In Apex, I created two page 0 items that hold the current status of the job (online, offline) and the old value of the job.
    Online of offline in the current status item is determined by a decode on "this_sec".
    The enext step was to include a html region in P0 that contains some javascript. This javascript will display a message when the values of the new status is different from the old status ;)
    Many thanks for bringing up the ideas.
    Greetz
    Xnni

  • SkillBuilders Modal 2.0 plugin with a page-item button - pass parameters

    Hi all.
    I have an employee table, which is connected with a 1:N relationship to two tables: Emp_Tech_Fields and Emp_Kids.
    I've created a form to update / insert employee data, and I want to add two modal pages: one for kids and one for tech_fields. I think this will be the most usable way for this form.
    I've created two page-item buttons on that form, which open the respective modal pages successfully, but I can't dynamically pass them the EMP_ID in order to filter the data in them.
    Iv'e uploaded an example to http://apex.oracle.com/pls/apex/f?p=64921:1:6401028834215::::: guest / gu12est3
    Document Types is a report with a link-column which opens a modal page with data filtering, as it should.
    Employees (click an edit link) has two buttons: Kids, which open the modal form, but does not filter, and Tech Fields, which is filtered hard-coded with EMP_ID = 1 (see in the dynamic action definition).
    As far as I understand, this should be something quite easy and day-to-day, so I don't know why I did not find a way to do this. What am I missing?
    Any help will be greatly appreciated,
    Dovi.

    Hi Dovi,
    I had a look at your application and can see the link your using for the kids and tech fields modal isn't passing the session ID which is why it is asking you to log in again.
    Below is an example URL for your issue, it isn't tested though.
    f?p=&APP_ID.:20:&APP_SESSION.:::19:P20_EMP_ID:&P19_EMP_ID.:: You will need to change the page numbers of the pages and items to match the page numbers of yours. This is using the statically defined url inside the plugin itself, I have also only done this in an earlier version of plugin but believe the functionality is very similar.
    Hope this helps.
    Paul

  • Update report dynamically? (without page refresh)

    I have a page with several regions, and only one region is visible at a time. Each region contains a report as well as a drop-down to alter the data displayed in the report. Currently each time a drop-down value is changed it submits the page, which causes the "main region" to become visible since it is set by default to display first.
    Is there a basic tutorial I can follow on how to dynamically update the report output without a page refresh?
    Thanks,
    Steve

    Steve wrote:
    I have a page with several regions, and only one region is visible at a time. Each region contains a report as well as a drop-down to alter the data displayed in the report. Currently each time a drop-down value is changed it submits the page, which causes the "main region" to become visible since it is set by default to display first.
    Is there a basic tutorial I can follow on how to dynamically update the report output without a page refresh?The easiest way to do this is using dynamic actions. Create a Refresh dynamic action for each region that executes when the associated select list is changed:
    h4. When
    Event: Change
    Selection Type: Item(s)
    Item(s): <select list associated with region>
    h4. True Action
    Action: Refresh
    Fire On Page Load: Yes or No depending on the requirements of your application
    Region: <region to be refreshed>
    Ensure that the value of the associated select list is submitted into session state before the refresh by specifying it in Page Items to Submit in the Source section of the report region definition.
    There are some dynamic action tutorials on the Oracle Learning Library. Doesn't specifically mention Refresh in the abstract, so it may not cover this specifically, but it is an introduction to dynamic actions in general.
    (It's probably possible to create a single dynamic action to handle refreshing all of the regions: we'd need more comprehensive details of your application, preferably reproducing it or a simplified version on apex.oracle.com.)

  • Creating page items from pl/sql procedure and using them on a page

    I have a page containing 2 select lists (P21_DEPARTMENTS and P21_DATE). Originally I added them as items that were "select list with submits". The problem is that based on the clearance level of the currently logged on user I only wanted the P21_DEPARTMENTS to be a select list if the user was an administrator. If however the user is not an admin then I want the page to have a hidden form field called P21_DEPARTMENTS that stores the user's department and has a label item that has the department name.
    There is also a report region that generates a table based on the department selected from the select list (if the user is an admin) or the value stored in the hidden form field if the user is not.
    My problem is that I cannot have both those items on the same page and use the HTML built-in authentication to determine which item should be rendered because I need to use the same ID for both items so that the stored procedure in my report region doesn't break. HTML does not permit items to share the same ID.
    I tried to circumvent the problem by creating a stored procedure that performs all of the item rendering in the procedure and uses "htp.p()" to output all of my HTML code. This solution would allow me to pass a parameter into the procedure informing me as to whether or not the user is an administrator. If the user is an administrator the procedure would use a conditional statement and render a select list. If not, the hidden form field and label option would be used instead.
    I finally got the stored procedure working perfectly. Now I am encountering the most bizarre thing. Since the "select list with submit" was not working (I used the same code that gets generated when I created other items using htmlDB's GUI) I decided to use a JavaScript function instead that gets triggered by the onChange event. I send along the value that is currently selected in the select list and in the function I set:
    location.href='http://www.myoraclesite.com/pls/htmldb/f?p=111:21:729740000000000000::NO::P21_DEPARTMENTS:1';
    In theory this should work. The problem is that it doesn't. The page reloads and the P21_DEPARTMENTS select list is not pre-selected.
    The only thing I can think of is that when htmlDB generates page items that you've created with it's own admin tool it assigns some internal guid or something as opposed to when someone tries to generate dynamic page items of their own from a pl/sql procedure it's like the application doesn't even know they exist.
    Any help would be GREATLY appreciated.
    My only other solution would be to create a totally separate page (one for admin and another for non-admin). I would really like to avoid this.
    Thanks in advance.

    I would love to be able to generate my menus and
    various other items in my htmlDB applications in much
    the same way I can using ASP, PHP and Cold Fusion.
    Users should have the ability to write server-side
    code wherever they feel like it. The way htmlDB works
    right now I spend more time trying to figure out how
    to create simple effects and generate simple
    interfaces when I need to be building a portal. Ami - it's important to understand that HTML DB is not like other languages. Thus, trying to force concepts which are common in other languages into HTML DB will often result in more work.
    It's definitely worth the time to go over the HTML DB 2-day Developer, which can be found here: http://www.oracle.com/technology/products/database/htmldb/pdf/B14377_01.pdf
    I can build a portal using Classic ASP, C#, PHP or Cold
    Fusion in like 1/10 of the time that it takes me to
    build one using htmlDB. I understand that this is not
    meant for the hard-core programmer but no web
    programming application in today's day and age should
    prevent experts from getting under the hood.And I can build a Portal in HTML DB in 1/10 the time it will take me to do it in any other language. It's like anything else - proficiency comes with practice and work.
    As for getting under the hood, there is plenty of places you can do that with HTML DB. Keep in mind that HTML DB itself is an HTML DB application, so the limits on what you can build with HTML DB are virtually limitless.
    Sorry for the vent there. After spending the last 2
    days trying to figure out how to implement such a
    straightforward thing and now being informed that it
    can't be done kind of bugged me.I understand your frustration, as I've been there before. My rule for beginners is that if you are writing more than a line or two of code in the first week, you're doing something wrong. Stop, take a break, and then use the ample resources (including searching this forum) to help solve your problem. There are plenty of resources available for you to learn about HTML DB on the HTML DB home page: http://otn.oracle.com/htmldb
    Good luck,
    - Scott -

  • Page item validation

    I created a page in APEX Express 4.2.3.00.08.  On the page there are two items: a text field named P55_KEY_ID and an LOV named P55_REASON with the values LOST, BROKEN, OTHER.  I created a dynamic action that enables P55_REASON when P55_KEY_ID changes. Our business rule is if P55_KEY_ID has been changed then P55_REASON must have a value, i.e. not null.  Can I define a validation on P55_REASON  with a condition to test the disabled property of the page item with javascript, if it is disabled then return false otherwise true.  Where would I place the following javascript?
    IF $x(‘P55_REASON’).disabled then
      Return  false;
    Else
    Return true;
    End if;

    What is the validation? What version are you in?
    There are some item validations that execute automatically based on settings like 'Required'.
    Date pickers has other attributes that can declaratively validate range.

  • Button condition on page item and Validation error Conflict

    Hi,
    I have a select list page item and a button on page whose condition is based on the select list page item value(eg, If (:P2_item1='val1'){return true;}) with condition type=PL/SQL function returning boolean. This buttons submits the page.
    It' coming fine in normal case. However, if I select some value val2 from the list and then click the button, and if there are any validation errors (like mandatory check or email check fail etc), then the button disappears because it evaluates the button condition based on the changed value(val2), but the page has not yet been submitted because of validation errors.
    I think this can be solved if I create the button condition based upon database column value instead of page item as db col value won't change until the page is submitted.
    This look like very basic use-case and I would like to know if there is any better solution to this problem.
    Note: I am using Apex 4.2.1

    I don't want to show/hide the button on the change of the page item lov value, so i am not using Dynamic action.
    What i was is to make button visible based on a condition(which is based on page item), for which we have condition attribute of a button available.
    This is a very common thing where a user chooses the button condition as Value of item/column in expression 1 is null/expr2. But what if the user changes the page item value but it doesn't get submit due to validation error. In that case, the button condition fails.
    So, i guess i have to use column name in expression 1, can u tell how to do that?
    Expression 1 = IF (:P2_STATUS='val1') then return true;
    How to change the above to use db column 'status' instead? Any direct way(like #Status#) or I have to query db to get it using select.
    Any alternative approach?

  • Dynamic Action on apex items

    Hi,
    I have a requirement like after entering the date of birth in the item. then age value should be set dynamically.
    how can i set the value?

    Hi Tulasi,
    Follow the below steps
    Click on create button-Dynamic action
    select Advanced type
    Give some name
    event - On change
    selection type - item
    item(s) - your page item(used to select date of birth)
    condition - no condition
    action - Execute PL/SQL code
    Fire on page load - blank
    PL/SQL code -
    declare
    v_age varchar2(100);
    v_dob date;
    v_sysdate date;
    begin
    select sysdate into v_sysdate from dual;
    v_dob := :P1_DOB;    //here P1_dob is a page item from where i am selecting date of birth.
    select trunc(to_char((v_sysdate - v_dob)/365)) into v_age from dual;
    :P1_AGE := v_age;     // i have created one item named P1_AGE to display the calculated age.
    end;Page Items to Submit = P1_DOB // replace with your datepicker page item
    Page Items to Return = P1_AGE // replace with your item.
    Hope this will give you some idea.
    Thanks and Regards,
    Jitendra

Maybe you are looking for

  • Why won't my itunes find my new iPod touch?

    My itunes won't find my son's new iPod.  I have tried all the troubleshooting stuff.  I installed the update.  I restarted my computer and all the other stuff.  But it still won't recognize it.  Is the next step to completely reinstall itunes?

  • Two itunes, two computers, one doesn't recognize ipod

    i downloaded songs to my itunes on my boyfriend's PC--It's downloaded in my name, purchased with the same credit card info on my Mac itunes--and now I can't transfer those songs to my ipod. The PC won't recognize the ipod, and my mac won't let me tak

  • Xslt template mismatch

    I could not really extract the values for Reference, Enquiry Type, Enquiry Sub-Type, Status and Sub-Status which should be picked up from s5. Is it because template match is set to <xsl:template match="/s4:ServiceRequest_Status_UpdateWithFullResponse

  • Newbie question: How to create a namespace and record filedate-retrieve

    Spanking new to Namespaces Looking for a way to place a .jpg as a smart object, then using Namespace, record the filedate of the .jpg Then, have the layer sense if the original .jpg is newer and change the color of the layer. Running into complicatio

  • Lightroom won't read SONY RAW files

    I've upgraded to 1.2, installed it once and then again to see if I could repair the problem. I am shooting a SONY A700 and Lightroom won't recognize my RAW files on the card or when I copy them to my hard drive. LR does see jpegs on the card when I s