Af:region, PPR and onload handler

We develop custom JSF components that need some javascript counterpart on the client.
These counterparts needs to be initialized (through some AJAX calls) when the page is ready to be displayed.
In old technologies, this was done through an "onload" javascript handler placed on the page.
In Apache Trinidad PPR, the page is already loaded when the components are rendered, and we need to register those scripts at render time (in encodeEnd) through :
ExtendedRenderKitService service =  Service.getRenderKitService(context, ExtendedRenderKitService.class); 
service.addScript(context, jsMethod);This method is available in ADF, so we can reuse this.
However, since the default onload mechanism already calls the scripts, and we want the scripts to be called only once, we need to make sure we are in a PPR context by using something like
reqContext.isPartialRequest(context);Now, in an af:region use case, we are not really in a PPR rendering (isPartialRequest returns false). What API should I use to check that the page is already loaded and we are just rendering a new region in that page ?

I tried the AdfFacesContext.getCurrentInstance().isInitialRender() through layers of reflection, to keep independent at compile time from ADF.
However, even when this "initialRender" flag is true, the page rendering (client side) still goes through ADF AJAX calls and does not happen directly in the browser window.
I need in fact to detect, server side, whether the HTML I'm rendering will be executed directly in the browser (in that case, the "onload" happens) or through some indirection on the client where DOM elements such as "document" or "window" may not exist. In the latter case, I will register a script through the ExtendedRenderKitService class.
Any idea on the way I can do this in case of an af:region ?

Similar Messages

  • Dynamic region bugs and bad documentation

    I cannot get the second taskflow to behave correctly in a dynamic region.
    Here's my scenario:
    In the pursuit of resusablilty, I have two taskflows that are coming from ADF Library Jars into a master application.
    Both taskflows have their own associated application modules, which appear as data controls in the master project.
    Following the instructions in the Fusion Developers guide, I create a dynamic region and dynamic links.
    After swapping to the second task flow, when I click on a different table, I get an error that a target is unreachable:
    Target Unreachable, 'RoleId' returned null
    For more information, please see the server's error log for an entry
    beginning with: Server Exception during PPR, #1{code}
    I posted the problem originally under this thread: [dynamic region errors
    and got a response that I didn't understand -- both taskflows have data-control-scope = shared.
    In contrast to the problem using a dynamic region, if I build a different page in the master application and use each taskflow as *separate* regions (via a tabbed panel), they work fine.
    So it doesn't seem there is anything wrong with the taskflows per se, but rather something in the dynamic region switching mechanism that is broken.
    I'd appreciate hearing from anyone who has had similar problems or anyone who knows of a solution.
    In exasperation, lili5058
    UPDATE
    Sorry for the earlier rant. I figured out the reason for the odd behavior and it has to do with the code generated by the wizard. This code isn't so much wrong as it is short-sighted. Here's the code generated for the managed bean by the wizards for creating a dynamic region and dynamic link that is put into *backingBeanScope*:
    {code:java}package view.beans;
    public class DynamicRegionBean {
    private String taskFlowId = "/WEB-INF/taskflow1.xml#first-taskflow";
    public DynamicRegionBean() {
    public TaskFlowId getDynamicTaskFlowId() {
    return TaskFlowId.parse(taskFlowId);
    public String firstTaskflowtaskflow() {
    taskFlowId = "/WEB-INF/taskflow1.xml#first-taskflow
    return null;
    public String secondTaskflowtaskflow() {
    taskFlowId = "/WEB-INF/taskflow2.xml#second-taskflow";
    return null;
    }{code}
    The user is taken to the second task flow by clicking the link that executes the secondTaskflowtaskflow() handler, however, any subsequent requests take the user back to the first taskflow, i.e., the one assigned to the private instance variable, since that's how the wizard wrote the code. This explains why the table on the second taskflow displayed "Fetching Data . . .". The table's content delivery was set to lazy, so when the browser issued the AJAX request to get the data for the table, the task flow switched back to the first one and thus making the data unavailable. Changing the the content delivery attribute value to immediate, brings up the data initially, but any subsequent work on that taskflow routed the user right back to the first taskflow.
    I ended up fixing the problem by adding the TaskFlowId (data type) to the pageFlowScope map, so it would be remembered across requests until the user deliberately requests a different taskflow.
    Edited by: lili5058 on Feb 7, 2009 12:56 PM
    Edited by: lili5058 on Feb 7, 2009 5:06 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hi,
    chances are you are hitting a bug. But this is hard to say from here. If you want, we can further track the issue down. I suggest you exclude the use of ADF libraries and verify that the scenario works if the two taskflows work in the mentioned scenario of they are both defined in the project itself. If this works then it seems like a bug that should be filed. Can you verify this ?
    Frank

  • Template: 13. Standard (PPR) and column sorting

    When I use the template "template: 13. Standard (PPR)" and have column sorting setup for that region, I get the following script error when accessing my app and try to sort on a column.
    missing ) after argument list
    html_PPR_Report_Page(this,'R142222838802...3829',false,false,false,'fsp_sort_7')');
    Have other seen this error too? The work around for me is to not use the PPR template.
    Regards,
    Todd

    Hello,
    PPR (Partial Page Refresh) is just a term used to describe some AJAX pagination and sorting functionality, it's just a holdover from before the term AJAX existed.
    You can just change the template and on your report to enable that functionality. In 3.0 it will just be on off switch in your pagination options.
    Carl
    Message was edited by:
    Carl Backstrom

  • Issue with PPR and/or item session state

    using version 3.2
    On my Page2, I have two regions: HTML and a report.
    In the HTML region, I have two datepickers: FROMDATE and TODATE
    Their defaults are set to the min and max of a DATECREATED field in my table.
    In the report region is a classic report generated by sql getting all rows with a DATECREATED between the values of the two datepickers.
    In the header of the report region, I'm using the following to do a partial page refresh of the report region:
    *<script type="text/javascript">*
    *function p2Refresh(){*
    *$a_report('#REGION_ID#'.substring(1),'1','15');*
    alert($x('P2_FROM_DATE').value);
    *</script>*
    *<input type="Button" value="Refresh List" onClick="p2Refresh();">*
    I'm just using the alert pop-up to verify the info in the datepicker.
    The problem is that if I change the dates and hit the 'refresh' button, the report is NOT using the current value of the datepickers.
    I've also tried the following which is fired from an 'onChange' event of the datepickers
    *<script type="text/JavaScript">*
    *function setDate(pItem, pValue){*
    var get = new htmldb_Get (null, $x('pFlowId'), null, 0);
    get.add(pItem, pValue);
    get.get();
    get = null;
    *</script>*
    Any clues would be great.
    Thanks.
    Edited by: 903802 on Dec 21, 2011 8:27 AM

    Solved it.
    I made two changes. First, the 'onChange' for the datepickers, updated the state for both datepickers at the same time:
    *<script type="text/JavaScript">*
    *function setDates(){*
    var get = new htmldb_Get (null, $v('pFlowId'), null, 0);
    get.add('P2_FROM_DATE', html_GetElement('P2_FROM_DATE').value);
    get.add('P2_TO_DATE', html_GetElement('P2_TO_DATE').value);
    get.get();
    get = null;
    *</script>*
    However, the fix was actually because in the *"var get = "* statement, I had used *$x* instead of *$v*.
    Works like a champ now.

  • Session pooling and statement handles

    Hi there,
    I have a large multi-threaded application (perhaps >100 threads). Each thread is continuously processing events (very high volumes) which involves some manipulation and some database operations (from a fixed set of possible operations).
    I am using session pooling but what I want to know is, Should I:
    (a) Prepare my fixed set of statement handles up front at program start-up when I'm creating the session pool and then reuse the statement handles in each event processing thread (also, is this thread safe ? even if it is, all threads would be contending on the same statement handles)
    or
    (b) Prepare the statement handle for each event which presumably will exploit the statement cache on the session pool. This would also mean not having statement handles shared between threads thus removing any thread contention issues.
    I think (b) is the option for me, but does anyone have any thoughts ?

    With a), one would think it's OK, but I would hate to find out that it's not thread safe by accident.
    But anyway, with b) the cost of allocating private statement handles in each thread seems very low. The memory required for the statement handle plus its bind and define handles could very well be below 8k per statement. If you've got say, 5 statements * 100 threads, you're only looking at around 4MB overall.
    Finally, you might want to make sure that the session pool statement cache is working by checking the values for 'executions' and 'parse_calls' in V$SQL for your statements.

  • Currency in report taken from regional setting and not infocube

    Dear All,
    I am facing very strange issue. I am using BEx analyzer 7.0
    I executed a report in Windows 2000, Excel 2003. The values are displayed correctly with currency which is in cube irrespective of the currency set in regional option in control panel.
    We are doing testing on windows vista and excel 2007 as we will upgrade to SAP GUI 7.10 and windows vista. I executed the report and the result values are matching but the currency is differant. The currency is taken from the regional settings in control panel. If I go to regional setting and change the currency, the report which is open in BEx analyzer changes the currency.
    We are facing this strange issue for only queries on 1 infocube. Other queries on another infocubes/multicubes are working fine.
    Has anyone faced the same issue. Please provide some pointers/solutions for above issue.
    Regards,
    Niraj

    Hi Shalu
    The Library 0FL has 4 currencies... i.e.
    HSL  - Local Currency  
    TSL   - Transaction Curre
    KSL  - Second Currency 
    OSL  - Third Currency  
    Go to GRR2 (Report form of your report), and double click on any column... You choose Key Figures in the Columns in a areport painter report... there you would have chosen any one of these currencies...
    Right click on the column and Copy it and paste it... Now change the Key Figure of the copied column to the one you desire...
    This should give you values in both currency...
    To identify which form you have used in GRR2 - Execute your report and go to Extras Menu > Technical Information.. In the pop up window that opens, double click on field "Report".
    Regards
    Ajay M

  • For IDOC monitoring, analysis and error handling in  ALE & idoc

    Hello...experts..can u please tell me about idoc monitoring,analysis and error handling..and can u please tell as per interview  point of view in this area..if availble can u send material about this...
    thx
    Message was edited by:
            durga kottapalli

    Hi,
    Reprocessing IDocs with errors
    Outbound (BD88)
    Once the error has been determined and corrected it is not necessary to resend the IDoc again. You simply resend the IDocs that have already been generated.
    Using the IDoc overview screen you need to take note of the following for each IDoc that was not processed:
    Error number: 2, 4, 5, 25, 29
    Error number: 30 (Execute Check IDoc dispatch to process)
    IDoc number
    Using the Error number, the IDoc number and the transaction BD88 , with the required message type you can resend the IDoc. Match the error number with this transaction and execute the function for the IDocs incorrectly processed.
    Just check the below link, u will get all IDOC related Interview questions
    http://www.allsaplinks.com/idoc_sample.html
    http://www.allsaplinks.com/
    http://www.sappoint.com/abap.html
    http://www.sap-img.com/
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDISC/CAEDISCAP_STC.pdf
    http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFAALEQS/CABFAALEQS.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDI/CAEDI.pdf
    http://www.sappoint.com/abap.html
    http://sap.ittoolbox.com/documents/popular-q-and-a/extending-a-basic-idoc-type-2358
    http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
    http://expertanswercenter.techtarget.com/eac/knowledgebaseCategory/0,295197,sid63_tax296858_idx0_off50,00.html
    http://www.sapgenie.com/sapedi/index.htm
    http://www.allsaplinks.com/idoc_sample.html
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEIO/BCMIDALEIO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEPRO/BCMIDALEPRO.pdf
    http://help.sap.com/saphelp_47x200/helpdata/en/dc/6b7eee43d711d1893e0000e8323c4f/frameset.htm
    http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
    http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
    http://www.sap-img.com/
    http://www.allsaplinks.com/
    Regards,
    Suresh.
    Message was edited by:
            SureshKumar Ramamoorthy

  • How to modify regional settings and keep Acrobat 9.4.1 working?

    When I modify the regional settings on my W7 PC (i.e. switching the decimal symbol and digit grouping symbol from dot to comma and vice-versa), I cannot print to Adobe PDF Printer nor can I convert Office documents to PDF files anymore. It seem like the joboptions files were getting corrupted (I can see read errors).
    Can anyone advise on how to modify the regional settings and keep Acrobat 9.4.1 Pro working properly? Do I have to adopt the joboptions files (and if yes, how?)?
    Thank you for your advice!

    The defaults for three are blank entries. That is there are no defaults, The only way to get those back to being blank would be to delete your preferences file ( Home->Library->Preferences->com.apple.Aperture,plist ) and possibly the files in *Home->Library->Program Support->Aperture* (but I don't think you would need to do these, not sure.)
    However before you do this you should know there is no drawback to having these entries filled in. Aperture would only attempt to use them if you actually selected them while using Aperture. It won't be looking for them on startup. And if the programs pointed to by these entries no longer exist on your system Aperture won't even fill in the names in the menu items where these are pointed to ( *Photos->Edit with* for example)

  • Maximum number of the "records" in: Aggregated bill and payment handling

    HI,
    currently we are dealing with proposal and design of processes/settings in area Aggregated bill and payment handling among distributor and suppliers.
    Do you have experience and/or knowledge with maximum amount of records in related processes , like:
    Supplier side:
    - the maximum number of the individual postings aggregated in agregated posting on the supplier contract account?
    - the maximum number of the of the aggregated postings included in aggregated bill (print document)?
    - and consequently the maximum number of the  individual print documents included and printed/sent in aggregated bill (print document)? Also in case, if the aggregated bill is send as IDOC with details ?
    - the maximum number of the IDOCS sent in aggregated IDOC?
    - the maximum number of the records in distribution lot created form aggregated billing?
    Distributor side:
    - the maximum number of the individual electronic bills posted in aggregated form on the supplier contract account during processing ?
    - the maximum number of the individual payments included in PAN?
    Thanks
    Tomas.

    Hi,
    I would not receive too many documents into an aggregated document (suppier and distributor side). Try to find an error in a distribution lot or payment advice note with more than 10000 items. You can use posting area R0070 and R0071 (TX FQC0) for limit the size of aggregated postings.
    Best regards,
    Alexander

  • Mapping and Error handling in Seeburger Adapters ?

    Hi,
    1.   In B2B integration part of PI.Whats the way of doing mapping in XI mapping editor and error handling in the mapping ?
    2. Do you think SEEBURGER BIC mapping designer is must for developing maps ? cant we develop same maps in XI mapping editor?
    Thanks and regards,
    Ram.
    Edited by: Ramakrishna kopparaju on Sep 30, 2008 12:27 PM

    Whats the way of doing mapping using seeburger adapters
    The standard mappings are part of Seeburger Suite and if any additional mapping has to be accommodated, then custom mapping could be developed in Seeburger BIC Mapper tool. This has to deployed on adapter engine then. The other mapping is the normal XI mapping (message, java, xsl) which could be performed based on business logic.
    error handling in the mapping ?
    The easiest way is to raise Alert based on the errors in mapping.
    Regards,
    Prateek

  • Physical inventory with and without handling unit managment

    Hello all,
    I would like to know what is the difference between physical inventory with and without handling unit management.
    Pl. advise.
    Thanks,
    Maxx

    Assuming you are referring to WM inventory, it is very similar.  Inventory is conducted at the SU level in WM if you are HU managed.  One of the most widely known issues is the lack of ability to post differences of nested HUs at the WM level.  If you are not using nested HUs, the process is the same as storage unit management without handling unit management.

  • Difference between Report Template "Standard (PPR)" and "Standard"?

    What is the difference between Report Template "Standard (PPR)" and Report Template "Standard"? What does PPR mean and what makes it different? Why would you use PPR rather than just standard?
    Thanks,
    Linda

    Hello,
    PPR (Partial Page Refresh) is just a term used to describe some AJAX pagination and sorting functionality, it's just a holdover from before the term AJAX existed.
    You can just change the template and on your report to enable that functionality. In 3.0 it will just be on off switch in your pagination options.
    Carl
    Message was edited by:
    Carl Backstrom

  • Substitution For Region, Button and Tab

    We are building a general security table with groups of users(LDAP, Banner etc.) and what they can access in APEX. The table will be accessed from a custom function in Authorization schemes in any application or workspace in order to control security all in one location. I want to create 5 generic authorization schemes-one for applications, pages, regions, tabs and buttons that call this function with the appropriate parameters. This is easy in the case of the application and page eg. Security_Function(app_id=>:APP_ID, app_user=>:APP_USER , app_object_type=>='Page', app_object=>:APP_PAGE_ID).
    If the authorization scheme is applied to a region, button or tab, is there a way to reference dynamically the current region, button or tab ( in the same way it can be done for the page) in order to make the authorization scheme dynamic and generic?
    Karen

    Hi,
    As I understand it, that's not yet available - see: Determine current renderd item, region,... for use in authorization schema
    Andy

  • Font and text handling in iWeb.

    Hello, everyone.
    How are fonts and text handled by iWeb ? I am now working on a website and have chosen to work with Gil Sans as one of my primary fonts.
    Is this font included as default in a standard installation of Windows ? What about OS X ?
    In case I create iWeb pages using this font what will happen when I publish these pages ? Will they be preserved as text ? In this case how will this font be handled by Windows and OS X ? Will the OS's replaced the absent font with another one ? What would the selection of a replacement be based on ?
    Or will iWeb replace the text created in Gil Sans with an image of the text to ensure that the display of the web page follows my intended format ?
    Thank you in advance,
    Joseph

    Here is a list of websafe fonts:
    http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html
    You might want to google 'web safe fonts' and compare other lists to that one just to check.
    1. I think you're talking about ALT tags. You could do this as a workaround but it would still be slow loading, and search engines would index it as images, so your text would appear in Google images for example. You might also want to consider whether anyone might need to copy and paste any of your text at some point, and whether you'd ever need to print pages (they will be more ink-intensive and lower quality).
    2. You can embed fonts in your webpage; however this only works on PCs and Macs running Windows: http://www.sean.co.uk/a/webdesign/embeddingfonts_inwebpages.shtm
    Another way around it is to offer an install of the font (check it's shareware and don't forget to offer both Mac and PC versions) and recommend to your visitors that they install it.
    Also remember that whichever font you use, a visitor may have altered their browser settings to display your text differently anyway.

  • Referencing a source datagrid from within a drag and drop handler

    My application implements a drag and drop between two datagrids.
    I would like to keep track of how many times a particular row in the source datagrid has been dragged to the target.
    The drag and drop handler should increment a DataGridColumn in the source datagrid row each time this happens.
    I can't figure out a way to refer back to the source datagrid and set a value in its dataprovider from within the drag and drop handler function.
    The source datagrid is in a module and the target datagrid in in a popup called from the module. The function below is in the popped up custom component.
    public function dragDropHandler(event:DragEvent):void
       if (event.dragSource.hasFormat("items"))
          var sComponentName:String;
          var iPos:int;
          //From which component was the drag initiated? This works sComponentName is set
          sComponentName = String(event.dragInitiator);
          //This does not work, compile error
          iPos = event.dragInitiator.selectedIndex;
             trace("Comp:MealPlanDetailCreate, function:dragDropHandler - event.dragInitiator: " + event.dragInitiator + "    parent container: " + event.dragInitiator.parent)
            trace( "    sComponentName: " + sComponentName +" name pos: " + sComponentName.indexOf("dgMP"))

    Hi ZolanSilv...,
    attached is an example of what i mean.
    Hope it helps.
    Mike
    Message Edited by MikeS81 on 08-18-2008 12:35 PM
    Attachments:
    draganddrop_image_LV85.vi ‏19 KB

Maybe you are looking for

  • How to make website links out of background jpeg (co-ordinate tracked clicks)

    I am an illustrator working on my website that i have drawn out by hand and scanned in to a jpeg.  it is set to fit the whole screen, and i have drawn out where i want the navigation links.  how do i get dreamweaver to use co-ordinate clicking to lin

  • Profir center determination in non leading ledger in tcode ABAA

    Hello experts, We are working on ECC6.0 and parallel ledger is already activiated. To post the unplanned depreciation only in the non leading ledger, I have created new transaction  type and attched it to non leading dpereciation area. After  entring

  • WSI Validation in Jdeveloper

    I tried to validate a wsdl against the wsi standard like shown in: http://www.oracle.com/technology/products/jdev/howtos/1013/ws-i/wsi_howto.html But my jdeveloper (10.1.3.1) prompts: C:\Programme\OracleJdevSOA10.1.3Prod\jdev\mywork\wsia.bat -config

  • BEx: diagram missing in workbook

    Dear experts, I have included a diagram in a workbook (via menu -> layout -> diagram) and saved the workbook. When I start the workbook again (via role in SAP) the diagram is disappeared. We use BI 7.0, but the query still was created under BW 3.5. H

  • How to change from Mac OS X to Mac OS X Server

    Hello everyone? I have a Mac Pro Late 2013 with Mac OS X v10.9.4. I want to change from Mac OS X to Mac OS X Server v10.9.4. Is it possible?