This discussion is archived
1 2 3 4 Previous Next 53 Replies Latest reply: Nov 10, 2008 6:53 AM by StewStryker Go to original post RSS
  • 30. Re: Partial refreshing of pages in 2.0 ?
    43847 Newbie
    Currently Being Moderated
    Carl,

    As you mentioned in this thread rather than going to another page to get a complete report region this could be accomplished via an application process. That's the approach I'm attempting to take here - because I'm pig-headed I guess. Regardless, here's the javascript that gets called from my select item on my page.

    function updateReportRegion(pProcess){
    var get = new htmldb_Get(null,100,'APPLICATION_PROCESS=' + pProcess,0);
    var gReturn = get.get('XML');
    get = null;
    html_GetElement('ReportDrop').innerHTML = gReturn;
    }

    My application process basically constructs a table based on my sql that is supposed to get dropped into the ReportDrop div tag - which I've setup as the region source for the report region.

    2 questions:
    1: is the a viable approach?
    2: if so, since my application process creates an html table is the gReturn supposed to be looking for the XML of the get object or should I be doing something else there?

    A 3rd question comes to mind: where is the htmldb_Get documented?

    Thanks for any help you can offer.

    Earl Lewis
  • 31. Re: Partial refreshing of pages in 2.0 ?
    357241 Oracle ACE
    Currently Being Moderated
    Hello,

    1. Yes this is a perfectly viable option and gives you the most control over your output.

    2. No don't use the XML option, only use that if you specifically want to return an XML object just call. var gReturn = get.get(); and you'll be fine.

    3. It's not documented anywhere and you probably won't see any official documentation anytime soon, at the moment the forums and everybodies linked examples are the best places to find the best usage of the javascript functions and objects.

    I will make a concerted effort to get at least a faq / minimal documentation up the next week or so.

    Carl

    Message was edited by:
    Carl Backstrom
  • 32. Re: Partial refreshing of pages in 2.0 ?
    531522 Newbie
    Currently Being Moderated
    Greetings everyone,

    I am having trouble creating a simple auto updating report, following Carl's example here - http://htmldb.oracle.com/pls/otn/f?p=11933:40:2609569371478408

    My page can be reached here - http://htmldb.oracle.com/pls/otn/f?p=24954:1:7449931365708380:::::

    Every 5 seconds the report is supposed to refresh. Using Javascript window.alert statements to debug (currently commented out), I can see that only the first call to html_GetElement('r_R819657530874325676'); returns an element. In fact, the first call refreshes the report successfully. However all subsequent calls fail - html_GetElement returns null. The Javascript function mon_Refresh() does get called every 5 seconds, at least. :)

    I copied/pasted the Report Header code found in Carl's example, replacing #REGION_ID# with my Region ID. I was actually unsure of how to obtain this region ID without digging through the generated source - I used what is evidently the Region ID found in the "Spread Sheet" link. That ID is R819657530874325676.

    I put the call to mon_Refresh() in the page's On Load section, and I put the mon_Refresh() body in the page's Header Text. Here is the body:

    <script language="JavaScript">
    function mon_Refresh(){
    setTimeout("mon_Refresh()", 5 * 1000);
    elem = html_GetElement('r_R819657530874325676');

    /*
    if (elem == null) {
    window.alert("element r_R819657530874325676 is null");
    } else {
    window.alert("element r_R819657530874325676 is not null");
    }
    */
    attrib= elem.getAttribute('htmldb:href');

    /*
    if (attrib == null) {
    window.alert("attrib r_R819657530874325676 is null");
    } else {
    window.alert("attrib r_R819657530874325676 is not null");
    }
    */
    html_PPR_Report_Page (null,'R819657530874325676',html_GetElement('r_R819657530874325676').getAttribute('htmldb:href'))
    }
    </script>

    The "elem=..." and "attrib=..." lines are there for debugging purposes. As mentioned above, elem==null for all calls after the first. [elem is the result of the call to html_GetElement('r_R819657530874325676');]

    I tried both Standard and Standard (PPR) templates, for what it's worth.

    Any advice would appreciated.

    Thanks,
    Mark
  • 33. Re: Partial refreshing of pages in 2.0 ?
    531522 Newbie
    Currently Being Moderated
    Hi, I hate to "bump" posts, but I'm stumped. Any input at all would be appreciated, even it's just to say I'm a lost cause. :)

    Thanks a lot,
    Mark
  • 34. Re: Partial refreshing of pages in 2.0 ?
    60437 Employee ACE
    Currently Being Moderated
    Mark - I created page 2 in your app which does what you intend, I think. What I did was take the code you had in the report region header and put in into the "before rows" section of the report template (I made a copy of the Standard (PPR) template and made that the template for the report). And in that code you actually need to use #REGION_ID#, not the replacement value with the actual region ID number.

    Scott
  • 35. Re: Partial refreshing of pages in 2.0 ?
    531522 Newbie
    Currently Being Moderated
    Thanks a lot Scott! Figures I was doing something silly.

    On a side note, I was wondering if you had any idea why, on refresh, the mouse cursor becomes an hourglass, as opposed to the normal pointer. Kind of gives the refresh less of a seamless feel. I suppose it's a browser issue, outside of the scope of Apex. Or possibly a Windows issue, because both Firefox and IE on Windows exhibit this behavior, while Firefox on Linux does not.

    Thanks,
    Mark
  • 36. Re: Partial refreshing of pages in 2.0 ?
    chrissy2 Explorer
    Currently Being Moderated
    Hi,

    I've implemented it in my application and it is working perfectly, but depending on the selection I need different reports.
    So must I create for every report an own page or is it possible to create all reports on one page and than define somehow what report should be shown. So when selecting 1 Report1 is shown, when 2 Report2 is shown ...

    Thanks
  • 37. Re: Partial refreshing of pages in 2.0 ?
    Cherni Newbie
    Currently Being Moderated
    Hi Carl,

    I have tried implementing your excellent example http://htmldb.oracle.com/pls/otn/f?p=11933:48:2576101578276736 and have been unable to get it to work. I have gone through it step by step but i still get a Javascript error relating to the function dhtml_GetReport(pThis). The error is Object Expected on line 13...
    => var l_Val = html_SelectValue(pThis);

    I have also included the files htmldb_html_elements.js and htmldb_get.js just in case you were wondering. We are using HTMLDB 1.6.1.00.02 if that could be the issue here.

    Any ideas off hand that you think of?

    Thanks.
  • 38. Re: Partial refreshing of pages in 2.0 ?
    47771 Newbie
    Currently Being Moderated
    Hi Scott.
    I've implemented same code (yours and Mark's), and it works fine, passing parameter about region id. So I can add and delete dynamically rows from a table and watch them on line without refreshing the entire page. Working flows seems to be great! But, if rows end (delete from table), I got a 'no data found' (good), and after that I reinsert a new row, but nothing happened until I refresh the page. Seems that after a 'empty' report event javascript function mon_refresh is not able to refresh anymore.
    Does it make sense? Does this happen even to you and Mark?
    Bye
  • 39. Re: Partial refreshing of pages in 2.0 ?
    81853 Newbie
    Currently Being Moderated
    Is it possible to create a vertical PPR report?
  • 40. Re: Partial refreshing of pages in 2.0 ?
    357241 Oracle ACE
    Currently Being Moderated
    Hello,

    Yes you can absolutely create a vertical PPR report you just have to do a little reverse engineering of the provided PPR report templates.

    Carl
  • 41. Re: Partial refreshing of pages in 2.0 ?
    BillC Newbie
    Currently Being Moderated
    Hi Carl,
    I implemented your example and it works great!

    I'm using it in a popup and when I execute it in the popup it works great also BUT when I run the mouse over the report it gives all kinds of mouseover errors.

    The extra page, your page 47, I created a template with the code you provided.
    I don't know what a PPR template is.. is that what is causing the errors?

    Bill
  • 42. Re: Partial refreshing of pages in 2.0 ?
    641361 Newbie
    Currently Being Moderated
    Hello, Carl. Thanks for your examples!
    One question about this page: http://htmldb.oracle.com/pls/otn/f?p=11933:48
    Is it possible to make working sorting and pagination in "child report"?
    I guess the problem is in wrong PAGE_ID, but I don't see a solution...
    Thank you in advance!
  • 43. Re: Partial refreshing of pages in 2.0 ?
    641361 Newbie
    Currently Being Moderated
    I've solved it by redefining $a_report function with static page_id within "parent" page. Anyway thanks.
  • 44. Re: Partial refreshing of pages in 2.0 ?
    Martin Giffy D'Souza Oracle ACE Director
    Currently Being Moderated
    Hi,

    I have been able to get this working in my environment (3.01). Any idea on how I can get it to work in IE?

    Thank you,

    Martin