AJAX Callback

Hello everyone,
I am attempting to use the Callback feature for ApEx. I have tried to use a provided Oracle sample to just print a simple "Hello World" type of process using AJAX Callback. It appears that my code does not execute at all so I am not sure how to proceed.
The sample code that I used from Oracle is located at http://apex.oracle.com/pls/otn/f?p=11620:63:366817572353630::NO:::. For convenience, I copied the sample code 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 that I have written based on the above sample is a makeup of a Java function and an on demand process. 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 on demand process named "mytestprocess" is coded as follows:
begin
htp.prn ('Hello from on demand process');
htp.prn ('Hello from temporary item' || :TEMPORARY_ITEM);
end;Can someone help me to understand why I am not getting any output from this code? The ultimate goal is to alter session state via AJAX Callback but I cannot seem to get AJAX Callback to execute at all.
I am using APEX version 4.0.1 in an Oracle 11.2.0.1 database.
Edited by: ncroston on Dec 15, 2010 8:49 AM

get.add is kind of the old way to do it - it required you to create an application item first and then select from it. They added a new way that doesn't require an application item - If you use get.addParam('x01', value) instead, it puts the values in wwv_flow.g_x01. You can assign x01-x10 and it maps to g_x01-10 respectively.
So basically it would change to:
get.add('x01',$x('P11_TEST').value)and
htp.prn ('Hello from temporary item' || wwv_flow.g_x01);

Similar Messages

  • AJAX  Callbacks  & apex.ajax.ondemand     -  APEX 4.0

    Hello,
    I am trying to use the apex.ajax.ondemand(pWidget,pReturn) package for the Ajax Callbacks functionality in APEX 4.0. However since I need the $v('pFlowStepId') to identify the ondemand process within the application and the apex.ajax.ondemand() package does not allow for the inclusion of this parameter I am unable to use it.
    Do you have any suggestions besides using the the htmldb_Get directly to work with the Ajax Callbacks functionality in 4.0?
    Thanks ahead for any information you can provide.
    Rafael J

    KP wrote:
    Hi,
    I am dynamically creating a HREF link in my Apex report using SQL. this links invokes an Ajax Process on the same page.
    The process is an on Demand Ajax Call back that calls a Stored Proc.
    All seems to work as expected, with one small issue, A blank page is displayed once the process is called, the process page does not return back to the page it was called from. Can someone let me know where i am going wrong.
    This is the Query i use to create a dynamic HREF via my Report SQL ...Notice the <a href...> syntax. The name of the process flow is CALL_PROCESS_FLOW
    select "RUN_ID",
    "JOB_NAME",
    "JOB_START_DATE",
    "JOB_END_DATE",
    'Ajax' SP1
    from "#OWNER#"."VW_JOB_CONTROL"
    where job_name='CLN_INPATIENT_FCE'
    I have tried getting rid of the colons after the name of the process flow. I have also tried the same with and without the # at the end. However it still returns the same error.
    Can some one help. I know its something small but i just can seem to figure it out.I don't think you are making an ajax call here and you are just invoking the APEX application process via URL
    Use the below javascript function to make a call ajax
    function myAjaxProcess() {
    var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=CALL_PROCESS_FLOW',$v('pFlowStepId'));
    //invoke it now
    gReturn = get.get();
    // you can alert the ajax call back
    //alert(gReturn);
    }Replace your href value (href="f?p=&APP_ID.:2:&SESSION.:APPLICATION_PROCESS=CALL_PROCESS_FLOW:::::#")
    like this
    href="javascript:myAjaxProcess();"

  • Ajax Callbacks?

    Hi,
    Does anybody know what the "AJAX Callbacks" section is for in the page processing column on the page editor in Apex 4? I've searched through the help, the apex website and the forum and there appears to be no information about this?
    Thanks.

    Hi,
    in the past you had to write application level processes of type "On Demand" if you wanted to implement AJAX callbacks from the browser to APEX. But that was hard to maintain, because these mostly page related AJAX callbacks didn't show up in the context of a page. With APEX 4.0 you are now able to define these AJAX callback "On Demand" processes on page level. Calling them from the browser is still the same, just be aware that you are NOT using
    htmldb_Get(null, $v('pFlowId'), 'APPLICATION_PROCESS=mytestprocess', 0);Always specify the current page as last parameter
    htmldb_Get(null, $v('pFlowId'), 'APPLICATION_PROCESS=mytestprocess', $v('pFlowStepId'));Regards
    Patrick

  • Ajax:callback function not called for every readystatechange of the request

    Author: khk Posts: 2 Registered: 2/17/06
    Feb 17, 2006 11:04 PM
    Hi
    I am working with an ajax program.
    In that i have defined a callback funtion
    but that function is not being called for every readystatechange of the request object for the first request .
    but it is working fine from the second request.
    function find(start,number){
    var nameField=document.getElementById("text1").value;
    var starting=start;
    var total=number;
    if(form1.criteria[0].checked) {
    http.open("GET", url + escape(nameField)+"&param2="+escape("exact")+"&param4="+escape(starting)+"&param5="+escape(number));
    else if(form1.criteria[2].checked) {
    http.open("GET", url + escape(nameField)+"&param2="+escape("prefix")+"&param4="+escape(starting)+"&param5="+escape(number));
    http.onreadystatechange = callback2;
    http.send(null);
    function callback2(){
    if (http.readyState == 4) {//request state
    if(http.status==200){
    var message=http.responseXML;
    alert(http.responseText);
    Parse2(message);
    }else{
    alert("response is not completed");
    }else{
    alert("request state is :-"+http.readyState);
    }

    Triple post.
    You have been answered here: http://forum.java.sun.com/thread.jspa?threadID=709676

  • APEX 4.0 - AJAX not working with Popup LOV field

    Hello,
    In the application I have built I have three fields which are 'feeded' by selects via a AJAX construction.
    All three fields are based on three others, which are PopUp LOV fields. Up to version 3.2 I had no problems: the fields were 'refreshed' as expected when in the 'parent' field a specific value was entered or choosen by the Popup Lov selector.
    But since the migration to APEX-4 (lin a test-system) all the three fields are not correctly refreshed anymore: two of them give the value 'undefined', the third, which is a select-list shows values, but at the moment I try to click on the select-list down arrow to pick a value, the list is emptied and stays that way.
    More specific about the third field:
    item 1 is a popup-lov defined item in which a user can type a value, but can also choose a value from a popup-lov. Item 2 is based on item-1: it does a select based on the value of item-1 and refreshes a select-list. Item-2 is defined as a select list.
    I got it all working when making item-1 also a select list, but since the list can become very large, I made a Popup lov of it. Most users do know what code they have to enter and in case somebody is not sure, the lov can be used.
    In this forum I came across a problem with AJAX callback, which was answered by Patrick Wolf, saying that in an htmldb_Get ( ... ,0) the last 0 should be replaced by $v('pFlowStepId'), but this did not fix my problem. I have the feeling that the problem is somewhre else, since on first hand, after entering a value in item-1 I see item-2 refreshed with the correct values, but the moment I try to select one item, the list is emptied.....
    I hope I made it clear what my problem is and that somebody can help me, else APEX-3.2 was the latest version for this application....
    Thanks in advance and best regards,
    Jan.
    Edited by: user13110728 on 9-aug-2010 8:44

    Hi Jan,
    the problem is the
    onBlur="javascript:f_P21_select_kostenposten(this,'P21_KOSTENPOST');"on P21_GBREKNR. This is getting attached to the HTML input text field but as well the the anchor link which opens the popup. So when you leave the text field the cursor will be put onto the icon to open the Popup LOV. When you press tab another time or leave the anchor link by clicking somewhere the above JavaScript function is fired again. But the problem is that "this" this time points to the anchor and not the text item anymore, so it will return an invalid value when you access this.value in your f_P21_select_kostenposten function which results in an empty result of your on-demand call.
    I still have to investigate why the above JavaScript code is now added to the anchor link as well. But as a workaround, just change your code to
    onChange="javascript:f_P21_select_kostenposten(this,'P21_KOSTENPOST');"which is better anyway, because it's just firing when the value really got changed. And because the anchor link can't really be changed, the event will never fire when you leave the anchor. BTW you can use the Application Search feature to search for all your onBlur events. onChange is much better than onBlur because it doesn't fire that often unintended.
    But if you want to use some of the new APEX 4.0 features, you could use the cascading LOV feature of APEX 4 and avoid all this JavaScript and on-demand code which you have written.
    I have changed your application to take use of it.
    1) I changed the LOV query for P21_KOSTENPOST from
    select '('||replace(lpad(gbreknr, 3, chr(1)),chr(1),' ')||') '|| omschrijving d, kostenpost r
    from   kostenposten
    where  vervallen is null
      and  bedrijf = :P21_BEDRIJF
    order by gbreknr, kostenpostto
    select '('||replace(lpad(gbreknr, 3, chr(1)),chr(1),' ')||') '|| omschrijving d, kostenpost r
    from   kostenposten
    where  vervallen is null
      and  bedrijf = :P21_BEDRIJF
      and  (:P21_GBREKNR is null or gbreknr = :P21_GBREKNR)
    order by gbreknr, kostenpostas it was in your on-demand process. The query will return all values if P21_GBREKNR is null but will restrict it if the field is filled out.
    2) Set "Cascading LOV Parent Item(s)" to P21_BEDRIJF,P21_GBREKNR Because based on your LOV query I assume "Kostenpost" should be refreshed if one of the two fields gets changed.
    3) Set "Optimize Refresh" to No because one of your parent items (P21_GBREKNR) can contain a null value.
    4) Removed the onBlur/onChange from P21_GBREKNR
    5) Removed the *%null%* from the "Null Return Value" attribute of P21_BEDRIJF, because that will cause a ORA-1722 if someone picks "-- kies: --"
    That's it.
    Have a look at dynamic actions and the "Set Value" action as well, because I think that could remove your other on-demand calls as well without having to write any JavaScript code.
    I will still investigate what's going on with the anchor link in APEX 4.0
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins

  • OnMouseOver displays Tooltip from hidden column of classic report

    What: The Goal:
    Make easily available more information than fits on one line of the screen without using multiple fixed lines.
    Background:
    Classic report with 18 data items (columns) visible. Has Search box and user can choose number of rows displayed.
    A couple data items can be long (20-30 characters) compared to the screen width. The right-most data item might run 100 characters.
    Proposed Strategy:
    1) Display the first n characters of the long item(s) on the report.
    2) On onMouseOver display the entire item.
    Proposed Approach:
    1) For each column with long data, hold the entire value in a hidden item.
    2) Display long (hidden) value in tooltip (bubble?/balloon?) upon onMouseOver of that value.
    Note: This is not ToolTip/Help for a column but display of the long value for a specifc item in the row of a column.
    Sought After Feature:
    1) To reduce maintenance, would like to implement for multiple columns using a single common block of code.
    Question:
    Given other approaches you know, is this a good approach to achieve the goal? Alternative approaches?
    Howard

    Well it took a while and you really made me work for this. :)
    For the end result hover on the Job Ln Nm column.
    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 up for 5 sec or until you click away or hover on another record.
    What I would do at this point is just truncate (with a substr) the length of the Long Nm to something short. Use whatever indicator you want for the hover. Like for example these glasses <img src="#IMAGE_PREFIX#Fndview1.gif"> It's really up to you.
    You'll see there's an AJAX Callback PLSQL where you can retreive and format the content of the popup to whatever you want. You could make it real pretty.
    Here's what I did:
    1. New ShowJob javascript procedure.
    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="rollover"...). Of course this could be a region also.
    &lt;div id="rollover" style="display:none;color:black;background:#FFF;border:2px solid #369;width:290px;position:absolute;padding:4px;">
    &lt;div id="rollover_content">&lt;/div>
    &lt;/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 || '<br>');
    htp.p('Here is the Full Long Name: XXXXXXX XXXXXXX XXXXXXX 1234565');4. Changed Long Nm column to be a link with the onmouseover call that calls the new procedure ShowJob. I made the assumption that with the NUM parameter you could fetch the full record of what you need.
    onmouseover="ShowJob(this,#NUM#)"
    That should be it.
    Let me know what you think.
    -Jorge
    Edited by: jrimblas on Apr 22, 2013 1:05 PM: Added code to post for completion

  • Interactive Report (IR) column heading: filtered items number & flashlight

    Hello everyone
    several hours of searching through the forum did not provide me with leads or answers to 2 questions. Both are related to the IR column heading menu and options. Let's start with a copy of the relevant portion of the interactive report help screen:
    Column Heading Menu
    Clicking on any column heading exposes a column heading menu.
    [snip]
    Text Area is used to enter case insensitive search criteria (no need for wild cards). Entering a value will reduce the list of values at the bottom of the menu. You can then select a value from the bottom and the selected value will be created as a filter using '=' (e.g. column = 'ABC'). Alternatively, you can click the flashlight icon and the entered value will be created as a filter with the 'LIKE' modifier (e.g. column LIKE '%ABC%').
    List of Unique Values contains the first 500 unique values that meet your filters. If the column is a date, a list of date ranges is displayed instead. If you select a value, a filter will be created using '=' (e.g. column = 'ABC').
    Q1: Why do I not see a flashlight icon? I looked everywhere in the report definition to "enable" it, to no avail.
    Q2: Although we've found IRs to be incredibly useful and embraced by end users, we are having issues when dealing with large datasets. Let's look at searching for people's first/last name in our CONTACTS table. The table is ~28,000 names long. If one attempts to use Column Heading menu to "filter" for any name outside the first 500 unique values, the search does not work. Yes, I know that a workaround is to use Actions Menu icon filter... but, it sure is misleading to have a search which does not go beyond letter B in the list of last names. Furthermore, I do not see a way to DISABLE Column Heading Text Area, and avoid user confusion.
    I suspect that "List of Unique Values contains the first 500 unique values" was set for the performance purposes. Is there a way to set that number anywhere? Have it customized for each column? (columns county and state could be <100, for example)
    Thanks an advance to any advice.
    Vojin

    @Prabodh: what you say is only changing the default image for the column selector at the search bar level. What i think is being looked for is an icon on the popup when a column header is clicked in an IR. Don't bother: there is none.
    @Vojin, Tonibony:
    I also ran into this problem with IRs and the useless column header box. If you want to hide the unique values list, it is a bother. First of all, you can't disable the finding of values, this is embedded in the widget ajax code. Then if you want to just hide the list, there is no real event you can hook up to. The poping up of the box is an ajax callback, and is part of the IR javascript, but this callback does not trigger any event (no apexafterrefresh for example, which is understandable). I've worked around this by overriding/extending the method which is called when ajax is done loading within the IR code. Here is a piece of code which does this (call it on page load):
       // _Finished_Loading is called when the IR is done with a GET action
       // because the posts are synchronous in this report, and no events
       // or hooks are available, the best way to preserve functionality
       // yet extending it is to override the original function, yet
       // keep the base code
       // apexafterrefresh cant be used since it is not triggered after
       // the widget ajax
       var or_Finished_Loading = gReport._Finished_Loading;
       gReport._Finished_Loading = function(){
           //overriden, but still have to call orinigal!
          or_Finished_Loading();
          //SORT_WIDGET is the widget containing all the header elements
          if(gReport.current_control=='SORT_WIDGET'){
             // hide the original dropdown box
             $("#apexir_rollover_content").hide();
       };If you're interested, i've recently developed a plugin for use in my interactive reports which works around some of these limitations. For me, the headers are much more userfriendly than the actions > filter menu. So what i've done is: hide the orignal dropdown, and turn the searchfield into an autocompletion field, which will progressively search through the distinct column values in the IR with ajax. I've even made an option to have the searching behave like a "contains" or a "like". I'm working on a post about it, with background, documentation and source code. I'll add a post here when i finish it up, you can see if that helps you.
    I also would like to add a button later on which will simply add the entered value as a "like %value%" filter. I know how to do this and what to do, i'm just a bit short on time at the moment. I actually think that adding the button in the layout may be the hardest part... :')

  • Dynamic actions in tabular forms

    Hi,
    i have 4 columns in tabular forms.
    emp_code emp_name emp_position emp_status
    whenever a user enter the emp_code
    the emp_name,emp_position and emp_status should be automatically displayed.
    i try to use dynamic actions to populate the emp_name , emp_position, emp_status.
    but i cannot identify which columns / item to use since its a tabular forms.
    can anyone help ?
    thanks
    regards
    jerry

    here's what you can do for your situation
    <li>Create an AJAX Callback process(PLSQL type) in your page that is similar to
    DECLARE
      lc_result XMLTYPE;
    BEGIN
       SELECT XMLELEMENT("COL"
                                     ,XMLELEMENT("COL1", wwv_flow.g_x01)
                                     ,XMLELEMENT("COL2", LPAD(wwv_flow.g_x01,10,'0'))
                                     ,XMLELEMENT("COL3", RPAD(wwv_flow.g_x01,10,'#'))
                                     ,XMLELEMENT("COL4", 'blah blah')
                                   ) RESULT
      INTO lc_result
      FROM DUAL;
        OWA_UTIL.MIME_HEADER('text/xml', false);
        htp.p('Cache-Control: no-cache');
        htp.p('Pragma: no-cache');
        OWA_UTIL.HTTP_HEADER_CLOSE();
        htp.p(lc_result.getstringval());
    END;This returns an XML with the rows data. I have just used some simple processing of the input data in this case, but you can modify it for your need
    <li>Then have a Dynamic Action that is triggered on change of the f01 input field
    //value of triggered item
    val = $(this.triggeringElement).val();
    //Call Ajax Callback process
    var a = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=FETCH_ROW',$v('pFlowStepId'));
    a.addParam('x01',val);
    X = a.get('XML');
    //Obtain data from returned XML
    col2 = $(X).find('COL2').text() ;
    col3 = $(X).find('COL3').text() ;
    col4 = $(X).find('COL4').text() ;
    //Set items
    this_row = $(this.triggeringElement).parents('tr:first');
    this_row.find('input[name=f02]').val(col2);
    this_row.find('input[name=f03]').val(col3);
    this_row.find('input[name=f04]').val(col4);This sends the f01 field(triggering source) to the PLSQL that returns the data in XML format for 3 other columns and sets those columns.
    Hope that answers your question.

  • Call JavaScript Function in PL/SQL

    Hello All,
    I need to call a JS function to open a popup, I'm in the middle of a PL/SQL Process that I use:
       V_ERRO_VALIDACAO := 'S';
      IF V_ERRO_VALIDACAO = 'S' THEN
        HTP.p ('<script type="text/javascript">');
        HTP.p ('javascript:popUp2(''f?p=&APP_ID.:21:&SESSION.::NO::'', 700, 400);');
        HTP.p ('</script>');
      END IF;
      --But it's not working.
    It's hard coded for testing purposes
    Is there a way to call the popup in the process?
    Thanks,
    Alan Martini.

    If you want to combine PLSQL and JS code, rely on Dynamic Actions with true actions of different types executed based on their sequence (PLSQL ,JavaScript and possibly some set Item process to pass values between JS - PLSQL ).
    For example
    **True Action 1 : PLSQL code
    **True Action 2 : Set Item value (fetches from DB after last change )
    **True Action 3: Run JS code based on page item
    **True Action4: Run PLSQL based on JS action
    If you want more flexibility to pass around values, use Ajax(callback process and javascript) but you would loose the declarative coding style and probably end up making the code difficult to maintain.

  • AnyGantt Custom XML Apex 4.2.2

    Hi guys,
    Sorry to create a new post on this, but I'm having trouble following some of the previously posted solutions.
    I'd like to use the AnyGantt Project chart but dynamically build the <project_chart> <tasks> tags so that I can leverage some of the additional feature of AnyGantt such as connectors etc, and generally control the display a little more.  I've read a few posts about max 32 byte issues, however i thought i'd take tiny steps and see if i can build a simple output with 2 rows initially to ensure i can get Apex building the chart dynamically.
    I've followed the post Dynamic custom XML in resource gantt and found this extremely helpful, especially the links to the demo site Hilary has created http://apex.oracle.com/pls/apex/f?p=36648:60
    I've used this example to build my PL/SQL block which dynamically builds tags for me and I've tested this in SQL Developer and i know I'm getting the following tags :
    <project_chart>
      <tasks>
        <task id="161" name="Prep" actual_start="2013.01.01" actual_end="2013.01.07" />
        <task id="162" name="Workshop" actual_start="2013.01.07" actual_end="2013.01.14" />
      </tasks>
    </project_chart>
    I understand the section in this example that explains how to replace the #DATA# string in the Custom XML region of the chart with a page item of &P23_DATA for example (P23_DATA is defined as a hidden item in the chart region), i've defined my PL/SQL block as an Application Process.....
    .....however I'm having trouble understanding how this now links all together, in the example from Hilary the following steps are mentioned but i'm confused exactly where in my page is define them :
    3. Edit the Chart Page to include the following JavaScript function, calling the On Demand process:
    function getdata() {
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=CHART_DATA',0);
    gReturn = get.get('XML');
    get = null;
    and finally
    8. To call the JavaScript function and ensure asychronous updates are
    picked up, the region source has been updated to replace #CHART_REFRESH# with
    the following:
    <script type="text/javascript" language="javascript">
    var chartName = '#CHART_NAME#';
    chartName = chartName.substring(1);
    getdata();
    function chart_r#CHART_NAME#_InitRefresh(pNow) {
      setTimeout("chart_r#CHART_NAME#_InitRefresh(true)",10000);
      if (pNow){apex_RefreshFlashChart (60, chartName, 'en-us');
      getdata();}
    apex_SWFFormFix('#CHART_NAME#');
    addLoadEvent(chart_r#CHART_NAME#_InitRefresh(false))
    </script>
    Thanks in advance guys
    Glen

    So I've managed to take a small step forward....and realised my last effort with using collections was a little bit of a waste of time.
    I've gone back to reading the details posted by Hilary in Dynamic custom XML in resource gantt and using the sample pages supplied in the link http://apex.oracle.com/pls/apex/f?p=36648:60
    Anyway I've managed to get my page to render an AnyGantt Gantt Project using the dynamic XML I've generated via PL/SQL, this is nice as I've been able to now build XML that allows me to take advantage of the <connectors> tag to links tasks together via a hierarchy of prerequisites.
    Here is what I've done to date by using the examples supplied by Hilary.
    Under 'Shared Components' and 'Logic' i have created an 'Application Processes' called CHART_DATA which holds the PL/SQL code that will generate my XML from the <project_chart> tag down. (Thanks Hilary for the code)
    I then created a new page using the chart region and used my original SELECT statement.
    Once the page was created, i added a Hidden Page Item to the Gantt region which was defined as P23_DATA.
    I then added a 'AJAX Callbacks' under the 'Page Processing' section, this was defined as a 'Run on Demand Process', called CHART_DATA and pointed to the application process previously created called CHART_DATA.
    I opened the Gantt region for editing and within the 'Chart Attributes' i selected to delete the Series that the wizard had previous defined when creating the Gantt originally.
    Under the 'Chart XML' section is changed the 'Use Custom XML' to 'Yes' and edited the 'Custom XML' region, again by using the examples supplied by Hilary i removed the #DATA# and replaced it with my new hidden page item &P23_DATA. (please note the syntax includes an ampersand and a period at the end of the item name)
    Now for the bit that i don't really understand....
    Back to the main edit page screen, under the 'Page Rendering' section choose to edit the actual page and under the section 'JavaScript' there is a section labelled 'Function and Global Variable Declaration' which i sort of understand as a section to hold custom JavaScript code for function etc.  I added the function previously supplied by Hilary
    function getdata() {
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=CHART_DATA',0);
    gReturn = get.get('XML');
    get = null;
    Under the section beneath this labelled 'Execute when Page Loads', i supplied add a call to the above mentioned function.
    getdata();
    So this kind of works for me at the moment, however when the data changes in the base table which holds the tasks i need to close the page and reload multiple times for the data to be refreshed.  This is the section in the example from Hilary i'm still having a little trouble with, the example page Hilary supplied mentioned the following :
    8. To call the JavaScript function and ensure asychronous updates are
    picked up, the region source has been updated to replace #CHART_REFRESH# with
    the following:
    <script type="text/javascript" language="javascript">
    var chartName = '#CHART_NAME#';
    chartName = chartName.substring(1);
    getdata();
    function chart_r#CHART_NAME#_InitRefresh(pNow) {
      setTimeout("chart_r#CHART_NAME#_InitRefresh(true)",10000);
      if (pNow){apex_RefreshFlashChart (60, chartName, 'en-us');
      getdata();}
    apex_SWFFormFix('#CHART_NAME#');
    addLoadEvent(chart_r#CHART_NAME#_InitRefresh(false))
    </script>
    However i can't actually find on my page where this might live, i'm guessing somewhere in the Gantt region itself however maybe the pages have changed since Hilary originally wrote this.
    Thanks
    Glen

  • Displaying BLOBs

    Recently i've been working on a rather modest application, which lists contacts. When a detail-link was clicked, a popup would come up with more details and an image of that contact.
    The table this was based on contained a column photo_reference, which held a path to a folder under /i/. With this setup, it was easy to get the images working for each contact.
    The popup i showed was a bunch of htmlcode i put in the region footer, and hid. When the detail was clicked, i retrieved data via an application process, and show a modal dialog.
    Now the scope has changed: users need to be able to upload their own images. So, i went to work and made it so the images get uploaded into wwv_flow_files, and then i move them to a new contact_image table. So far so good. But now i want to display these pictures, and here i'm kind of stuck.
    * I could include a column in my IR, and put a blob format mask on it with image. I've got this working, but annoyingly. My image table has as primary key the field 'ID'. My contacts table also has 'ID' as PK.
    The format mask: IMAGE:APXT_CONTACTS_IMG:SMALL_PHOTO:ID::::::inline:.
    Here the PK field (ID) works with the PK of my base table (contacts). My link between tables is apxt_contacts.contact_image_id->apxt_contacts_img.id . The way i could make it work is to rename my id field in the image table to contact_image_id. (why couldnt it just take the column it's based on as the value :( ). I could then hide the column, and take the image with javascript to show in my popup. Also, this way preloads all images for the amount of selected rows.
    * get_blob_file_src also seems no use to me because of the limited use of the parameters (page items required etc).
    * I'd much rather be able to get the image blob via ajax to then display in my popup, but i have no clue as to how to do this. I've made a stored procedure which gets the file to download and call this from an application process (ajax callback), and with firebug i can see the post/response, but i wouldn't know how to get this displayed as an image.
    begin
    SELECT mime_type, lengthb(small_photo), filename, small_photo
    INTO v_mime, v_length, v_filename, v_lob
    FROM apxt_contacts_img
    WHERE id = p_contact_image_id;
    OWA_UTIL.mime_header (NVL (v_mime, 'application/octet'), FALSE);
    HTP.p ('Content-length: ' || v_length);
    OWA_UTIL.http_header_close;
    wpg_docload.download_file (v_lob);
    end;
    This way i'd only have to load the pictures of links clicked.
    I'd rather not have to grant execute to public and call the stored procedure via the link, but if this is my only route, id rather go solve it the first way.
    Instead of my existing code, should i make this work through creating another page, and juggle page items and their values around to try and get the same layout going, and then get that page through ajax? This would also mean extra work, im trying to minimize impact (=work) on the existing app.
    tl;dr: is it possible to retrieve an image blob from a table not in the report query, preferably through ajax?
    This is Apex 4.02 on an 11g db
    Thanks,
    Tom (handle pending :) )

    Our clients are a mixture of everything from Win98 to XP, including some Macs. There's no single place on every client I can be guranteed to have write access to. Many of our Windows users don't have write access to most of their C: drive, for exqample. Our Windows users have a standard F: drive on the network, but our Mac users don't.
    So I would have to ask them via a file requestor where to save the file to for viewing. And since WEB.SHOW_DOCUMENT needs a URL anyway, it seemed it would be more "transparent" to the user to move the BLOB file invisibly to the Apache server and launch it from there.
    My guess is there's an Oracle BLOB utility out there that writes a BLOB back to a disk file. I'm just new to the whole BLOB process and am hoping someone could get me pointed in the right direction.
    Dave

  • APEX Dynamic Actions?

    Hello i'm trying to figure how how to have a dynamic action populate text fields.
    When the create button is hit, it will insert the record in the DB like normal.
    I had a search box doing a dynamic action when a record_number is entered and the selection changes
    It populates the remaining text boxes with the results of the record_number.
    I used a "SET_VALUE" true action on each individual ITEM
    For each individual item i have different SQL Statement populating that item.
    Ex. To populate Last_Name/ P2_LAST_NAME item i do the following
    Select LAST_NAME from patient_Demographics
    where record_id = :P2_RECORD_ID
    Affected Elements:
    P2_LAST_NAME
    So i have about 8 of these true statements, so i'm hitting the DB 8 times to get the individual items.
    Is there a way to hit the DB once and set the items using one PL/SQL statement?
    I tried using a PL/sql function body, i'll admit, it didnt know what i was doing, it didnt work

    Hi,
    So as you've found out, support for setting multiple affected elements in 4.0 is very limited. Are you definitely trying this out on 4.0? The reason I ask, is because we only introduced the 'Page Items to Return' attribute in 4.1.
    In 4.0, I would suggest falling back to a combination of a dynamic action, some JavaScript and a page level AJAX callback, as described here:
    Dynamic Action - setting the the value of multiple Affected Elements
    I think this should work better for you than trying to manipulate the 'Execute PL/SQL Code' action in 4.0 to do this.
    Hope that helps.
    Anthony.

  • LAYOUT.T_ITEM_EXCEEDS_MAX error.

    Hi All,
    After upgrading Apex 4.2 I started to get error LAYOUT.T_ITEM_EXCEEDS_MAX for the page where we have more than 200 fields. Due to some reasons our client required some pages with more than 200 fields and we created a kind of AJAX callback to manage DML action. And it was working perfectly with previous version. But now we are getting the error.
    Is there anyway to turn-off this error?
    The code it causes the error is "apex_plugin.get_input_name_for_page_item(FALSE);"
    If I turn this off then it works ok. But I want to know whether there is an another solution or not for this.
    Regards,
    Osman.

    The documented component limit is 200 items per page. Prior to 4.2 this limit was 100 - perhaps they have tightened this in certain areas for reasons that we don't need to be aware of.
    http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35125/limits002.htm#BGGIECDF
    I've found sometimes the limit is tolerated, other times it is not.
    I'd call this expected behaviour.
    Scott
    blog: [url grassroots-oracle.com]grassroots-oracle.com
    twitter: [url twitter.com/swesley_perth]@swesley_perth

  • Dynamic labelling the buttons

    Hi,
    I have 10 departments and every department has different number of sub-departments.
    Users will select a particular department to run a report showing summary of the department
    and tabs or buttons for all the subdepartments available under that department.
    By clicking the button or tab for a subdepartment, the user would see updatable tabular
    form for that subdepartment.
    One solution is to create pre-labelled buttons for all sub-departments on the summary report and hide/show
    them basing on the department selection. Means, if the user selects department 1 it shows button 1 to 5 and if selects department 2 then button 6 to 12 etc.
    Can anybody suggest a better solution for this?
    Thanks,
    Zahid

    report showing summary of the department and tabs or buttons for all the subdepartments available under that departmentAre these buttons shown within the report's colums ? In this case it should be quite simple since you can use the column link feature and choose the link txt as some data column and style the button using some class definition(so that it look like a button, for example apex's link button template classes).
    If you are using tabs, how are you generating them - PLSQL Dynamic region ?
    If so , submit the page and get the PLSQL region's source to generate the content.
    By clicking the button or tab for a subdepartment, the user would see updatable tabular form for that subdepartment.From this I guess a submit would b simpler coz you need to reload this Tabulat form too
    <li>Another option would be to use Dynamic action to upon report refresh that
    1. fetches the button or tab label sing an Ajax callback function and assign the label appropriately
    2. Refreshes the Tabular form for the department

  • Skillbuilders Modal Refresh Item and Region separately on parent

    I have a page with two regions.
    One region has a LOV field and a button that calls a modal window to update the LOV values. On return I fire a DA based on the Modal autoclose event with a selection type of DOM Object and document object set to "document". That works.
    I have a second region and a button that calls a modal window to create a record for that region. I want the submit on that modal page to refresh the second region. This is not working. I tried to hang it off the first DA just to get it working. That did not work. That second region is a pl/sql region that calls a pl/sql procedure to build the region,  if that matters.
    harry

    Harry,
    A PL/SQL type region is not refresh-able like this through dynamic actions.
    One way to achieve something like this would be to recreate your PL/SQL region as an Application Process that is called On Demand (or even create an Ajax Callback in the page). You can then call this process via aja where it will return the results of your print statements. Then you would work with the return value to place it on the page.
    This thread shows example code that you could follow:
    Write Javascript from On Demand Process
    Greg

Maybe you are looking for

  • SRM data integration in EP with XI 3.0

    Hi friends, Our client wants us to integrate Purchasing related documents from SRM into the EP 6.0 using XI 3.0 as a integration software. We would like to show the SRM related XML document in an iview format in the EP 6.0. I would like to know if an

  • Print out in MB90 for GRN is not coming in English

    Dear Friends, While taking the print out in MB90 for GRN document, it is not coming in English.It is coming in some unreadableformat. In MN21 I have mentioned the language as EN. In the configuration of output type WE03 I have mentioned the language

  • Handling soap fault messages

    Hi All, I had webservice and am able to pass geneate proper response based on client request but when they are making invalid request i.e removing some tag or making syntax related mistake, in response i'm getting exception related to <faultcode>soap

  • How can you set up a mail group

    I want to set up different mail groups how do you do that

  • Exception thrown from action: copyGroupFromJar

    While installation of Oracle AIA2.5 I have been getting these errors. Might be this is a problem with Oracle Inventory, I am not too sure. How do I solve this and complete my installation process. Presently we are planning for AIA integration between