UIX/BC4J:  Page properties/Events/Methods

The following is code for a UIX page event handler and a method that attempts to locate the data that is selected from a bc4j:table, use it, and then handle redirection to the next page.
I had to comment out the setPageProperty block due to an error, oracle.jbo.Key, that keeps the method from running. This also means my page property is not available for use by the method.
When the method runs I expected to be able to see the row that was selected in the table by virtue of the findRowByKey ... keyBinding ... selectionKey. Instead, the return value for the line: Row row = vo.getCurrentRow(); is always the last record in the view object.
This led me to the alternative plan to create a page property for the selectedKey and use vo.getRow(key) to get the record. This won't work for me because I can't get the page property to work.
Can you help me with my understanding/syntax please?
**** UIX Event Handler ****
<event name="getemployee">
<bc4j:findRootAppModule name="AppModule">
<bc4j:findViewObject name="VO">
<bc4j:findRowByKey>
<bc4j:keyBinding>
<bc4j:selectionKey name="viewTable" key="key"/>
</bc4j:keyBinding>
<bc4j:handlers>
<!-- Gives page error: oracle.jbo.Key -->
<!--
<bc4j:setPageProperty name="selectedKey">
<bc4j:selectionKey name="viewTable" key="key"/>
</bc4j:setPageProperty>
-->
<method class="PageController" method="getInfo" />
</bc4j:handlers>
</bc4j:findRowByKey>
</bc4j:findViewObject>
</bc4j:findRootAppModule>
</event>
**** Method that should use page property to display record from view object. ****
public static synchronized EventResult getEmployeeInfo(BajaContext context,
Page page,
PageEvent event) {
ViewObject vo = ServletBindingUtils.getViewObject(context);
String selectedKey = page.getProperty("selectedKey");
System.out.println("selectedKey: " + selectedKey); //null
// I am hoping to get the property here.
//Row row = vo.getRow(selectedKey);
Row row = vo.getCurrentRow();
System.out.println("Current Info- Item1:" + row.getAttribute("Item1") +
", Item2: " + row.getAttribute("Item2"));
}

Hello Vincent,
I'm not sure why it does not work. Perhaps you haven't set the keystamp in your table?
<bc4j:keyStamp>
<bc4j:rowKey name="key"/>
</bc4j:keyStamp>
Besides your code tries to get the row in two times. Once in your event handler and ones in your method. That's not necessary, just do it once, either in your UIX page or in your Java method.
If you do it in your UIX page, you can get the row directly in your method. Here is an example:
UIX
<bc4j:findRootAppModule name="appModule">
<bc4j:findViewObject name="viewObject">
<bc4j:findRowByKey>
<bc4j:keyBinding>
<bc4j:selectionKey name="viewTable" key="key"/>
</bc4j:keyBinding>
<bc4j:handlers>
<method class="..." method="doSomething" />
</bc4j:handlers>
</bc4j:findRowByKey>
<bc4j:executeQuery/>
</bc4j:findViewObject>
</bc4j:findRootAppModule>
Then you can access row in your method
Row row = (Row)bajaContext.getProperty("http://xmlns.oracle.com/uix/bc4j", "row");
Regards,
Christian

Similar Messages

  • UIX-XML BC4J Question regarding event handling

    How can I use/access Application Module, defined in UIX-XML page (using <bc4j:registryDef>), in my event handler method ???

    Sorry for the confusion. I figured out what you were asking.
    The right way is this.
    First, in your UIX XML page, declare your handler like this:
    <event name="%myEvent%" >
    <bc4j:findRootAppModule name="%ModuleName%" >
    <method class="%eventclass%" method="%eventmethod%" />
    </bc4j:findRootAppModule>
    </event>
    the strings in the % have to be replaced with your own particular names. %ModuleName% should be the same as the name of the module in the registry.
    Then in the event handler %eventclass%.%eventmethod% you can use this to find the Application Module:
    oracle.jbo.ApplicationModule mymodule
    = oracle.cabo.data.servlet.bind.ServletBindingUtils.getApplicationModule(context);
    "context" is passed in to your event handler as a BajaContext. ServletBindingUtils has several other methods for getting BC4J stuff, you should look at its definition.
    Joe

  • CAN't find Parameters, Events and Approval tabs in the Page Properties opti

    Hi Gurus,
    I am trying to test the approval process. I have created a page group and also created a page under that. I don't find the 3 tabs Parameters, Events and Approval in the Edit Page/Page Properties option. Please reply me what I have to do to activate those tabs.
    Thanks
    Raj
    ---------------

    In your Page Group properties ensure that parameters and events are enabled. Once they are enabled at the page group level, the tabs should appear in your page properties.
    Thanks,
    Candace

  • ADF UIX Partial page rendering

    Hi
    I am facing a mysterious problem with partial page rendering in ADF UIX.
    My page contains a <header> H1 and inside this there are two headers(H2 and H3).
    The partial page rendering is in the header H2 and is working fine.
    When i remove the below header H3 the partial page rendering ceases to work and get stuck.
    Pasting the full code below. Please suggest.
    <?xml version="1.0" encoding="windows-1252"?>
    <!-- $Header: registration.uix 115.4.51.4 2009/12/14 13:10:05 kcthirum noship $ -->
    <page xmlns="http://xmlns.oracle.com/uix/controller"
    xmlns:ui="http://xmlns.oracle.com/uix/ui"
    xmlns:ctrl="http://xmlns.oracle.com/uix/controller"
    xmlns:html="http://www.w3.org/TR/REC-html40"
    xmlns:myTemplate="http://xmlns.oracle.com/xhub"
    xmlns:bc4j="http://xmlns.oracle.com/uix/bc4j"
    xmlns:data="http://xmlns.oracle.com/cabo/marlin" expressionLanguage="el">
    <!--This UIX page is used as a tutorial page for new developers, which is why it has a lot of comments-->
    <!--This section describes the ApplicationModule used by this page, and any View Objects that are used to display UI components or are used in any of the event handlers-->
    <bc4j:registryDef>
    <!-- XhubRegAM is the application module used by the entire Registration flow. defFullName is just the class. configName is the Configuration, which always has the pattern <AM name>Local -->
    <bc4j:rootAppModuleDef name="XhubRegAM"
    defFullName="oracle.apps.snw.tpadmin.server.XhubRegAM"
    configName="XhubRegAMLocal" releaseMode="stateful">
    <bc4j:viewObjectDef name="TpProfilesRegVO" rangeSize="1" autoCreate="false"/>
    <bc4j:viewObjectDef name="UsersRegVO" rangeSize="1" autoCreate="false"/>
    <!--IdentifierDomainsView drives the dropdown list of Identifier Types-->
    <bc4j:viewObjectDef name="IdentifierDomainsView" rangeSize="20"/>
    <!--XhubTerritoriesTlView drives the dropdown list of Countries-->
    <bc4j:viewObjectDef name="XhubTerritoriesTlView" rangeSize="300"/>
    </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    <!--We import the template file xhub.uit, which has code to display the tabs, subtabs, global buttons, etc., appropriately-->
    <templates xmlns="http://xmlns.oracle.com/uix/ui">
    <templateImport source="xhubtpadmin.uit"/>
    </templates>
    <content>
    <!--in this section we define all of the methods and ResourceBundle classes that we want to reference as data sources in our page-->
    <dataScope xmlns="http://xmlns.oracle.com/uix/ui"
    xmlns:data="http://xmlns.oracle.com/uix/ui">
    <provider>
    <!--We use the TextProvider class to display ANY text to the user. All text is controlled in the database and cached on the middle tier. This allows for translation and for customization of text-->
    <data name="textSource">
    <bundle class="oracle.apps.snw.uicommon.TextProvider"/>
    </data>
    <!--This method provides information about the hub-->
    <data name="adminInfo">
    <method class="oracle.apps.snw.tpadmin.webui.AdminInfo"
    method="getAdminInfo"/>
    </data>
    </provider>
    <contents>
    <document>
    <!--This section defines the html metadata, usually just the page title-->
    <metaContainer>
    <head title="${textSource.REGISTRATION}"/>
    </metaContainer>
    <contents>
    <body>
    <contents>
    <!--This next tag indicates that everything inside of it should be encapsulated in the "rootChild" node of the template page-->
    <myTemplate:xhubTpAdminPageLayout selectedTab="1">
    <contents>
    <!-- this will contain any validation errors after form submission -->
    <messageBox automatic="true"/>
    <!--The form tag is necessary for any kind of form handling. This particular form performs some javascript validation before submitting-->
    <form name="reg" method="POST">
    <contents>
    <!--The javascript that is executed on form submission-->
    <!-- we cannot implicitly determine that events will be triggered because submit buttons are outside the form scope, so add the placeholder explicitly -->
    <formParameter name="event"/>
    <!-- define the bc4j scope of all child elements-->
    <bc4j:rootAppModuleScope name="XhubRegAM">
    <contents>
    <!-- a top-level header -->
    <header text="${textSource.REGISTRATION}">
    <contents>
    <!-- always used OraInstructionText, not <tip>, for explanation messages-->
    <styledText styleClass="OraInstructionText"
    text="${textSource.REG_PAGE_EXPLAIN}"/>
    <!-- a second-level header -->
    <header text="${textSource.REG_COMPANY_INFO}">
    <contents>
    <stackLayout>
    <contents>
    <!-- the labeledFieldLayout is the correct layout for vertically-stacked labeled fields-->
    <labeledFieldLayout id="TpPartialDetails" width="80%"
    labelWidth="40%">
    <contents>
    <messageChoice name="OracleAppsCustFlag"
    prompt="Oracle Apps Customer"
    required="yes" statePreserved="true"
    selectedValue="${ui:defaulting(uix.pageProp.OracleAppsCustFlag, 'select')}">
    <primaryClientAction>
    <firePartialAction event="buyorsup"
    targets="TpPartialDetails"
    formSubmitted="true"
    unvalidated="true"/>
    </primaryClientAction>
    <contents>
    <option text="-select-" value=""/>
    <option text="${textSource.YES}" value="Y"/>
    <option text="${textSource.NO}" value="N"/>
    </contents>
    </messageChoice>
    <messageTextInput prompt="${textSource.ORACLE_CSI_Q}"
    name="OracleCsi"
    text="${uix.pageProp.OracleCsi}"
    rendered="${ui:defaulting(uix.pageProp.OracleCsiRender, 'false')}"/>
    <messageTextInput prompt="${textSource.YOUR_TP_NAME}"
    name="TpName"
    tip="${textSource.YOUR_TP_NAME_TIP}"
    required="no"
    text="${uix.pageProp.TpName}"
    rendered="${ui:defaulting(uix.pageProp.TradeswithTPRender, 'false')}"/>
    <messageTextInput prompt="${textSource.YOUR_TP_ALIAS}"
    name="TpAlias"
    tip="${textSource.YOUR_TP_ALIAS_TIP}"
    required="no"
    text="${uix.pageProp.TpAlias}"
    rendered="${ui:defaulting(uix.pageProp.TradeswithTPAliasRender, 'false')}"/>
    </contents>
    </labeledFieldLayout>
    </contents>
    </stackLayout>
    </contents>
    </header>
    <!--level-2 header-->
    <header text="${textSource.TP_DEFAULT_CONTACT_INFO}">
    <contents>
    <labeledFieldLayout width="80%" labelWidth="40%">
    <contents>
    <!--all of these fields default to the corresponding ctrl:page value if the user has entered a value. These values are set up in the register() handler-->
    <messageTextInput prompt="${textSource.PASSWORD_PROMPT}"
    name="Password" id="Password"
    required="yes" secret="true"
    maximumLength="32"
    text="${uix.pageProp.Password}"/>
    <messageTextInput prompt="${textSource.PASSWORD_CONFIRM_PROMPT}"
    name="PasswordConfirm"
    id="PasswordConfirm" required="yes"
    secret="true" maximumLength="32"
    text="${uix.pageProp.PasswordConfirm}"/>
    </contents>
    </labeledFieldLayout>
    </contents>
    </header>
    </contents>
    </header>
    </contents>
    </bc4j:rootAppModuleScope>
    <spacer height="10"/>
    <!--message indicating how we indicate required fields-->
    <inlineMessage required="yes"
    prompt="${textSource.REQUIRED_FIELD}"/>
    </contents>
    </form>
    </contents>
    <!--the contents of this tag will appear below the page-->
    </myTemplate:xhubTpAdminPageLayout>
    </contents>
    </body>
    </contents>
    </document>
    </contents>
    </dataScope>
    </content>
    <!--event handlers-->
    <handlers>
    <!--This event is called by pressing the submit button-->
    <event name="continue">
    <bc4j:findRootAppModule name="XhubRegAM">
    <method class="oracle.apps.snw.tpadmin.webui.RegistrationHandlers"
    method="register"/>
    </bc4j:findRootAppModule>
    </event>
    <!--This event is called by pressing the Cancel button-->
    <event name="cancel">
    <!-- finding the ApplicationModule causes it to be checked out from the ApplicationPool. It is released after rendering completes. -->
    <bc4j:findRootAppModule name="XhubRegAM">
    <!-- rollback the current transaction -->
    <bc4j:rollback/>
    <!-- forward to the summary page -->
    <go name="main"/>
    </bc4j:findRootAppModule>
    </event>
    <!--the * event is called whenever the page is accessed and no other event is called-->
    <event name="buyorsup">
    <bc4j:findRootAppModule name="XhubRegAM">
    <!--This method sets the context of the page, namely the scope of the country dropdown view object-->
    <method class="oracle.apps.snw.tpadmin.webui.RegistrationHandlers"
    method="isBuyerorSupplier"/>
    </bc4j:findRootAppModule>
    </event>
    <event name="*">
    <bc4j:findRootAppModule name="XhubRegAM">
    <!--This method sets the context of the page, namely the scope of the country dropdown view object-->
    <method class="oracle.apps.snw.tpadmin.webui.RegistrationHandlers"
    method="setContext"/>
    </bc4j:findRootAppModule>
    </event>
    </handlers>
    </page>
    Please suggest if you know of any documentation on ADF UIX partial page rendering.
    ADF UIX has very little documentation online and finding it hard to debug this issue.
    It ll be of great help.
    Thanks
    Kamal

    Hi Jason,
    As of EA9, all rendered components support a partialTriggers attribute. This attribute takes a list of master component IDs. If any of the master components are updated via a partial event, the dependent component will be rerendered in the partial update.
    If you are on an earlier release, you should upgrade.
    Thanks,
    Jeanne

  • UIX BC4J Java

    How could I transfer the information from UIX site in my Java class and work it on.
    My Scenario:
    Each employee works in a departmebt.
    Now I want to change the department of a employee.
    I show all departments,that I have and I select the current one,
    I would like to select another department and display it by my employee.
    I call method of my class TestSel in UIX in handlers::
    <event name="find" >
    <bc4j:findRootAppModule name="ViewAppModule" >
    <bc4j:findViewObject name="View" >
    <ctrl:method class="bo.TestSel" method="doSel"/>
    </bc4j:findViewObject>
    </bc4j:findRootAppModule>
    </event>
    package bo;
    import...
    public class TestSel {   
    public static EventResult doSel(BajaContext bc, Page page, PageEvent event){   
    ViewObject res = (ViewObject)bc.getProperty("http://xmlns.oracle.com/uix/bc4j", "viewObject");
    Row cur=res.getCurrentRow();
    //Not the selected position, but the last of the site (in range)
    System.out.println("cur"+cur.getAttribute("Id1").toString()) ;
    System.out.println("cur"+cur.getAttribute("FmlyNam").toString()) ;
    if (res.getEstimatedRowCount() != 0)
    RowSetIterator secondRSI = res.createRowSetIterator("secondRSI");
    if (secondRSI.hasNext())
    Row firstRow = secondRSI.first(); //the first row
    System.out.println(firstRow.getAttribute("Id1").toString()) ;
    System.out.println(firstRow.getAttribute("FmlyNam").toString()) ;
    secondRSI.closeRowSetIterator();
    How could I get selected data record here?
    How could I change a value of attributes and apply it in UIX ?
    Help me please!!!
    Inna.

    Would it be easier to use a custom method on the bc4j Application module?
    Take this scenario...
    1. User opens UIX XML web page which opens a bc4j App Module..it has a VO based on all employees.
    2. User presses the add button and a new employee is created (using the bc4j App Module).
    (Notice: no commit yet!)
    3. User presses the submit button...fires event REVIEW_SALARY.
    4. This event is 'handled' in the event section of the UML XML...it calls:-
    public static EventResult handleREVIEW_SALARYEvent (BajaContext context, Page page, PageEvent event)...
    5. I now want to call a java class I wrote that computes an employees new salary and updates the employee record with this new salary. This update will fail unless it is part of the same transaction as the one used by the bc4j App Module (that inserted the new employee).
    How best to proceed from here?
    How about having a method on the bc4j App Mod's VO called 'reviewSalary'? Calling this would use the same transaction? I could then call my java class from within the VO's method? However do I still have the same problem in that my java class expects to be passed the connection object?
    The approach you suggested previously seems a touch dangerous....in that these are not 'publically exposed'...and a new release of JDev may break my code.
    Thanks,
    Paul.

  • Passing data from one UIX XML page to another UIX XML page

    What are the various ways of passing data from one UIX XML page to another UIX XML page?
    (a) If no bc4j is used.
    (b) If bc4j is used.
    (c) If my event handler calls:-
    public static EventResult handleMyEventEvent( BajaContext context, Page page, PageEvent event) throws Throwable
    then how can I pass data to the next UIX XML page?
    Thanks,
    Paul.

    What are the various ways of passing data from one UIX XML page to another UIX XML page?
    (a) If no bc4j is used.For forwarded URLs; HttpServletRequest attributes [request], HttpSession attributes [session], ServletContext attributes [application].
    For redirected URLs; HttpServletRequest parameters url, HttpSession attributes [session], ServletContext attributes [application].
    (b) If bc4j is used.For forwarded URLs; BC4J Session properties.
    For redirected URLs; BC4J Session properties IF release mode is NOT stateless.
    (c) If my event handler calls:-
    public static EventResult handleMyEventEvent( BajaContext context, Page page, PageEvent event) throws Throwable
    then how can I pass data to the next UIX XML page?Return a UIEventResult (extends EventResult) from your event handler that has a data provider attached.
    This data provider will be accessible in the next page with the name "ctrl:eventResult", where "ctrl" is the short prefix for the namespace "http://xmlns.oracle.com/uix/controller".
    Regards,
    John Fallows
    Oracle Corporation.

  • How to use ShowValue within a UIX/JSP page to display an active link?

    I am storing URL's in the DB and want to display them as active links on a UIX/JSP page. I thought that I had this working some time ago, but now it no longer works.
    Using <bc4juix:RenderValue datasource="ds1" dataitem="myTextField" /> will display "http://www.otn.oracle.com" as an inactive link using UIX/XML which is expected.
    Using <jbo:ShowValue datasource="ds1" dataitem="myTextField" /> will display an active link using if using BC4J/JSP, which is expected.
    However, I have not been able to do this using a UIX/JSP page.
    Is it possible to use ShowValue within a UIX/JSP page to display an active link?
    Thanks,
    Bill G

    Hi Juan,
    I've done the following and it does not work for me;
    --- snip ---
    <uix:form name="form1" method="GET">
    <bc4juix:Table datasource="ds1" >
    <uix:columnHeaderStamp>
    <uix:styledText textBinding="LABEL"/>
    </uix:columnHeaderStamp>
    <%--
    <jbo:AttributeIterate id="dsAttributes" datasource="ds1" hideattributes="UixShowHide">
    <bc4juix:RenderValue datasource="ds1" dataitem="<%=dsAttributes.getName()%>" />
    </jbo:AttributeIterate>
    --%>
    <bc4juix:RenderValue datasource="ds1" dataitem="FacilityDesc" />
    <bc4juix:RenderValue datasource="ds1" dataitem="LocationId" />
    <bc4juix:RenderValue datasource="ds1" dataitem="LocationDesc" />
    <%-- ** THE FOLLOWING DOES NOT DISPLAY ON THE BROWSE_EDIT_PAGE ** --%>
    <jbo:ShowValue datasource="ds1" dataitem="Notes" ></jbo:ShowValue>
    <%-- ** THE FOLLOWING DOES NOT DISPLAY ON THE BROWSE_EDIT_PAGE ** --%>
    <uix:rawText>
    <jbo:ShowValue datasource="ds1" dataitem="Notes" ></jbo:ShowValue>
    </uix:rawText>
    <%-- ** THE FOLLOWING DOES NOT DISPLAY ON THE BROWSE_EDIT_PAGE ** --%>
    <uix:contents>
    <uix:rawText>
    <jbo:ShowValue datasource="ds1" dataitem="Notes" ></jbo:ShowValue>
    </uix:rawText>
    </uix:contents>
    --- snip ---
    Bill G...

  • How can I render an active link (yrl) within a UIX/XML page

    How can I render an active link (url) within a UIX/XML page.
    How can I get <jbo:ShowValue> to work in UIX/XML, or is there another way?
    Bill G...

    It may seem strange, but the <contents> of <rawText> aren't actually
    raw - it's only the "text" attribute that's raw. (It seems strange because
    it is. Ah well.) This is different from UIX JSP.
    So, try something like the following:
    <bc4j:attrScope name="Notes">
    <contents>
    <rawText text="&lt;a href=&quot;"/>
    <rawText>
    <boundAttribute name="text">
    <bc4j:attrProperty name="value"/>
    </boundAttribute>
    </rawText text="&quot;&gt;"/>
    Some text in the link.
    <rawText text="&lt;/a&gt;"/>
    </contents>
    <bc4j:attrScope>
    Thankfully, this will be much simpler in 9.0.3, when the following
    will work:
    <link text="Whatever you want">
    <boundAttribute name="destination">
    <bc4j:attrValue name="Notes"/>
    </boundAttribute>
    </link>

  • Hiding viewobject table columns in uiXML/BC4J page

    I would like to know how to hide a tablecolumn in a uiXml/BC4J page.
    Regards
    Tuncay

    Tuncay -
    You can modify the view.uix form and comment out the attribute you don't want displayed. For instance,
    <!--<bc4j:column attrName="ManagerId">
    <columnHeader>
    <bc4j:sortableHeader/>
    </columnHeader>!
    <contents>
    <bc4j:input readOnly="true"/>
    </contents>
    </bc4j:column>-->
    Hope this helps,
    Lynn
    Java Tools Team

  • UIX-BC4J Form Example

    Could anybody post an example of a simple UIX-BC4J Form with Insert, Update and Delete event handlers but NOT in automatic mode?
    TIA.
    Francisco

    I still consider myself a beginner in UIX/BC4J, but I presented a paper at June's ODTUG conference that included an example. Try www.odtug.com, look at the 2002 handouts, under JDeveloper. You should be able to download the Powerpoint. If you're interested, e-mail me and I'll send you the actual paper (as a Word document). Or just buy the conference proceedings from ODTUG. They papers should also be up soon in the "Members Only" section of the ODTUG site.
    -- jim

  • Multiple Developers UIX/BC4J

    Hi,
    Could you describe the best way for multiple developers to work a UIX/BC4J project?
    For the actual work we have tried slicing the project horizontally, where someone did the modelling and others would do the UIX pages but, because of time and other constraints we will probably divide the project up vertically where one person will work a set of entities, vo's etc. all the way up to the UIX pages.
    My question is more along the development infrastructure.
    Given this mix:
    - 4 to 6 member team
    - a single shared database/instance for development
    - access to a shared network drive (kinda slow)
    - access to a CVS repository
    Should we start by using a repository approach immediately?
    How do you guys do it?
    thanks

    I don't have any good handle for what the best way to set up such a project is. Do any other customers have some experience they can share here?
    -brian
    UIX Team

  • Is it possible to trigger action in backing bean on page unload event?

    Hi,
    There is a RichPopup in my page which has a Listener to save data or not by user choice "Data change detected, do you want to save those changes?"
    I've tried with the javascript event 'window.onbeforeunload', but this way must be fit with a Servlet function which I am not allowed to use.
    The attibute 'onunload' in the tag '<af:document>' seems useless. Even there is few description or example in the 'Tag Reference'.
    So, is it possible to trigger action in backing bean on page unload event? Thanks in advance for helping.
    Viva

    Hi Frank
    Thanks for helping, I've tried in your way. My codes are like below:
    Page codes:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1" clientComponent="true" title="viva test">
          <af:resource type="javascript">
            if (!window.addEventListener) {
                // alert('window.addEventListener is not supported in IE8. Override it!');
                window.addEventListener = function (type, listener, useCapture) {
                    window.attachEvent('on' + type, function() {listener(event)});
            window.addEventListener('beforeunload', function (){performUnloadEvent()}, false);
            function performUnloadEvent() {
              var eventSource = AdfPage.PAGE.findComponentByAbsoluteId('d1');
              //var x and y are dummy variables obviously neeed to keep the page
              //alive for as long it takes to send the custom event to the server
              var x = AdfCustomEvent.queue(eventSource, 'handleOnUnload', {args:'noargs'}, false);
              var y = 0;
          </af:resource>
          <af:serverListener type="handleOnUnload" method="#{vivaTestBean.testOnUnload}"/>
          <!--
          <af:form id="f1">
            <af:commandButton text="Unload" id="cb1" action="unload"/>
          </af:form>
          -->
        </af:document>
      </f:view>
    </jsp:root>The backing bean codes:
    public class VivaTestBean {
        public VivaTestBean() {
        public void testOnUnload(ClientEvent clientEvent) {
            System.out.println("Thanks God");
    }The first way which triggers a 'unload' event by clicking a button DO WORKS. :)
    But when I changed the triggered way by changing the <af:document> to clientComponent as what you did, the 'onbeforeunload' event won't come out when I refreshed or closed the page.
    That doesn't make sence, since I think the two ways to trigger a 'unload' event are the same.
    Edited by: 841766 on 2011-3-7 上午1:13

  • Crash when calling Clipboard.GetContent() in Page Loaded event

    Hello
    I found a crash when using
    Clipboard.GetContent() method ,
    the steps to reproduce this are very simple:
    -create C# Windows store application ,
    -add loaded event for main page
    -call Clipboard.GetContent()  inside it(loaded event handler).
    -run the application as release Ctrl+F5 , the application will crash , note that when you run as debug no problems
    -this problem appears not on GetContent() only , it appears when you use any method of ClipBoard class indside main page loaded event.
    Is this bug? , if yes , what is the workaround for this.

    Hi shaker,
    Firstly, I have to say that, yes, I can reproduce your issue on my side.
    However, as far as I know that the Clipboard operations are used to enable users to cut, copy, and paste data, but why you just call the Clipboard.GetContent() method in the Grid_Loaded event? Could you please show me more information
    about your requirement so that I can better understand your scenario?
    Thanks.
    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Use of Advanced Page Properties

    Hi,
    I like to know what is the use of the Advanced Page Properties(Right click a Page> Select properties>Click on Advanced).
    There are 5 items there:
    1) A2 Playback
    2) No Merge
    3) Send to Extension Server
    4) Skip in e-Tester
    5) Treat as Direct Navigation
    The last 2 items seams pretty straight forward, but I can't figure out the others. There is no documentation about it in the e-Tester Help.
    If you provide examples would be great.
    Thanks

    Hi Aether,
    Hope this is the kind of info you are looking for. I think this info is in the knowledge base. I had copied it a long time back.
    Explanation of Advanced Options
    Question
    What are the Advanced Page Properties?
    Answer
    A2 PlayBack
    Directs e-Tester to perform an A2 style navigation for this page during script playback. A2 and transforms are how e-Load executes script navigations. e-Tester records and plays back scripts by recording at the browsers object level and capturing all of the events that the user performed to navigate from one page to the next. This may include things like clicks on links, images, buttons, other form elements, etc. You can see these events or actions by looking in the Properties of the Address node for each script page. At the same time, e-Tester records a Transform (using A2 technology) to construct navigations to be used when running the script in e-Load. e-Load Thin Client cannot use object based navigations since it is not instantiating actual browsers the browser object model does not exist.
    In cases where your script does not playback in e-Tester, because the events to perform the navigation were not recorded properly, sometimes we may need to direct e-Tester to use e-Load style A2 navigations instead. We do this by setting A2 playback for the page we would like to do that on and that will force an e-Load A2 type navigation rather than using the recorded actions to navigate. It is best not to just set A2 navigations to try to resolve an e-Tester playback problem. You first need to try to understand the navigation that is being performed and determine why it was not recorded/played back properly by e-Tester. Understanding the problem is critical because their may be real problems that need to be resolved. A2 should be only used as a last resort when all other options have been exhausted.
    No Merge
    Instructs e-Tester not to merge new page content retrieved on playback with the existing recorded baseline pages in the visual script. When this is set you will see that the Visual Script will not update on playback even if there is different content retrieved (no flags or updated content will be shown in the page nodes). The example where this setting is used most is to avoid updates to the recorded items in the Parameters node as follows.
    When you record a script, e-Tester automatically captures, in the Parameters node of a page, all of the user-input form fields and data submitted from the preceding page. On playback, if that first page had additional form fields that were not there during recording, these new form fields will be merged in and added to the Parameters node of the next page.
    You can see this in the FMStocks demo. The login page has 2 fields (login and password) which will be captured in the Parameters node of page 2 of your script (if you just record a 2 page login script). If you switch to Build B of FMStocks, you will see a Customer ID field added to the login page and when you play the script back that you had originally recorded, the Customer ID field will be added to the Parameters node of page 2. If you had set "No Merge" on page 2, then this additional form field would not have been added to the page 2 Parameters node.
    There are some cases where you need to use No Merge. For example, when the form fields on a page have dynamic names which causes e-Tester to constantly keep adding Parameters every time the script plays back.
    For example lets say the Login and Password fields were called "login123" and "password123". Then you play the script back and the content of the login page is dynamically updated and the fields are now called "login456" and "password456". This would cause e-Tester to add another login and password field to the Parameters node of page 2 because it sees these as new fields (since the names are different). In this case they are actually the same fields, just with new names. Therefore you would want to set No Merge to avoid this situation so e-Tester handles it properly.
    Send to Extension Server
    Used to mark a page in your script to be sent to Extension Server when running the script in e-Load. e-Load once again uses Transforms and A2 navigations to play the script when running in Thin Client. Sometimes e-Load Thin Client will not be able to process the page to perform the navigation properly using the Transform or you may have failures during script playback in e-Load (Failed to Find/Failed to Match). When Extension Server is enabled, e-Load switches from a Thin Client to a full browser for the page that its enabled on. This allows e-Load to process that page as a full browser would. This may be required, for example, if there is some client side script that needs to be executed for the navigation to perform properly. Once again, you should not resort to Extension Server until you have understood the problem at hand. In most cases, the A2 Transforms should be able to perform the navigations in e-Load Thin Client, without the need for Extension Server. Also, enabling Extension Server is a scalability hit because a full browser must be instantiated for the page which requires much more resources than just using the Thin agent. If there are no other options, then Extension Server should be enabled.
    Treat as Direct Navigation
    Instructs e-Tester to perform a page navigation as a direct navigation to the recorded URL for that page. Once again, e-Tester normally performs script navigations by executing the recorded actions that the user performed to get from one page to the next. However, if e-Tester cannot perform the navigation in this manner because it couldnt record or playback the events proprerly, a direct navigation may need to be used instead. You would use Treat as Direction navigation if you are performing a static navigation that does not require A2. If the navigation to the next page is dynamic due to URL session variables etc. then you will need to set A2 playback instead. As in the case of using A2 playback, you should never automatically just set Treat as Direct Navigation to try to resolve an e-Tester playback problem. You first need to try to understand the navigation that is being performed and determine why it was not recorded/played back properly by e-Tester. Understanding the problem is critical because their may be real problems that need to be resolved. Treat as Direct Navigation should be only used as a last resort when all other options have been exhausted.

  • Oracle Strategy for the UIX & BC4J in the new JDeveloper version

    What is Oracle Strategy for the UIX & BC4J in the new JDeveloper version:
    - Like DataBinding
    - BC4J Integration
    - UIX controller
    - Internationalization
    - Supporting for Palm,phone and pager.

    Hi,
    Are these questions all BC4J specific?
    General databinding info is discussed here:
    What's the developement direction of UIX?
    For BC4J/UIX integration, in 9.0.5 we will continue to support our existing api's, but you can also use uix as the view and bc4j as the model in adf, which is described here:
    http://otn.oracle.com/products/jdev/htdocs/905/sod_otn.html#adf
    Aside from bug fixes, I don't think there are major changes in the controller/internationization. Did you have specific questions about the controller and internationalization?
    We are planning to support Palm web browser 2.0, but due to the timing of the release of a platform that supports it and our own schedules, I don't think it will be officially supported in the 9.0.5 release. We won't have phone or pager support in 9.0.5.

Maybe you are looking for

  • Cannot install Designer. Install error 1158

    Has anyone had a problem installing LiveCycle Designer?  I keep getting (Installshield) error "1158", which apparently means it's having problems with the content of the setup.ini file strings. However, that file and its contents don't appear corrupt

  • What are my options for mirroring my ipad3 through a desktop pc (without wireless) to a data projector?

    The desktop PC (Windows 7) does not have wireless. I have a VGA cable that I can plug directly to the data projector cable, however, I need the mirroring to go through the PC (because I am recording using desktop recording software). I'm using Air Sk

  • How to create SAP iviews in Netweaver 7.0

    Hi, Please assist in how to create SAP URL & SAP transaction iViews in Netweaver EP 7.0 Thanks Suri.

  • Geting group id in XSLT

    How to get group id? Looks like this is not returning anything when group is assigned to: <xsl:variable name="AssignedToID">       <xsl:value-of select="ddwrt:UserLookup(string(@AssignedTo), 'ID')"/> </xsl:variable>

  • Requirements to work on Web DynPro for ABAP

    hi all, what is it required to work on Web DynPro for ABAP. i have got ECC 5.0 installed in my system but i dont find "WebDynpro Comp/Intf" under the "Repository Browser" in SE80(ABAP WorkBech). How should i proceed further?? waiting for replies... R