Forum Stats

  • 3,854,216 Users
  • 2,264,340 Discussions
  • 7,905,609 Comments

Discussions

get page / region through Ajax

mnonolu
mnonolu Member Posts: 34
edited Sep 12, 2017 10:21AM in APEX Discussions

Hello All,

I have a requirement to retrieve an existing Apex page (or region on a page) and inject it dynamically : depending on user action into another region. (Ajax is required).

I remember it was possible to do that earlier using htmldb_Get. but I just cannot figure out how to do it using Apex documented functions (apex.server.process ?) Is it possible? If not, what is the alternative?

Can someone help on this?

I am on Oracle 12c and Apex 5.0.

Thanks in advance.

Mno

Tagged:

Best Answer

  • mnonolu
    mnonolu Member Posts: 34
    edited Sep 12, 2017 10:20AM Answer ✓

    Hello,

    I have got an answer to my question for people who would need it.

    I am not totally sure, but I do not think it is possible with Apex documented functions (I guess someone would have answered if it was obvious).

    Anyway, this can be done using Jquery as follows :

    // the ajax request gets the whole page

    $.ajax({

                   method: "GET",

                   url: 'f?p=' + apex.item('pFlowId').getValue() + ':' + apex.item('pFlowStepId').getValue() + ':' + apex.item('pInstance').getValue(),

                   dataType: "html"

                })

                .done(function( msg ) { //when it is done, we will handle the result and parse to get what we want...              

                    $(msg).find('#id_of_subset_to_inject').appendTo('#id_where_inject');

                 }); // end done handler

    Hope this can help someone.

    Regards,

    Mno.

Answers

  • mnonolu
    mnonolu Member Posts: 34
    edited Sep 12, 2017 10:20AM Answer ✓

    Hello,

    I have got an answer to my question for people who would need it.

    I am not totally sure, but I do not think it is possible with Apex documented functions (I guess someone would have answered if it was obvious).

    Anyway, this can be done using Jquery as follows :

    // the ajax request gets the whole page

    $.ajax({

                   method: "GET",

                   url: 'f?p=' + apex.item('pFlowId').getValue() + ':' + apex.item('pFlowStepId').getValue() + ':' + apex.item('pInstance').getValue(),

                   dataType: "html"

                })

                .done(function( msg ) { //when it is done, we will handle the result and parse to get what we want...              

                    $(msg).find('#id_of_subset_to_inject').appendTo('#id_where_inject');

                 }); // end done handler

    Hope this can help someone.

    Regards,

    Mno.

This discussion has been closed.