Dynamic Item value

Hi All,
I am trying to find how to get dynamically an item value based on page number. More details ..
I have page1 and 1 item P1_COL1 and I have application level item F1_CURRENT_PAGE_NUMBER. On page10 I want assign value like this.
:P10_VAL := :P||F1_CURRENT_PAGE_NUMBER||'_COL1';
how to build and get value of "p1_col1" dynamically.
Please help me.
Thanks

Use
APEX_UTIL.set_session_state
  ( p_name => 'P'||:F1_CURRENT_PAGE_NUMBER||'_COL1'
  , p_value => <some value>
  );Patrick
My APEX Blog: http://inside-apex.blogspot.com
The ApexLib Framework: http://apexlib.sourceforge.net
The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

Similar Messages

  • Can we catch the dynamic item value in Apex?

    Hi All,
    In my application i am using SELECT_LIST_FROM_QUERY_XL Function. The select list will be populated based on some product group id.
    Some times the list will be 2 or 5 based on prgr id. Now how to catch the dynamic list item name. Is it possible?
    Thanks,
    Anoo..

    Not directly. You can have two items and then dynamically switch between those two items. This can lead to other issues of cause. For example if the item value should be stored in the database, you have to decide which item to store and how to do that.
    The field type itself should not be changed. There are a lot of other things that depend on that. Possible ? Yes. Advisable? No. Check the page source text to see the difference between a select item and a normal text field. Then think if you want to set all this dynamically.
    Maybe a popup list would be better suited?
    One more point: In my experience adding too many dynamic stuff onto a page will not improve the user experience, but will decrease it. So you should carefully consider if this is something. Dynamic actions are great, but they are not always the best tool for the job.

  • Dynamic Items - Restoring values on error

    I've got a page with some dynamic items. When I display a error on the page the values do not restore to reflect changes that the user made, rather the values stored in the DB. This makes sense as my code does not check to see if a error occurred.
    I'd like to check if a error occurred and if it did I can restore the user changes using the htmldb_application.g_fxx(x) function. So I'm wondering how do I know if a error occurred? i.e. is their a variable like the REQUEST variable which will be set if a error occurred?
    Now a bit on a side topic, when dealing with error validation of dynamic items I run into the following issue. I do the validation through one pl/sql check. It checks that all the fields have values in it. Imagine there are 5 fields (1 through 5), and the first 2 are empty. My error message says "Field 1 is empty... Field 2 is empty"... That all works but the page just says "1 error has occurred" and I have to list all the problems under that 1 error. I'd like it say "2 errors have occurred" instead. How can I do that when I only have 1 validation function? Is their a variable that I can increment for each error I find?

    update

  • Item Values Not Set - Dynamic SQL Fails to Parse.

    ** Think I've fixed this **
    (By simply defining some page computations I was able to set the item values to some default. Please don't feel the need to reply :-))
    I have a page consisting of 5 report parameters and a report, all in one region, 4 parameters are LOVs and one is a text field which in the query are all compared to table column values. The report region type is SQL Query(PL/SQL function body returning SQL Query).
    If I load the page in a new session with default values for the LOVs as '%' and a null text field, I get the following error message:-
    failed to parse SQL query:
    ORA-00936: missing expression
    If I examine the session state, I see that none of the parameter values are set, which is probably why the dynamic sql is failing.
    If I set one of the parameters to something, eg. choose another value in an LOV or type some text in the text field, and re-run the report, it executes without error.
    What's the easiest way to fix this, is it to set the page items to some specific values when the page is first loaded? If so how do I do that? I'm not having much luck creating some process to do it.
    All help appreciated.
    Ian
    Message was edited by:
    Ian_F

    Hi Ian,
    Did you already try to put a default value for that lov?
    Or try to do a computation before header?
    Thanks,
    Dimitri
    -- http://dgielis.blogspot.com
    -- http://apex-evangelists.com

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

  • Dynamic Action on Item Value Change with AjaxRequest not working

    Hello,
    I have a select list of users called P222_USERS. When a new user is selected, I want to run a Query to find the email for the new user selected and stick it in text field P222_EMAIL.
    I have an On Demand process on the change of P222_USERS that calls a javascript function:
    fetchEmail($('#P222_USERS').val());
    In my header, the function calls an Application Process in an Ajax request:
    function fetchEmail(email){
    var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=GET_EMAIL', 0);
                             ajaxRequest.add('P222_USERS', $('#P222_USERS').val());
                             ajaxResult = ajaxRequest.get();
    Here is my On Demand PLSQL Process GET_EMAIL:
    begin
    select email into :P222_EMAIL from login where userid = :P222_USERS;
    end;
    The email is not getting populated into :P222_EMAIL. I know i'm close, but have already spent a bunch of time with various alternates to the above function/on demand process. Any help is greatly appreciated. I wish the PL/SQL process on the item change worked in this manner instead of going through AJAX.
    Thank you,
    Johnny

    Johnny98 wrote:
    Hello,
    I have a select list of users called P222_USERS. When a new user is selected, I want to run a Query to find the email for the new user selected and stick it in text field P222_EMAIL.
    I have an On Demand process on the change of P222_USERS that calls a javascript function:
    fetchEmail($('#P222_USERS').val());
    In my header, the function calls an Application Process in an Ajax request:
    function fetchEmail(email){
    var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=GET_EMAIL', 0);
                             ajaxRequest.add('P222_USERS', $('#P222_USERS').val());
                             ajaxResult = ajaxRequest.get();
    Here is my On Demand PLSQL Process GET_EMAIL:
    begin
    select email into :P222_EMAIL from login where userid = :P222_USERS;
    end;
    The email is not getting populated into :P222_EMAIL. I know i'm close, but have already spent a bunch of time with various alternates to the above function/on demand process. Any help is greatly appreciated. I wish the PL/SQL process on the item change worked in this manner instead of going through AJAX.
    Thank you,
    JohnnyThe fact is that your application process sets the items value in the session state and not populate the value on client/browser side
    So you need to return the value from on demand process and assign the value in javascript like this
    function fetchEmail(email){
    var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=GET_EMAIL', 0);
    ajaxRequest.add('P222_USERS', $('#P222_USERS').val());
    ajaxResult = ajaxRequest.get();
    //newly added
    alert(ajaxResult);
    $s('P222_EMAIL',ajaxResult);
    //amend your On Demand PLSQL Process GET_EMAIL like this
    begin
    select email into :P222_EMAIL from login where userid = :P222_USERS;
    //newly added
    htp.prn(:P222_EMAIL);
    end;This way the value will be set into session state and client side as well

  • How to pass ITEM:VALUE pair in ICON view link of Interactive Report

    When Icon View is enabled in an interactive report, you can display graphic images (blob data that are stored in the database) in 3 different views.
    1) View Icons
    2) View Report
    3) View Detail
    When you click on the displayed image in views 1 and 3 you navigate to a form to manage the row data and the image. By default it only passes the PK id of the row.
    How do I pass additional ITEM:VALUE pairs when navigating to the detail form page? I want to pass &APP_PAGE_ID. to the form page as well.
    There is an attribute under ICON VIEW called "Link Column" but if I put the "item:value" pair in the fields for this item's "ColumnLink" attributes, there is no effect.
    Also for bonus points...
    how do you make the ICON VIEW attributes, "HTML ALT Text" and "HTML TITLE Text" dynamic e.g. &ITEM. doesn't work here.
    thanks in advance
    Paul P

    For your link column, parse a link column in your query like so
    apex_util.prepare_url('f?p=M:53:'||:APP_SESSION||'::::P53_IMAGE_ID:'||i.image_id)Scott

  • How to restore session item values

    Hi,
    We have a request form which has more than 50 fields and some hidden items which are calculated depending on other items. We have to implement SAVE request feature so that the user can save their partially filled request. We are storing these fields data in more than two tables and not storing some hidden item values. Our idea is to store that form page current session values and restore them when ever user wants to complete request. Is there any apex views which will have all these data. Please suggest how can we do this.
    Thanks in advance.
    Regards
    Ram

    Hello Ram,
    >> Yes we have seperate SAVE button
    That’s good, as it allows you to use these buttons to condition the PL/SQL processes, differentiates between the temporary and permanent actions.
    >> Our idea is to have temp table to store all the items and their values in the page when the user clicks on the SAVE button
    You are using ‘table’, in a single form, so I assume you refer to a single (temp) table. With careful planning of this temp table, it might be possible.
    To use a single temp table, it must contains details of the item name, value and the application page it defined on (although this information can be derived from the item name, if you are using APEX item name convention). The page items should be defined with a Source Type of ‘Database Columns’, and in this case, you can use the APEX_APPLICATION_PAGE_DB_ITEMS view to track them. Using this view, you can retrieve the relevant items for the current page, and then, dynamically build a PL/SQL insert/update statement to save the items into the temp table; or a PL/SQL select statement to fetch relevant items from the temp table and populate the page items.
    These are not trivial processes to build, and as you are going to use a single (generic) temp table, you will have to code all the temp/permanent DML statement yourself, but it seems doable.
    You might also want to check the WWV_FLOW_DATA table, which holds the session state data, and see how it was defined (for example using CLOB as the item value datatype, to allow you to store different types of APEX item values in a single column).
    Hope this helps,
    Arie.
    Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.

  • How to pass apex item value into custom xml for chart or guage?

    Re-opening the old thread : Re: How to pass apex item value into custom xml for chart or guage?
    Which was not answered.
    Roel - Thanks. Its working - but in a semi quotes in the custom XML
    <pointers>
    <pointer value= '&P5_RUNNING_TOTAL.'
    <label enabled="true">
    <position placement_mode="ByPoint" x="50" y="15" />
    <format>{%Value}{numDecimals:1}</format>
    <background enabled="false" />
    </label>
    </pointer>
    </pointers>This question was helpful for us to resolving one recent thread : AnyChart - set Dial axis intervals dynamically?
    (Re: AnyChart - set Dial axis intervals dynamically?
    Edited by: P.Ranish on Dec 13, 2012 6:23 AM

    P.Ranish wrote:
    Is there any update for this question ???
    Edited by: P.Ranish on Dec 13, 2012 3:36 AMNo, And there won't be in the future.
    Please stop posting followup's to old threads, if you have a real problem please search the forum first and post a new question with all information
    Roel wrote:
    Try using &P5_RUNNING_TOTAL. or #P5_RUNNING_TOTAL#Just to make it clear - this will only work if page is reloaded after setting the item values dynamically via AJAX

  • Handling dynamic item data in VSTS

    Hi Team,
    Can you please let us know how to handle dynamic item data in VSTS.
    Regards
    Raghavendra
    8105577088

    Hi Raghavendra,
    Based on your previous threads posted by you in the test forum, I doubt that you want to create the coded UI test, am I right?
    If so, which kind of app did you want to test, WPF or others? Could you share us a screen shot about the real UI controls you want to test? What real Controls you want to test, list item controls or others?
    You know that to find a control in coded UI test, we have to use the unique peoperties as the search properties, so if your controls are dynamic, the real issue would be related to the search properties you use in your code.
    Like this case:
    https://social.msdn.microsoft.com/Forums/en-US/4c4805f0-230d-459d-a3e5-61e62746c5b9/list-box-item-is-not-get-selected-while-play-back-the-recorded-script-in-coded-ui-test?forum=vsautotest
    As Pankaj's suggestion, if the list items are dynamic then you can use the index values instead of the innertext, so the real issue would be related to how to use the search perperties in your side. If you item text value is dynamic, you'd better not
    use the text value as the search properties. 
    About "How does “Coded UI test” finds a control ??", reference:
    http://blogs.msdn.com/b/balagans/archive/2009/12/28/9941582.aspx
    If I have misunderstood this issue, please feel free to let me know.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Programmatically set dynamic items in selectOneRadio from mbean

    Hello all,
    Looking for an example of how to dynamically set values from an mbean on a selectOneRadio component. I see that I can bind this component to my mbean which then provides getters and setters, but its unclear to me how I would be able to create additional radio select values dynamically.
    Any help is appreciated,
    -Wraith

    Hi,
    if you use a ADF Business Components you can create a row about the VO of the selectOneRadio
    another possibility is that you have a List and go adding items
    https://blogs.oracle.com/vijaymohan/entry/binding_your_selectonechoice_to_a
    http://adfdevelopers.blogspot.com.es/2009/06/how-to-implement-drop-down-list-in-adf.html

  • How to make a tabular form readonly based on an item value

    Hi everyone,
    I am getting there, but I need to make a tabular form read-only based on an item value.
    I've copied this from somewhere (thanks) and changed it for my needs and it works great to set the second column of my form
    to read only.
        var els = jQuery('#Entry_Form input[name="f02"]');
        /*var r = confirm("els is " + els);*/
        els = els.filter(function(index){
          return jQuery(this).val() != "";
        });Just need to set the jQuery selector to jQuery("td[headers='PRODUCT_NAME']"), cos that's my column name.
    also need to give a static id of Entry Form to the form.
    I'll try to understand what this code means exactly one of these days, but now I need to make
    the whole tabular form read only based on a text item, :P5_CONTROL.
    Grateful for any help on this, in the above format if possible. Greek to me but compact and it works.
    Regards.
    Leckraj

    Hi,
    actually, there is no code, just one dynamic action. You may have to change the event which triggers it.
    Event: Change
    Selection Type:     Items(s)
    Item(s): P1_ED     
    Condition: equal to     
    Value: D
    True Action 1
    Action: Disable
    Fire On Page Load: yes
    Selection Type: jQuery Selector
    jQuery Selector: input[id^="f"]
    True Action 2
    Action: Disable
    Fire On Page Load: yes
    Selection Type: jQuery Selector
    jQuery Selector: input[id="check-all-rows"]
    False Action 1
    Action: Enable
    Fire On Page Load: yes
    Selection Type: jQuery Selector
    jQuery Selector: input[id^="f"]
    False Action 2
    Action: Enable
    Fire On Page Load: yes
    Selection Type: jQuery Selector
    jQuery Selector: input[id="check-all-rows"]
    Regards, Garry

  • Setting an item value before print report in BI Publisher

    Hi,
    I am having an issue with setting a page item's value once a button (that prints a BI Publisher report) is pressed. The session state for the item is set, however because the page does not re-load no value appears in the item on the page.
    I am using a button as a page Item and using a Page Branch with the Branch Point set as On Submit: After Processing(After Computation, Validation, and Processing) with the Page set to 0 and the Request set to PRINT_REPORT=REPORT
    Is there any way to set the item value on the page before branching to the report?
    Your help is greatly appreciated.
    -Marsha

    Marsha,
    You can do that as follows:
    1- create a hidden text item (P20_date_hidden) with default value set to sysdate.
    2- for your button >> edit >> Buttom display attributes >> attributes >> type in : onFocus= "set_date();" (( note: am using onFocus because it takes places before onClick ))
    3- In your page >> edit >> HTML header >> type in :
    <script language="JavaScript" type="text/javascript">
    function set_date()
    v_date = $x('P20_DATE_HIDDEN').value;
    $x('P20_DATE_LETTER_SENT').value = v_date;
    </script>
    Hope this helps,
    Sam
    Please reward good answers by marking them correct or useful!

  • Is it possible to know if an item value has changed

    Hi,
    I'm working on a form and need to know if an item value has changed without compare it with database_value of get_item_property. there is a button <save> on the form and i want to know when user click again and again on button save if this item value has changed. thanks for your ideas.

    Tabit7 - Posted: Apr 9, 2011 12:15 AMbut sometimes in query mode, the item is not navigable and its vallue changed and the prev_value did not work, perhaps the w-n-i-i do not fire>
    If you look up the trigger in the Forms Help system it will tell you if the trigger will fire in Query Mode. The WNII trigger will file in Query Mode where as the Pre-Text-Item trigger does not.
    i try an other way and it seems to work, i put a flag in w-v-i when database_value is different from block value and use this flag in button Save, thanks a lot for your idea it put me in the way. Glad you were able to find a way to resolve your issue. ;-)
    HamidHelal - Posted: Apr 10, 2011 9:27 AM can you please give an example of u'r idea ? >
    First, create a variable that is visible to the entire form. Many people would simply use a GLOBAL variable, but I do not like the limitations of GLOBALs and I don't like the fact that they are visible to the entire Forms sessions, not just my form. I prefer to use a Forms program unit (PU) Package Specification so I can explicitly define the variable data type (eliminates the need to cast the GLOBAL to the correct data type) and the variable only occupies the amount of memory needed to support the variable. Also, when I exit my form, the variable is automatically erased.
    /* Sample Forms PU Package Specification */
    PACKAGE Form_vars IS
       g_prev_val   VARCHAR2(50);
    END Form_vars;No that I've created a variable to store the Previous Value of an Item, I can write code to use it. I will use a Form Level When-New-Item-Instance (WNII) trigger to ensure I capture the value exiting value of the item before any changes.
    /* Sample WNII trigger */
    BEGIN
       Form_vars.g_prev_val := Name_in(:system.trigger_item);
    END;This is a very simple example. There are many other ways to implement this method; such as using the Pre-Text and Post-Text-Item triggers as Abdetu suggested.
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

Maybe you are looking for

  • Is there any way to restore history in Firefox 3?

    Earlier today I quit Firefox. When I opened it back up, there was an add-on that needed to be updated. The update window acted odd (refused to go to the background). While it was updating, I accidentally opened and then closed a window in Firefox. Lo

  • Multi-language Help in a multi-language web app

    Hello! I had posted this on the RH HTML forum but removed that and posted here for a wider audience... ***Please note: this question is not specific to RH but is applicable now that RH 7 is unicode enabled. If you have experience that does not relate

  • BASIC Questions about JavaMail

    Hi Everyone I have some very basic questions about java mail. I have a weblogic web server. I think it's version 5 or something like that. when a user clicks a form on my application sends some information to my database (via my jsp/java program) , I

  • How to put in low quality without use the mouse ?

    Hello, I look for a means to put an flash player application in low quality by passing only by the keyboard. By example, for put in high quality, I can use the hotkey shortcut ctrl + h. I search that too for the option 100% and "afficher tout" (in fr

  • How do I order prints from more than one Photo in Aperture?

    I can figure out how to order prints through Apple for ONE photo but can't find how to add more photos to the order.  Is there a manul for Aperture 3.4.5 version? This whole program has me confused.  I need a manual I think.  Thank you.