Setting values to Display Only item during AJAX request

Hello,
Good Morning!
In a master-detail form, in the detail report, I am populating two columns SERVICE_TAX_PCT and SERVICE_TAX_AMOUNT by making an AJAX request after selection of ACCOUNT_CODE.  Values are populated with out any issue. 
However, as soon as I make those two fields as Display Only, the values are not getting set.  Is there a way to set the values to a field in the same time it should be restricted for user to change it?
(APEX 4.2.6)
Thanks,
-Anand

Hi Anand,
anand_gp wrote:
Hello,
Good Morning!
In a master-detail form, in the detail report, I am populating two columns SERVICE_TAX_PCT and SERVICE_TAX_AMOUNT by making an AJAX request after selection of ACCOUNT_CODE.  Values are populated with out any issue.
However, as soon as I make those two fields as Display Only, the values are not getting set.  Is there a way to set the values to a field in the same time it should be restricted for user to change it?
(APEX 4.2.6)
check the example
Step 1: Edit your page
under CSS->Inline put the code given below
.row_item_disabled {
   cursor: default;
   opacity: 0.5;
   filter: alpha(opacity=50);
   pointer-events: none;
Step 2 : I guess you have Javascript function similar like given below
you have to extract rowid first, for which you want to set the percentage , see line 6
and see line 18, for disabling the column of that row.
<script type="text/javascript">
   function f_fetch_tax_percentage(pThis) {
   var ajaxRequest;
   var ajaxResult;
   var row_id = pThis.id.substr(4);
   var percentage    = 'f05_' + row_id;   // replace f05 with the rowid of percentage column
   ajaxRequest = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=TAX_DTLS',0);
   ajaxRequest.addParam('x01',$v(pThis));
   ajaxResult = ajaxRequest.get();
   if ( ajaxResult.length > 0 ) {
   // set percentage
   $('#'+percentage).val(parseFloat(ajaxResult));
   // disable percentage column
   $("#f05_" + row_id).attr("readonly", true).addClass('row_item_disabled');        
</script>
Hope this helps you,
Regards,
Jitendra

Similar Messages

  • Set value of a display only item using javascript

    I was trying to find an answer in the forum but my searches gave me no results. How do
    I set a value of a display only item using javascript (ajax)?
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

    Vikas,
    Thanks for a fast responding. The type is Saves State. However, I tried to set the value
    of a display only item using:
    <script>
      function f_setDisplayOnly ()
        {$x('P80_X').parentNode.childNodes[4].nodeValue = 1;
    </script>without a result (or error). What am I doing wrong?
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Why cannot I use hidden or display only item to store value for insert?

    hi, Gurus:
    I have a question:
    I implemented a form with report region in a page, the update works OK, but the add function has a problem:
    There is a column, offender_ID, which is a foreign key for another table, it should not be null during insert. However, even I pass the offender ID from master page when user click the create button, and it did shows in the form, it must be a text filed to insert successfully, why cannot I use hidden or display only item to store this value for insert? (If I use hidden or display only item, insert won't be successful, apex reports I tried to insert a null value to offender_ID column.)
    Many Thanks in advance.
    Sam

    Hi,
    There is a column, offender_ID, which is a foreign key for another table, it should not be null during insert. However, even I pass the offender ID from master page when user click the create button, and it did shows in the form, it must be a text filed to insert successfully, why cannot I use hidden or display only item to store this value for insert? (If I use hidden or display only item, insert won't be successful, apex reports I tried to insert a null value to offender_ID column.)I think both hidden and display items have attributes that can cause problems because of different ways these items function than non-hidden and non-display-only items function. Display Only items have a "Setting" of "Save Session State" Yes/No? That can be a problem.
    Would you do this? Make these items regular items instead and see if you can get those working. Then, we will try to change the fields back to hidden or display only.
    Howard
    Congratulations. Glad you found the solution.
    Edited by: Howard (... in Training) on Apr 11, 2013 10:26 AM

  • Displaying diff dates using PL/SQL expression for 'display only' item ?

    Hi ,
    I am having a display only item -- :P2_FROM_Date . If its Thu,Fri,Sat or Sun I want to set the date as the last Monday's date . If its Mon,Tue or Wed then it should be the present Monday's date .
    E.g: Today is Friday and the last Monday was on 18th .
    So for yesterday , today,tomorrow and Sunday , the date should be displayed as 18-JUN-2012.
    From the coming Monday to Wednesday , the date should of be the coming Monday i.e , 24-JUN-2012
    I tried it doing under 'Source ' of item using PL/SQL expression and PL/SQL function body. Not working
    Can someone help ?
    Thanks & Regards
    Umer

    Nice1 wrote:
    declare
    lv_date number;
    begin
    select to_char(sysdate,'D') into lv_date from dual;
    if lv_date=2 then
    :P2_FROM_DATE := to_char(sysdate-1);
    end if;
    end;I tried this under " PL/SQL function body " in "Source " tab of the item P2_FROM_DATE
    When I run this , nothing is displayed corresponding to the item P2_FROM_DATEExactly as expected. This code will only set a value for <tt>P2_FROM_DATE</tt> when run on Mondays in territories where the first day of the week is Sunday, and when run on Tuesdays where Monday is the first day of of the week:
    SQL> var P2_FROM_DATE varchar2(30)
    SQL> alter session set nls_date_format='Dy DD-MON-YYYY';
    Session altered.
    SQL> select sysdate from dual
    SYSDATE
    Mon 25-JUN-2012
    SQL> alter session set nls_territory='AMERICA';
    Session altered.
    SQL> declare
      2  lv_date number;
      3  begin
      4  select to_char(sysdate,'D') into lv_date from dual;
      5  if lv_date=2 then
      6  :P2_FROM_DATE := to_char(sysdate-1);
      7  end if;
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL> print p2_from_date
    P2_FROM_DATE
    Sun 24-JUN-2012
    SQL> alter session set nls_territory='UNITED KINGDOM';
    Session altered.
    SQL> exec :p2_from_date := null
    SQL> declare
      2  lv_date number;
      3  begin
      4  select to_char(sysdate,'D') into lv_date from dual;
      5  if lv_date=2 then
      6  :P2_FROM_DATE := to_char(sysdate-1);
      7  end if;
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL> print p2_from_date
    P2_FROM_DATE
    SQL>Hence the questions about language above.
    >
    I am having a display only item -- :P2_FROM_Date . If its Thu,Fri,Sat or Sun I want to set the date as the last Monday's date . If its Mon,Tue or Wed then it should be the present Monday's date .
    E.g: Today is Friday and the last Monday was on 18th .
    So for yesterday , today,tomorrow and Sunday , the date should be displayed as 18-JUN-2012.
    From the coming Monday to Wednesday , the date should of be the coming Monday i.e , 24-JUN-2012
    >
    The coming Monday is 25-JUN-2012.
    Aren't these rules equivalent to "Monday this week, where Monday is the first day of the week"? In which case the PL/SQL Expression you require is:
    trunc(sysdate, 'iw')For example:
    SQL> with t as (
      2    select date '2012-06-21' + level d from dual connect by level <= 17)
      3  select
      4            d
      5          , trunc(d, 'iw')  monday
      6  from
      7            t;
    D               MONDAY
    Fri 22-JUN-2012 Mon 18-JUN-2012
    Sat 23-JUN-2012 Mon 18-JUN-2012
    Sun 24-JUN-2012 Mon 18-JUN-2012
    Mon 25-JUN-2012 Mon 25-JUN-2012
    Tue 26-JUN-2012 Mon 25-JUN-2012
    Wed 27-JUN-2012 Mon 25-JUN-2012
    Thu 28-JUN-2012 Mon 25-JUN-2012
    Fri 29-JUN-2012 Mon 25-JUN-2012
    Sat 30-JUN-2012 Mon 25-JUN-2012
    Sun 01-JUL-2012 Mon 25-JUN-2012
    Mon 02-JUL-2012 Mon 02-JUL-2012
    Tue 03-JUL-2012 Mon 02-JUL-2012
    Wed 04-JUL-2012 Mon 02-JUL-2012
    Thu 05-JUL-2012 Mon 02-JUL-2012
    Fri 06-JUL-2012 Mon 02-JUL-2012
    Sat 07-JUL-2012 Mon 02-JUL-2012
    Sun 08-JUL-2012 Mon 02-JUL-2012
    17 rows selected.
    SQL> alter session set nls_territory='AMERICA';
    Session altered.
    SQL> alter session set nls_date_format='Dy DD-MON-YYYY';
    Session altered.
    SQL> with t as (
      2    select date '2012-06-21' + level d from dual connect by level &lt;= 17)
      3  select
      4            d
      5          , trunc(d, 'iw')  monday
      6  from
      7            t;
    D               MONDAY
    Fri 22-JUN-2012 Mon 18-JUN-2012
    Sat 23-JUN-2012 Mon 18-JUN-2012
    Sun 24-JUN-2012 Mon 18-JUN-2012
    Mon 25-JUN-2012 Mon 25-JUN-2012
    Tue 26-JUN-2012 Mon 25-JUN-2012
    Wed 27-JUN-2012 Mon 25-JUN-2012
    Thu 28-JUN-2012 Mon 25-JUN-2012
    Fri 29-JUN-2012 Mon 25-JUN-2012
    Sat 30-JUN-2012 Mon 25-JUN-2012
    Sun 01-JUL-2012 Mon 25-JUN-2012
    Mon 02-JUL-2012 Mon 02-JUL-2012
    Tue 03-JUL-2012 Mon 02-JUL-2012
    Wed 04-JUL-2012 Mon 02-JUL-2012
    Thu 05-JUL-2012 Mon 02-JUL-2012
    Fri 06-JUL-2012 Mon 02-JUL-2012
    Sat 07-JUL-2012 Mon 02-JUL-2012
    Sun 08-JUL-2012 Mon 02-JUL-2012
    17 rows selected.Also note that using the item source properties will only set the <tt>P2_FROM_DATE</tt> in the rendered page, not in session state.

  • Dynamic hyperlinks as Display Only item?

    Hi, I need to add a hyperlink on a page, and the hyperlink will partially be derived from a page item on that page.
    When I put a Display Only item on that page, with the source type as Static Assignment and set to something like:
    <a href="http://webserver/page.html?number=:P2_NUMBER">blah</a>It displays exactly that, ignoring the HTML, and doesn't display it as a link.
    Simple I'm sure, but what am I doing wrong?

    What you set for the item would be its value (of an input HTML item)
    Try adding it to post or pre-element text of the item as
    &lt;a href=&quot;http://webserver/page.html?number=&P2_NUMBER.&quot;&gt;blah&lt;/a&gt;

  • Mapping display only item to three output parameters from a procedure?

    Hi all
    I have a procedure with three output parameters, which I would like to map the three output parameters to three display only items on the page.
    there is a page process called the procedure, which output statement1,statement2,statement3 parameters.
    I have three items on the page which I would like to map them to the three parameters respectively,
    how can I achieve this?
    thanks

    Rajesh,
    please check if this following proposal could serve you.
    Define the Query with mode FixedQueryWithOutput. In the package define a ref cursor as IN OUT parameter. To get your 3 values back, open the cursor in your procedure like "Select val1, val2, val3 from dual". Then the values should get into your query.
    Here is an example how this could be defined.
    Package:
    type return_cur IS ref CURSOR;
    Procedure:
    PROCEDURE myProc(myReturnCur IN OUT return_cur) ...
    OPEN myReturnCur FOR SELECT val1, val2, val3  FROM dual;
    Query:
    DECLARE
      MYRETURNCUR myPackage.return_cur;
    BEGIN
      myPackage.myProc(
        MYRETURNCUR => ?
    END;
    Good luck.
    Michael

  • How to force carraige return in display-only item

    Can I somehow force a carraige return in the text for a display only item? Aesthetically, I'd would like to have strategically-placed line breaks.
    Thanks,
    C

    Scott -- Sorry, I posted the wrong example entirely. Here's the assignment statement. If it isn't clear I'll try to put an example on apex.oracle.com... which I've not done before, so would be another learning experience :)
    :P1_MESSAGE_1 := 'my display text line1< br>my display text line2';
    My assignment statement is exactly the same format as what you posted on
    Jul 29, 2008 2:51 PM, with the space after the opening bracket removed, as you
    indicated it should be.
    :P1_MESSAGE_1 is a display only, saves state item. After the assignment
    statement (and submit), what is displayed is exactly what's in the single quotes, including the brackets and the "br" -- the html doesn't appear to be recognized as such:
    Item display is: my display text line1< br>my display text line2
    Does this clarify what I'm doing?
    Thanks,
    C

  • Pageflow variable values don't hold between two ajax requests

    I have pageflow application(Portal) where I have implemented typeAhead(like google suggest with AJAX) for two select boxes. Here I have to inform the server of the firstbox value after it is selected(with AJAX) to save it in pageflow variable so that for next request(while typing in second select box), the corresponding select option data determined by first selection has to be returned. But I see that pagflow doesn't hold values between subsequent ajax requests.But as per BEA Pageflow description values are retained till the end of session.
    Does it have anything to do with the ajax requests which are not normal HTTP browser requests? Plz any suggestions are welcome.

    Hi
    Thanks for reply,
    I know that you said, because I did some ABAP programs and some ABAP reports of the bussiness process of Collateral Objects, with information of these tables and when I tried get information,  I did something like you said, or I assigned cms_ast-object_ref_id to a variable, and this varible I converted to the same type of the other field and find the match or join between the tables(cms_movables, cms_ast).
    The problem is not when I do an ABAP program. The problem is:
    (BO)Business Objects needs to get some information about these tables to do some reports, but  BO has not the tools or the capacity to convert  fields, as well as ABAP. BO gets information directly of the tables of database.
    The posible solution to this problem is that I can create a job and a program, which function is replicate the information of cms_ast and insert on a "z" table or get the relation between to tables (cms_movables and cms_ast) and insert on a "z" table. These can help BO to get information, because BO instead of get information of this tables (cms_movables, cms_ast) , now get information of the table z and then get and join with other tables.
    The principal problem is that BO get information online, with these the job which run the program need to be run minute per minute. and I think that it is not the best practice, because all the tables are some scalables.
    I think that my program could be better, how can I catch a INSERT event on table cms_ast, to convert the fields, and insert on a "z" tables
    Or anybody have an idea, how can i solve these problems?

  • Permission denied during Ajax request

    Hi All,
    I have webapp wich contain ajax cross-domain request using Apache Proxy.
    When i try to load page in Safari and creat ajax request i see "Permision denied" error. In othe browser as IE and FF i dont have this problem.
    If i try create ajax request without proxy to a local server when i dont have this error.
    Can anybody help me?
    Thanks.

    Did you ever get a response or a solution to this?

  • How to pass the whole set of values of a shuttle item in AJAX

    Hi,
    I am trying to pass the value of shuttle item to a dynamic process using Ajax. But if I use shuttle_right, I am able to get only the first selected value. If I simply give shuttle it returns null.
    Please let me know How I can get the whole set of values separated by ':'
    Thanks,
    Vikas

    Vikas,
    Here's a little snippet that should get you going:
    var shtVals = '';
    var shuttle = new dhtml_ShuttleObject("PXX_SHUTTLE_LEFT","PXX_SHUTTLE_RIGHT");
    for (x=0; x<shuttle.Op1Init.length; x++) {
       shtVals += shuttle.Op1Init[x].value + ':'; //Op1 = left & Op2 = right
    shtVals = shtVals.replace(/:$/,'');
    alert(shtVals);Regards,
    Dan

  • Set value of hidden database item

    I have a simple non-tabular form for creating rows in a table. I need to set the value of a hidden database item to be the same as a database item which the user enters.
    I know this can be done by a database trigger and also by a custom update process, but is there other (simpler) way to do this ?
    Vincent

    Vincent,
    By "hidden database item", I'm assuming that you mean a column in a table. By "database item which the user enters", I'm assuming that you mean a page item on your form. If that's correct, just edit that item in the builder, making its source type 'Database Column' and its source the column name, and the automatic row fetch and DML processes on the page will take care of the rest. If you mean something else, let us know.
    Scott

  • Defaulting Values and Read-Only Items?

    Hi All,
    Brand new to APEX and trying to think of ways to get a few things working for me hoping you might have some suggestions.
    1. Want to have a few items default upon the creation of a record.
    - Created Date - have a column/page item that I would like to default/auto populate with the current date
    - Create by - would like to have column/page item default with the login id of the user
    2. Dynamically make page/items read-only.
    - Once a record is created I would like to ensure that the only person able to edit the record would be the creator. I assume I can use the Read Only feature at the item level but am unsure of the syntax to use to make the item read-only for only the user who created/or is creating the record. Since I would like to be defaulting the "Create by" (see question 1) column to the login id of the user this should be plausible just not sure of the syntax to reference the current user id.
    3. Passing a value to to bind variable.
    - I have build a basic page with an Interactive Report and have made one of the columns in the Interactive report 'linkable' which launches a BI Publisher report by calling a Report Query. Currently in my report query I have hard coded a value in the SQL statements where clause to prove the theory works what I am struggling with is a declarative way to pass the value that I am clicking to a bind variable in my SQL statements where clause in the query.
    Thanks in advance for any suggestions and appreciate your patience with an APEX newbie .. about 2 days old at this juncture. The more specific you can be on what to do and where to go is greatly appreciated.
    For those interested in have greater control with your report layout BI Publisher looks to be a great options. I was able to getting by reviewing [how to document:|http://www.oracle.com/technology/products/database/application_express/howtos/howto_master_detail_pdf.html] on OTN. My challenge some in the fact that rather then simply being on the exact row that I want reported on I would like to simply click on a link in a list and pass that value as the bind variable.
    JES

    Hi -
    "1. Want to have a few items default upon the creation of a record."
    This is typically done in a trigger at the db level.
    CREATE OR REPLACE TRIGGER mytrigger
    BEFORE INSERT OR UPDATE
    ON mytable
    REFERENCING NEW AS new OLD AS old
    FOR EACH ROW
    BEGIN
      if (:new.CREATED_DATE is null)
        then
          :new.CREATED_DATE := sysdate;
        end if;
      if (:new.CREATED_USER is null)
        then
          :new.CREATED_USER := nvl(v('APP_USER'),user);
        end if;
      :new.UPDATED_DATE := sysdate;
      :new.UPDATED_USER := nvl(v('APP_USER'),user);
    END CREATE OR REPLACE TRIGGER mytrigger;"2. Dynamically make page/items read-only."
    See 'APP_USER' in the Apex docs...
    "3. Passing a value to to bind variable."
    This is done in the report configuration in the Apex UI...
    Session State Include application and session information.
    You might want to consider reviewing some of the Apex docs and tutorials, I recommend this:
    [http://download.oracle.com/docs/cd/E14373_01/appdev.32/e13367/toc.htm]
    Good luck.

  • How to set value from LOV only as a default reference not enforce validate check?

    In jdev 11.1.2.3,
    By creating  List of Value(LOV) for an attribute of a VO, I can get default value for the current VO's attribute from the lookup table, but it will also enforce a validate check for that value.
    If I input a value which is not in the lookup table, then errors will raised.
    Now I hope I can get default value from LOV, and can also input some new value (and this new value can be insert into the lookup table by a database trigger) for the attribute/field without failure to pass the check.
    Any one can help?
    Thanks!

    Hi, Arun
    Your suggestion let me get to know how to create a new record in the customeActions facet of inputComboBoxListOfValues, which I donot know before. It's great. and thank you very much.
    However, my current issue is a different requirement, let me describe it clearly as:
    I have a formlayout to input a field value which can be from a lookup table, or if this value is not in the lookup table then it can also be input without raising value validation check failure.and this new value can be added to the lookup table at the same time.
    for example, there is a FK attribute deptno in the EMP table, in a form for editing EMP attributes, user can input deptno value which is already in the DEPT lookup table by selecting from a LOV. also can input some new value which cannot be selected from the LOV, and this new deptno value will be posted to database both in EMP and DEPT table.
    The issue is, after create a LOV for deptno attribute in EMP VO, there will be a enforced value validation check, so new values cannot be input in EMP unless it is input into DEPT first.
    (http://docs.oracle.com/cd/E37975_01/web.111240/e16182/lists.htm#BABBJFBB)
    List of values are designed to return valid values only. As a result, validation rules defined on data source view object attributes will be suppressed.
    My question is: how to disable this enforced value validation for a LOV-enabled field?
    (There is other means to ensure user will input valid value for this field, for example ask him to double input.)
    Thanks again!
    bao

  • Not displaying all items during MIGO

    Hi All,
    When I try to do the goods issue for process order thro MIGO, the system is not showing all the line items. When I select the process order and do the Adopt in the overview, it is showing all the line items. Is there any settings to be done to show all the line items when I entered the process order.
    Regards,
    Sureshbabu G.

    It's possible that these missing items are flagged as backflushed components
    Check if they are in the production order material list

  • VA01 Item category display only for specific order type

    Hi,
    I have a requirement to deactivate(display only) item category field in VA01 table item for certain order type . I tried the user exit  MV45AFZZ(USEREXIT_FIELD_MODIFICATION). This is working only if the table item has a value. i.e I could able to enter an item category first and then enter the material and quantity.
    So please suggest any alternative how to make the item category field(VBAP-PSTYV) column display only for centrain order type.
    Regards
    Aromal R

    Hi,
    Create a Custom Authorization Object so that you can control it for certain users.  2. Write implicit enhancement spot in the include TCS MV45AF0T_TCTRL_U_ERF_AUFTRAG_I,
    FORM TCTRL_U_ERF_AUFTRAG_INIT
    AUTHORITY-CHECK OBJECT 'ZITMCAT'
              ID 'ACTVT' FIELD '02'.
    IF SY-SUBRC NE 0.
    *    DATA: WA_COLS LIKE LINE OF TCTRL_U_ERF_AUFTRAG-COLS.
    LOOP AT   TCTRL_U_ERF_AUFTRAG-COLS INTO WA_COLS.
       IF WA_COLS-SCREEN-NAME = 'VBAP-PSTYV'.
       WA_COLS-SCREEN-INPUT = 0.
       WA_COLS-SCREEN-OUTPUT = 1.
      MODIFY TCTRL_U_ERF_AUFTRAG-COLS FROM WA_COLS.
       ENDIF.
    ENDLOOP.
    ENDIF.
    Regards
    Aromal R

Maybe you are looking for