recovery of Ajax callback

I just wrote my first Ajax code and am looking for a more elegant way back the reminder of the page of the ColdFusion server.  My reminder page returns these data: < html > < body > < div > 6 < / div > < body / > < / html > right now I use this Javascript to retrieve the 6 from inside the div tag: (data = string sent by server page) var divloc = data.indexOf('div'); var callback = data.substr (divloc + 4, 1);  Is there a better way to recover the 6 of these HTML tags, or could I get the server page to just 6, without the HTML code, return to the calling page?

Solved this myself; data = $(data) () .text;  seem to recall data in a reliable form usable by the rest of my functions.

Tags: ColdFusion

Similar Questions

  • Ajax callback gives a blank page

    Hello

    I'm new to Apex and I have a question about the use of Ajax callbacks...

    My app keeps some baseline data for an entity. For each attribute of the entity, the user is able to view a list of data sources in the attribute and the attribute value provided by each source. The user can then select one of these values that they consider as correct.

    To implement this I used a report region, with a classic report. For each line, I've included a dummy column that I have specified as a link. The idea is that the user click on the link for the line, that they want to choose, an API updates the accorndingly database and the screen is refreshed to show the new State.

    The link column is defined with the relevant details, as follows:

    Target: the page itself

    Request: APPLICATION_PROCESS = MY_API

    Item1: PX_ROW_KEY = > #ROW_KEY #.

    PX_ROW_KEY is a hidden page element.

    The MY_API process is defined as an Ajax callback as follows:

    Address the point: on request

    Source: my_pkg.my_api (p_row_key = >: PX_ROW_KEY);

    Works well; When the user clicks on the link, the API is executed and I can see that the database has been updated. The problem is that the user is presented with a blank page and use the back button to return to the original page.

    How can I get the application to revert to the original of the page once the Ajax callback / API has finished? Or do I have to use a different approach to achieve the same effect?

    It's about Apex 4.2.4 and Oracle 12.1.

    Thank you very much

    Mike

    Hello

    Check your sample now.

    I have change the column request link, point process for the process of your page and also I created branch to the same page.

    This isn't something to do with "Ajax", but I think your page is working now as you indented

    If you really want it with Ajax, then a totally different approach, I think.

    Kind regards

    Jari

    Post edited by: jariola

    In fact I branch created, is not necessary. Example of not to submit the page, it redirects.

  • AJAX callback

    Hi all

    I try to use the reminder for ApEx feature. I tried to use a sample of Oracle provided the type of printing just a simple "Hello World" of the process using AJAX callback. It seems that my code does not run, so I do not know how to proceed.

    The example code I've used Oracle is located in http://apex.oracle.com/pls/otn/f?p=11620:63:366817572353630:NO: For more convenience, I copied the code example below:
    <script>
    function f_TestOnDemand(){
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=mytestprocess',0);
    get.add('TEMPORARY_ITEM',$x('P11_TEST').value)
    gReturn = get.get();
    get = null;
    
    }
    
    </script>
    The code I have written, based on the example above is a makeup of a Java function and application process on. The Java code is as follows:
    <script>
    function f_TestOnDemand(){
    
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=mytestprocess',305);
    get.add('TEMPORARY_ITEM','HELLO from Java');
    gReturn = get.get();
    get = null;
    
    }
    
    </script>
    The application process on named 'mytestprocess' is encoded as follows:
    begin
    
    
    htp.prn ('Hello from on demand process');
    htp.prn ('Hello from temporary item' || :TEMPORARY_ITEM);
    
    end;
    Can someone help me understand why I get all the outputs of this code? The ultimate goal is to change the State of a session via AJAX callback, but I can't get AJAX callback to run at all.

    I use APEX version 4.0.1 in an Oracle 11.2.0.1 database.

    Published by: ncroston on December 15, 2010 08:49

    Hello

    The process will not directly print to the page, you must do so using javascript.

    Try adding:

    alert(gReturn);
    

    or

    document.write(gReturn);
    

    Andy

  • AJAX tabular form on a region plug

    I'm currently building a plugin in the region where I want to perform some AJAX operations in table form.

    The region of plugin uses a SQL Developer provided to build a list of objects that can be manipulated by the user. I want to JavaScript that manipulates the objects to return the results to the database via an AJAX call. However, whenever I try to add parameters to the call of htmldb_Get with the add method that refer to elements, the get method responds with an HTML page that contains the error text next:

    < b > Unexpected error, unable to find the name of the option at the page or application level.
    Error
    ERR-1002 cannot find the item for the "Pxx_ITEM_NAME" element ID in the "110" < /b > application

    How can data returned to the region plugins ajax callback without requiring an application set or a page element?

    Assuming that the following code, where ajax_identifier is the result of a call to apex_plugin.get_ajax_identifier:
    var get = new htmldb_Get(null,$v('pFlowId'),'PLUGIN=ajax_identifier',$v('pFlowStepId');
    I tried the following excerpts:
    get.add('f01','some value');
    get.add('x01','some value');
    and
    get.add('Pxx_PAGE_ITEM','some value');
    Only this one works as long as Pxx_PAGE_ITEM is an existing page item or a component of global demand. However, what I want to do is to return an array of values as if I were making a custom recording Multiple update and access from the ajax call back function.

    Sentinel wrote:
    I tried the following excerpts:

    get.add('x01','some value');
    

    In this case, I think that what you are looking for is:

    get.addParam('x01','some value');
    

    Using item-level, it seems that get 10 possible attributes, a bit like the application process:

    The recall of the procedure of the AJAX features in the same way as an application process and access the credits apex_application.g_x01 - g_x10 of global variables to transfer data from the browser to the main server. It can also say read and set session as an application process.

  • Re: Problems reinstalling Toshiba Utilities drivers

    Hello everyone!

    I recently bought a Satellite U500 - 1 8 and decided to install Windows 7 Ultimate from zero. So I formatted the drive and it instaled. After that, I downloaded all the drivers available from Toshiba Web site. The problem is that I couldn't find the drivers of the following utilities:

    -Manual Toshiba
    -Toshiba online product information
    -Toshiba Recovery Media Creator
    -Toshiba Recovery Media Creator callback
    -TRORMCLauncher

    Apreciate any help!

    Thank you

    Heraldo of Portugal

    > The problem is that I couldn't find the drivers of the following utilities:

    > Manual Toshiba

    You can check the manual, supplied with your laptop or download it in pdf format from Google

    > Toshiba online information products

    You can go to the toshiba page and find information

    > Toshiba Recovery Media Creator

    > Toshiba Recovery Media Creator callback

    > TRORMCLauncher

    These are special utilities Toshiba, that those who are not available to download at all

  • How a select list to cascaded in a table?

    Hello

    I would like to know how to create a pick list cascading tabular.

    In the screenshot next, for example, when select "2081: Alice Fan", the next filed should watch only "ID: name of the element" belongs to Alice.

    Screen Shot 2015-07-17 at 16.35.32.png

    Usually I do this simply for an article by implementing the SQL query and cascade LOV parent as follows.

    However, I can't find it in the form of tables?

    Screen Shot 2015-07-17 at 16.37.16.png

    Screen Shot 2015-07-17 at 16.37.25.png

    One can help with the solution?

    I hope that this can be done to reload partially after the first field had changed, but not to present an entire page.

    Thank you!

    Alice

    Hi AliceFan-Oracle,

    AliceFan-Oracle wrote:

    Please see application 81653, page 2 (Test in the navigation menu).

    It's the ERT_TABLE_Item.

    If 'point ERT ID' is cascaded by ERT ID,

    When select "2221" ERT ID, it takes only the concerts "2521" and "2541" at the point of the ERT ID.

    When select "2222" ERT ID, it takes only the concerts '2561"in ERT item ID.

    ID ERT and ERT tabular item ID are columns 29th and 30th.

    Check your Application-> Page 2 81653 on your instance of apex.oracle.com. I implemented the LOV cascading using the solution of Jari.

    Reference: APEX Blog of Jari: Article Cascading select list in the form of

    Here are the steps how this is implemented:

    • Edited your Page attributes-> section JavaScript-> 'Function and Variable global statement' has added the following code:
    (function($){
    
    /*** Cascading select list ***/
    $.fn.htmldbCascade=function(parent,onDemand,options){
    
      options=$.extend({
       trigger       : false,
       extrVal       : false,
       nullShow      : false,
       nullValue     : "",
       nullDisplay   : "- Select -",
       disAlias      : "DIS",
       retAlias      : "RET",
       loadingTxt    : "Loading ...",
       loadingCss    : {"width":"80px"}
      },options);
    
      return this.each(function(i){
    
       var self=$(this);
       var lParent=$(parent).eq(i);
       var lSelfVal=self.val();
       if(!lSelfVal){lSelfVal="";};
    
       if(!lParent.data("htmldbCascade")){
        lParent.change(function(){
    
         var lParentVal=$v(this);
         if(!lParentVal){lParentVal="";};
    
         $.extend(options.loadingCss,{"height":self.parent().height()});
    
         self
          .hide()
          .empty()
          .parent()
          .find("div.ui-autocomplete-loading")
          .remove()
          .end()
          .append($("
    ",{"html":options.loadingTxt,"css":options.loadingCss}) .addClass("ui-autocomplete-loading")); if(options.nullShow){ appendOpt(self,options.nullDisplay,options.nullValue); }; $.post("wwv_flow.show",{ p_flow_id:"&APP_ID.", p_flow_step_id:"&APP_PAGE_ID.", p_instance:"&APP_SESSION.", p_request:"APPLICATION_PROCESS="+onDemand, x01:lParentVal },function(jd){ var lExists=false; $.each(jd.row,function(i,d){ if(d[options.retAlias]===lSelfVal){lExists=true;}; appendOpt(self,d[options.disAlias],d[options.retAlias]); }); if(options.extrVal&&!lExists){ appendOpt(self,lSelfVal,lSelfVal); }; self .val(lSelfVal) .show() .parent() .find("div.ui-autocomplete-loading") .remove(); if(options.trigger){self.trigger(options.trigger);}; },"json"); }).data("htmldbCascade",true).trigger("change"); } }); /*** Append option ***/ function appendOpt(pThis,pDis,pRet){ pThis.append( $("
    • Edited your ERT_ITEM_ID column and added the following code to query LOV:
    SELECT NULL d,
           NULL r
    FROM   DUAL
    WHERE  1 = 2
    
    • Application G_TEMP element created in shared components-> section elements of enforcement with Protection of Session State"set to"Unrestricted ".
    • Created AJAX callback information Page at the request of GET_ERT_ITEM_ID process with the following code:
    DECLARE
      l_sql VARCHAR2(32700);
    BEGIN
      IF APEX_APPLICATION.G_x01 IS NOT NULL THEN
        APEX_UTIL.SET_SESSION_STATE('G_TEMP', APEX_APPLICATION.G_x01);
        l_sql := '
          SELECT ERT_ITEM_ID||'': ''||VENDOR_ID DIS,
                 ERT_ITEM_ID RET
          FROM   ERT_TABLE_ITEM
          WHERE  ERT_ID = :G_TEMP
          ORDER BY 1
        ';
      APEX_UTIL.JSON_FROM_SQL(l_sql);
      ELSE
        HTP.prn('{"row":[]}');
      END IF;
      APEX_UTIL.SET_SESSION_STATE('G_TEMP', NULL);
    END;
    
    • Created the dynamic action named "Set LOV cascade after refresh and onload", with the following attributes:

    Event: After refresh

    Selection type: region

    Region: Update purchase order (15)

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: Yes

    Code:

    $("[name=f30]").htmldbCascade(
    "[name=f29]",
    "GET_ERT_ITEM_ID",{
      nullShow:true,
      nullDisplay:"- Select -"
    });
    

    Assigned items: no

    • 'Action' button "ADD a line" changed "defined by the dynamic Action. Created another dynamic action named "Cascading select list Set for the new line" with the following attributes:

    Event: click on

    Selection type: button

    Region: ADD Row

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: No.

    Code:

    apex.widget.tabular.addRow();
    $("[name=f30]:last").htmldbCascade(
    "[name=f29]:last",
    "GET_ERT_ITEM_ID",{
      nullShow:true,
      nullDisplay:"- Select -"
    });
    

    Assigned items: no

    Kind regards

    Kiran

  • Generate the command Id and insert data into two different tables: oracle apex 5.0

    I have three tables. name of the tables: PRODUCT, ORDER_HEADER, ORDER_DETAIL. I took REPORT inter ASSETS in which the VALUES from TABLE product. I need to use the trigger here, there is a TEXT ARTICLE called ORDER ID: it will generate through trigger. so whenever new order placed order id must be unique. There is a button when this button is clicked, the VALUES of REPORT must be inserted in to ORDER_HEADER , ORDER_DETAIL (in fact, I am in confusion is it even possible).

    I tried to create the trigger: not work if


    CREATE OR REPLACE TRIGGER "EMP_TRG1".

    Before Insert on order_header

    for each line

    Start

    If: new. Order_ID is null

    then

    Select lpad (demo_seq.nextval, 8, '0'): new. Order_ID order_header;

    end if;

    end;

    SQL:

    Select

    apex_item. Text(1,p.PRODUCT_ID) PID.

    PN.product_name,

    apex_item. Text(2,p.PRODUCT_QTY) qt.

    apex_item. Text(3,p.unit_price) upward,

    apex_item. Text(4,p.TOTAL_AMOUNT) am

    OMS_SHIP_CART_DETAIL p, pn OMS_PRODUCT

    where p.product_id = pn.product_id

    DA:

    var arr_f01 = [];

    var arr_f02 = [];

    var arr_f03 = [];

    var arr_f04 = [];

    var arr_f05 = [];

    product_id var;

    unit_price var;

    Var Qty;

    var total_1;

    () $("input[name='f01']").each

    function() {}

    product_id = $(this).closest('tr') .children ('td [headers = 'PID']') .text ();

    unit_price = $(this).closest('tr') .children ('td [headers = "Uprice"]') .text ();

    Qty = $(this).closest('tr') .children ('td [headers = "Qty"]') .text ();

    total_1 = $(this). Closest ('tr'). Children ('td [headers = "total"]'). Text();

    arr_f01.push ($(this).) Val());

    arr_f02.push (product_id);

    arr_f03.push (total_1);

    arr_f04.push (unit_price);

    arr_f05.push (Qty);

    }  );

    (apex). Server.Process

    "Insert a command."

    , {f01: arr_f01, f02: arr_f02, f03: arr_f03, f04: arr_f04, f05: arr_f05}

    }

    , {dataType: "text", success: function (pData) {alert ('added product') ;}}

    );

    Ajax callback:

    declare

    l_count number;

    Start

    -insert into OMS_ORDER_HEADER (USER_ID, TOTAL_AMOUNT, batch, ORDER_DATE) values(:P1_USER_ID,:P42_TOTAL,'PENDING',SYSDATE);

    I'm looping 1.apex_application.g_f01.count

    insert into OMS_ORDER_DETAIL (PRODUCT_ID, UNIT_QTY, UNIT_PRICE, TOTAL_AMOUNT)

    values (APEX_APPLICATION. G_F01 (i), APEX_APPLICATION. G_F03 (i), APEX_APPLICATION. G_F04 (i), APEX_APPLICATION. G_F05 (i));

    commit;

    end loop;

    end;

    Hi Dominique,.

    I create a process page away present in your application

    declare
      l_order_id varchar2(8);
    begin
      insert into order_header(ORDER_ID
                            , STATUS
                            , ORDER_DATE)
                      values(lpad(demo_seq.nextval,8,'0')
                            , 'Pending'
                            , sysdate)
      returning ORDER_ID into l_order_id; 
    
      for rec in(select ID
                      , QTY
                      , PRICE
                  from product)
      loop 
    
        Insert Into Order_Detail ( ORDER_ID
                                  , PRODUCT_ID
                                  , QTY
                                  , UNIT_PRICE)
                            Values(l_order_id
                                  , rec.id
                                  , rec.qty
                                  , rec.price); 
    
        commit;
      end loop;
    end;
    

    Please check and let me know.

    Kind regards

    Jitendra

  • To access the APEX_COLLECTIONS on another page

    Use: APEX 5

    One of my app pages (Page 12), I have a dynamic action that calls upon request AJAX callback process.

    The code of the dynamic action has the javascript call:

    var arr_f01 = [];

    () $("input[name='f01']:checked").each

    function() {}

    arr_f01.push ($(this).) Val());

    });

    (apex). Server.Process

    "Lines Checked process."

    {f01: arr_f01},

    {the data type: 'text',}

    Async: false,

    success: {function (pData)}

    $s ("P12_SELECTED", pData);

    }

    });

    The recall AJAX process is:

    Controlled process lines

    declare

    l_f01 varchar2 (2000);

    Start

    APEX_COLLECTION. () CREATE_OR_TRUNCATE_COLLECTION

    p_collection_name = > 'TEST_COLLECTION');

    l_f01: = ";

    delete from lrg_symptoms_select;

    because me in 1.APEX_APPLICATION. Loop G_F01. Count

    insert into lrg_symptoms_select values (APEX_APPLICATION. G_F01 (i));

    l_f01: = l_f01 | APEX_APPLICATION. G_F01 (i) | «, » ;

    end loop;

    APEX_COLLECTION. ADD_MEMBER)

    p_collection_name = > 'SPLIT_SYMPTOMS ',.

    p_c001 = > l_f01);

    Select c001 in: l_f01 of APEX_COLLECTIONS where collection_name = "TEST_COLLECTION";

    HTP.PRN (l_f01);

    commit;

    end;

    I have 2 questions here:

    1. After this process, I call a modal dialog (Page 9) page at the click of a button. The modal dialog box is to have an area of report that is supposed to display the data of this APEX_COLLECTION

    Select c001 in APEX_COLLECTIONS where collection_name = 'TEST_COLLECTION';

    But I get the following error

    Failed to parse the SQL query:

    ORA-00933: SQL not correctly completed command.

    How can I access the collection on the page of the modal dialog box?

    2. the value of the page (P12_SELECTED) in dynamic action element is not visible in the session state.

    The value is displayed on the page but when I check it in the session, it is null. Also when I pass this value to another page, it is delegated to as NULL.

    How to set the value of page element in the session?

    Thanks in advance

    Hina

    844372 wrote:

    Update your forum profile with a recognizable username instead of "844372": Video tutorial how to change username available

    I have 2 questions here:

    1. After this process, I call a modal dialog (Page 9) page at the click of a button. The modal dialog box is to have an area of report that is supposed to display the data of this APEX_COLLECTION

    Select c001 in APEX_COLLECTIONS where collection_name = "TEST_COLLECTION";

    But I get the following error

    Failed to parse the SQL query:

    ORA-00933: SQL not correctly completed command.

    How can I access the collection on the page of the modal dialog box?

    Remove the ';' the query.

    2. the value of the page (P12_SELECTED) in dynamic action element is not visible in the session state.

    The value is displayed on the page but when I check it in the session, it is null. Also when I pass this value to another page, it is delegated to as NULL.

    How to set the value of page element in the session?

    Set the value of the element in the recall process and use it as the return value:

    :p12_selected := ...;

    I can't integrate it in your code because I don't understand. Why the TEST_COLLECTION is created and used in a query, but the data added to the collection of SPLIT_SYMPTOMS?

  • Updated report

    Hello

    My configuration is:

    Version of the apex 4.2.4.00.08

    Version of database 10g

    Linux

    I have a data entry screen that has been around for several years.  A new requirement is to add an updated report in the middle of the shape.  It is therefore similar to a master detail form.

    The user fills out all fields, even in the record being updated.  The problem is when recording (both master and detail) must be recorded.  Both are registered with the a button.

    I created a dynamic action to fill the primary key of the sheets and copy the primary key of the master record to the foreign key in the detail record in the update report.  The problem is, the line of the main registration process "is" not the primary key, while it creates a new and an error then update report indicating the "Parent key is not found"

    Here is the code:

    1 pop request ID

    a. event: change

    b. selection Type: jQuery Selector

    c. Selectro jQuery: select [name = "f03"]: this is the first column in an editable state.

    d. javascript:

    If ($v ("P2_ID") == "")

    {

    get var = new htmldb_get (null, html_GetElement('pFlowId').value, 'APPLICATION_PROCESS = PopRequestID', html_Getelement('pFlowStepId'.value);

    gReturn = get.get ();

    $s ('P2_ID', gReturn);   It's the Master record primary key

    $s ('f06_' _ this.triggeringElement.id.substring (4), gReturn);

    }

    e. event scope: dynamic

    2 created AJAX callback PopRequestID

    Declare

    number of l_req_id;

    Begin

    Select req_pk_seq.nextval

    In l_req_id

    From Dual;

    HTP.p (l_req_id);

    End;

    All this seems to work, but the P2_ID is not displayed in the session state.  I can see it on the screen in the primary key column in the main area and also in the column of the updated report.  The row of main registration process only 'sees' the primary key, while it creates a new and an error occurs then on update report indicating the "Parent key is not found.  If the code creates the primary key of the 1, when recording, the primary key of the main record is 2 and report foreign updateable key is always 1.

    Thank you very much!

    Becky

    I was able to solve this addresses simply and different:

    1. create a process that will be placed right behind the row in TABLE_NAME and before ApplyMRU process

    2. enter in something similar to the following:

    Because me in 1.apex_application.g_f03.count - make sure that it is a required field.  If there is no data the number is 0

    Loop

    If apex_application.g_f06 (i) is Null then - this is the field you want to fill

    apex_application.g_f06 (i): = ': P2_ID;            -Ignore the double quotes (created an emoticon!). ': P2_ID in this case is the primary key that is created through the process of the TABLE_NAME line.

    End If;

    End loop;

  • No values for APEX_APPLICATION. GFnn

    Hello

    I used apex_item.hidden (1, product_number) and APEX_APPLICATION. G_F01 successfully after an event of page Submit.

    I try use know an AJAX callback process to demand and does not work as I had hoped. (APEX_APPLICATION. G_F01. COUNT = 0)

    Does this work only with page Submit or can it be used with AJAX callback?

    The berries are only filled up to present on. If you want the values in a table in an application process, then you will need to post these values in the process.

  • Adding a sequence as a default value for a column in a table field

    Hi all

    APEX 4.2.4. Oracle XE 11.2

    I'm trying to add a default value from a sequence to a column in a table field, so he fills when I hit the "Add Row" button...

    The reason for this by the way, rather than simply using a sequence database and the trigger on the column (which exists and works very well), is that I try also add detail records to the line when I create, and I can not, I do not have the ID of the parent to the child records.

    Looking at the docs, (for example oracle 11 g pl/sql enhancements), I thought I'd have be able to use a PL/SQL expression as to_char (petty_cash_seq. NEXTVAL) or to_number (petty_cash_seq. NEXTVAL) or all that kind of expression that extracts the sequence.nextval, as it became available in PL/SQL on the database

    so, Ive tried

    TO_CHAR (petty_cash_seq. NEXTVAL) in tabular form attributes - column default / PL/SQL expression and he said ORA-02287: unauthorized number sequence here...

    Ive also tried rolling upward in a PL/SQL package, as below:

    DECLARE v_seq_value NUMBER; BEGIN select petty_cash_seq. NEXTVAL in the double v_seq_value; return v_seq_value; END;

    and I get ORA-00923: KEYWORD not found where expected.

    Can anyone help as to why neither of them do not seem to work as an expression / packages in the default type?

    or... a simple alternative to get the ID of the next record when I hit 'Add Row' before I can create child folders at the same time...

    And I've been mulling over the merits of the master / detail integrity and try to think in an orderly manner to create the mask, add the details without having to first submit the master, then go back and go into details... And put it into context, its a request for costs where users create an expense entry and download copies of their expenses at the same time...

    Thank you very much

    Richard

    Use a combination of AJAX and JavaScript to get the next value in the sequence in a version substituted the line Add.

    1. on the page editor, right-click on the Ajax callbacks and select Create.

    2. on the next page, select PL/SQL. Do * not * select the tabular presentation. Leave this field blank.

    3. name your process, e.g. getNextSequence

    4. Add the code (under the DIRECTION of your own names of the object):

    DECLARE
        ln_NextSequence NUMBER := 0;
    BEGIN
        SELECT MY_SEQUENCE.NEXTVAL
        INTO ln_NextSequence
        FROM DUAL;
    
        HTP.P(TO_CHAR(ln_NextSequence));
    END;
    

    5. When you look now, you will see that the button Add a line called javascript:addRow (). Remove all this and change the button to be triggered by a dynamic action.

    6. create a dynamic action when a click on your button to add a line

    7. Add the following JavaScript code to get the new value of the sequence using your AJAX call from above and then place it on the newly added line:

    var nextSequenceID;
    
    apex.server.process(   'getNextSequence'
                         , {}
                         , { dataType: "text",
                             async: false,
                             complete: function( ajaxResponse )
                                      {
                                        nextSequenceID = ajaxResponse.responseText;
                                      }
                           });
    
    addRow();
    
    $('td [headers="YOUR_ID_COLUMN_NAME_HERE"] input:last').val(nextSequenceID);
    

    -Joe

  • APEX submit changes to the database when the value is changed in Javascript?

    Hello

    IM new at the Apex and use v4.1.

    What I want to do, is to have a tabular presentation that will have 5 fields and a number of fields only reading based on a SQL table & reviews, when a user updates one of the 5 fields entry I want to save the change to the databases automatically.

    I thought that this could be done using Ajax and Javascript, but my knowledge is not at a high enough level to make it work.

    I think what I need to do:

    1 create an AJAX callback process (say its called "Submit Changes") - it comes to PL SQL that will update the database based on the value of the field that was changed. I think that this will require the number of line in table form to pass in.

    2. create a header HTML with Javascript code that calls the recall AJAX process - I found the below on the net, but do not think that I changed it correctly:
    < script type = "text/javascript" >
    function Submit_Value() {}
    var ajaxRequest = new htmldb_Get (null, & APP_ID., 'APPLICATION_PROCESS is Submit Changes', 0);
    var ajaxResult = ajaxRequest.get ();
    Alert (ajaxResult);
    }
    < /script >

    3. change the attributes of elements ' "on the column compared to something like onchange ="Submit_Value () ";

    So far I have not been able to get this working and would be grateful for any help or suggestion.

    Thank you

    Goes

    just a quick thought: I myself remember in 3.x days by using a process with a space name did not work (at least when I was trying to use), I have always since then named such with underscores in the... IE: submit_changes the two (the name of the process in the apex) and the reference of the code in javascript

  • onMouseOver displays the ToolTip of hidden column of the classic report

    What: The goal:
    Access more information that fits on a single line of the screen without using multiple fixed lines.

    Background:
    Classic report with 18 data elements (columns) visible. At the search box, and the user can choose the number of rows displayed.
    Some data elements can be long (20 to 30 characters) compared to the width of the screen. The element more right data risk of 100 characters.

    Proposed strategy:
    (1) display the n first characters of the item (s) long in the report.
    (2) display the entire item onMouseOver.

    Proposed approach:
    (1) for each column with the data of type long, contain the integer value in a hidden item.
    (2) value of (hidden) long display in tooltips (bubble? / ball?) on this value onMouseOver.

    Note: It is not framed to help/Help for a column but the display of the value of long type for a particular element in the line of a column.

    Search feature:
    (1) to reduce maintenance, wants to set up for several columns using a single common block of code.

    Question:
    In view of the other approaches, you know, it's a good approach to achieve the goal? Alternative approaches?

    Howard

    Well it took some time, and you really made me work for it. :)

    For flight hover end result on the job column Ln Nm.
    http://Apex.Oracle.com/pls/Apex/f?p=991202:1

    I added some old code, I had laying around. It adds a bubble that will stay for 5 seconds or until you click Next or move to another record.

    What I would do at this point, it is simply truncate the length of the Nm long to something short (with a substr). Use any indicator wished to hover. Like for example these glasses it's really up to you.

    You will see there is a PLSQL AJAX callback where you can retrieve and format the content of the pop-up window to everything you want. You can make it real.

    Here's what I did:
    1. the new procedure of ShowJob javascript.

    function ShowJob(pThis,pId){
         this.dTimeout;
          clearTimeout(this.dTimeout);
          this.dGet = dGet;
          this.dShow = dShow;
          this.dCancel = dCancel;
          var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=FULL_LONG_NAME',$v('pFlowStepId'));
          this.dGet();
         return;
    
         function dGet(){
               this.dTimeout = setTimeout("this.dCancel()",6500);
              get.addParam('x01',pId);
               get.GetAsync(dShow);
         }
    
         function dShow(){
               $x_Hide('rollover');
               if(p.readyState == 1){
               }else if(p.readyState == 2){
               }else if(p.readyState == 3){
               }else if(p.readyState == 4){
                     $x('rollover_content').innerHTML = p.responseText;
                     $x_Show('rollover');
    
                var l = findPosX(pThis)+pThis.offsetWidth+5;
                     var t = findPosY(pThis);
    
                $x_Style('rollover','left',l + 'px');
                     $x_Style('rollover','top',t + 'px');
    
    // This math would center on the vertical
    //                 $x_Style('rollover','left',findPosX(pThis)+pThis.offsetWidth+5);
    //                 $x_Style('rollover','top',findPosY(pThis)-($x('rollover').offsetHeight/2)+($x(pThis).offsetHeight/2));
                   document.onclick = function(e){
                   dCheckClick(e);
                   }
               }else{return false;}
         }
         function dCheckClick(e){
              var elem = html_GetTarget(e);
              try{
                        var lTable = $x_UpTill(elem,"DIV");
                        if(lTable.id!='rollover_content'){dCancel();}
                        else{}
              }catch(err){dCancel();}
         }
    
         function dCancel(){
               $x_Hide('rollover');
              document.onclick = null;
               get = null;
         }
    }
    

    2 rollover div on the page footer (div id = "reversal"...). Of course, this could also be a region.

    < div id = "reversal" style = "display: none;" color: black; background: #FFF; border: 2px solid #369; width: 290px; position: absolute; padding: 4px; » >
    < div id = "rollover_content" > < / div >
    < / div >

    3 PLSQL AJAX callback. : FULL_LONG_NAME

    -- select your value with apex_application.g_x01
    
    htp.p('You hover over ' || apex_application.g_x01 || '
    '); htp.p('Here is the Full Long Name: XXXXXXX XXXXXXX XXXXXXX 1234565');

    4 changed the Nm of Long column to have a link with the onmouseover call that calls the new procedure ShowJob. I made the assumption that with the NUM parameter, you could go the full record of what you need.
    onmouseover = "ShowJob(This,#num#) '"

    This should be it.

    Let me know what you think.
    -Jorge

    Published by: jrimblas on April 22, 2013 13:05: added code to validate for the completion

  • How to set the value of a column in a table according to another column?

    Hello world!

    I use Apex 4.1.
    My question is how can I set the value of a column in a table according to another column?
    I have a table and when I insert the value in the column content, I want to change this value in the note column with the note, which is generated with pl/sql function (function of string returned if the typed value is in the range).

    I tried to use javascript as
     $('input[name=f02]').live('change', function(){
    if($(this).val()!='1'){
    $('input[name=f03]').val("test")}
    }); 
    for the development of the column note to test if the value typed in the content of the column is not 1, but this code assigns the value to all the lines and I need to set only the specified line.

    Can someone give me a hint in any way to do this if possible?

    Kind regards
    drama9346

    You will need create a process on your page type PLSQL and develop this process "we demand" of the page. In this process, you can run the PLSQL you need. That is to say to retrieve the note value as described in your PC:

    and when I insert the value in the column content, I want to change this value in the note column with the note, which is generated with pl/sql function (function of string returned if the typed value is in the range).

    In this process, you must provide a return value of the call, and you can do this by using htp.p. Example:

    DECLARE
       --putting x01 in a var to simplify
       l_test_var VARCHAR2(200) := apex_application.g_x01;
       l_return VARCHAR2(200);
    BEGIN
       -- a simplistic test
       IF LENGTH(l_test_var) BETWEEN 10 AND 20 THEN
          l_return := 'String is between 10 and 20';
       END IF;
    
       --this will write l_return to the buffer, and the ajax callback will receive this
       htp.p(l_return);
    END;
    

    And the code that I wrote above, which is javascript, would need to go where your current code is that binds to the onchange event. The result should be that, when a change is made to this element, an ajax request is made on the server. When the call is finished, it will be the value returned in the item you want.

  • Dynamic action - defining the value of affected parts

    Hello

    I'm a little trouble trying to set the value of several items affected in dynamic Action (refresh the number of the part to Page 2). Page 2 I want the user to select the order number and fill in the items combines automatically, for example part number Descr. I can make it work for Part_Number, but the same value appears when I add P2_DESCR to items assigned to set the value. I'm probably doing something really stupid!

    http://Apex.Oracle.com/pls/Apex/f?p=11536:2

    Kind regards

    Mickey

    Hi Mickey,

    It is not as easy as it should be, even. You certainly do not make something stupid at all!

    Currently the action 'Set value' support only 1 distinct value. You might have other 'Action' within the same dynamic action that returns the other element you want, but it's inefficient, you need to make 2 round trips to the server to retrieve each value. We are looking for the opportunity to put multiple values without needing more trips to go back out of the box in a future release, but for now I think the best approach is to use a custom mix of dynamic measurements, JavaScript and a level of page AJAX callback.

    For this example, I use the EMP table, where the user selects the number and the name of the employee and employment are returned, but the technique can be used for your situation.


    1. Add a page 'AJAX Callback' called 'GET_EMP_INFO', make the type "PL/SQL" with a "Point of process" of "On Demand - run this process when requested by AJAX ' and add the following code:

      begin
          for c in (select ename, job from emp where EMPNO = to_number(:P1_EMPNO)) loop
           apex_util.set_session_state('P1_ENAME', c.ename);
              apex_util.set_session_state('P1_JOB', c.job);
              /* Add more set_session_state calls here if you want to return more item values */
          end loop;
          apex_util.json_from_items('P1_ENAME:P1_JOB');  /* Add more here for returning more values */
      end;
      

    2. Create a dynamic action "Advanced" (because we need to use the action "Run JavaScript Code"), with the following attributes:

      • 'Change' - to the fire of the dynamic action every time the number value used change event.

      • Selection of Type 'Article (s)' - to be able to select the element of page employee number.

      • Article (s) "P1_EMPNO" - the page employee number element.

      • Real Action "to execute JavaScript Code. If you want details on the loading of the page as well, make sure that the 'Fire when loading the Page' checkbox is checked. Add the following "Code":

        var get = new htmldb_Get(null, $v('pFlowId'), 'APPLICATION_PROCESS=GET_EMP_INFO', $v('pFlowStepId'));
        get.add('P1_EMPNO', $v('P1_EMPNO'));
        gReturn = get.get();
        json_SetItems(gReturn)
        get = null;
        





    So, basically, that's all. I recommend this approach for now, until better support us in native mode to set multiple values, or a plug-in dynamic action arises that does just that!

    Hope that helps.

    Kind regards
    Anthony.

Maybe you are looking for