IndexOutOfBoundsException and invokeAction

Hello,
I have an IndexOutOfBoundsException when trying to rollback and editable table. In my use case, I don't want to see "no data found", so I must createInsert a row if there is no data found. I use an involeAction with a refreshCondition for this.
The use case is simple to reproduce :
In HR schema, create an editable table on Jobs. Drag n drop the rollback action as commandButton. In pageDef, add an invokeAction "createInsert" with refresh if needed :
<invokeAction id="createInsert" Binds="CreateInsert" Refresh="ifNeeded"
                  RefreshCondition="#{bindings.JobsView1Iterator.currentRow==null}"/>When editing a row, if user click on rollback button, the exception is raised :
java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
     at java.util.ArrayList.RangeCheck(ArrayList.java:547)
     at java.util.ArrayList.get(ArrayList.java:322)
     at oracle.adf.model.binding.DCBindingContainer.internalRefreshControl(DCBindingContainer.java:3055)
     at oracle.adf.model.binding.DCBindingContainer.refresh(DCBindingContainer.java:2906)
     at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.prepareRender(PageLifecycleImpl.java:561)
     at oracle.adf.controller.faces.lifecycle.FacesPageLifecycle.prepareRender(FacesPageLifecycle.java:81)
     at oracle.adf.controller.v2.lifecycle.Lifecycle$9.execute(Lifecycle.java:236)
     at oracle.adfinternal.controller.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:197)
     at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.access$1000(ADFPhaseListener.java:23)
     at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$5.before(ADFPhaseListener.java:402)
     at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.beforePhase(ADFPhaseListener.java:64)
     at oracle.adfinternal.controller.faces.lifecycle.ADFLifecyclePhaseListener.beforePhase(ADFLifecyclePhaseListener.java:44)
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:327)
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:236)
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:509)
     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
     at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
     at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
     at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
     at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
     at java.security.AccessController.doPrivileged(Native Method)
     at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
     at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
     at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
     at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
     at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
     at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
     at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
     at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)What could it be?
Without the invokeAction it works well. I use jdevelopper 11.1.2.3.0.

Hi,
hi can you try and remove the refresh condition to verify this comes from the refresh EL? If so then first of all I suggest to use $ instead of # form the EL expression because # is resolved upon rendering of the UI which is too late for the condition you need. Second, if using $ doesn't solve the problem, try RefreshCondition="${bindings.JobsView1Iterator.estimatdRowCount == 0}"/>
Frank

Similar Messages

  • Wizard Style layout and flex items

    Dear JHeadstart team,
    We have several pages where the "Wizard Style Layout" is checked and where a flex item region is defined.
    However, the generator generates the flex item region correctly, but the page definition misses the flexitems methodAction and invokeAction.
    Standard pages work correctly with the flex item regions.
    Current fix:
    1. Switch off "Clear page definition before generation"
    2. Manually add entries in the page definition.
    Am I correct?
    Remco Moolenaar
    Connexys

    Hi Remco,
    We also use wizard-style layout with flex item regions successfully. In our JHeadstart application definition, we have defined one Item Region in the Regions region container for each page. Within each Item Region,
    we have included one item with display type = flexRegion.
    For each Item Region, one page is generated and all methodAction and invokeAction tags are included in the page definition file.
    Could you please provide more details on your application definition structure?
    Regards,
    Ibrahim

  • TP4 Lov and application module procedure

    Hi!
    I have a little problem. I have a page with a LOV and a Task Flow.
    In the Task Flow i have a table, wich depending the value that users select in the LOV present some data. (Whith where clause and a bind variable).
    This works ok. But when I add to the task Flow a button that invoke a procedure implemented in the application module. The result, is that the LOV doesn´t work. i mean not appear the data to select.
    Any idea?
    Thanks
    Rowan

    Ok my english....
    First what a want to do:
    I´m doing a create,update,insert,remove page, using adf rc. But for doing those, I need to use PL/SQL procedures, not the create, remove.. procedures that jdev gives us in the data control. And as the table has a lot of records i ´ve put in the page a LOV to search the rows that the user want to modify.
    Now how i do that (in short):
    First i "programmed" the LOV. I´ve created a ViewObject for the lov and another view object for the table the second VO has a bind variable and a where clause.
    "Where tabla.cod = :LovParam"
    For passing the value from the LOV to the table i have defined a Task Flow View with input parametre, with a panel collection and inside the table VO. have defined an executeWithParams binding and invokeAction executable.
    I´ve drop the task flow to the .jspx.
    In the .jspx I´ve inserted a LOV component and create a variable executable a inside of this a variable. And then i´ve bind the LOV with the variable.
    Probably here is missing a step, but how i say up this is in short what i have done.
    Finally all this works fine.
    The second step is to add the command button that calls the PL/SQL, for doing this:
    I´ve programmed in the application_module_implementation a function which calls the PL/SQL, I´ve followed the steps that are explained in the adf guide, in chapter 25.5.2 Invoking Stored Procedure with Only IN Arguments.
    And then i´ve dropped the function from data control to statusbar facet of the Data Collection.
    The result is that when the button is on panel collection, the LOV does´t work. And if remove the button the LOV works. This haven´t any sense for me.
    I have made more test and, if instead of the panel collection I use a form layout the LOV works but the button gives me the next error "Not supported function".
    I know that this is another think. and now i´m trying to solve this one.
    I hope now you have material to work with. I think that it´s strange what happens with the collection panel. And about the function sure that i´m doing something wrong.
    Thanks, for you interest
    Rowan

  • ADF model : prevent refresh using invokeAction

    hi
    I'm trying to understand the Refresh and RefreshCondition properties of executables like methodIterator and invokeAction.
    These executables come from the app_SRListPageDef.xml pageDefinition for SRList.jspx in the "Oracle ADF SRDemo Application":
      <executables>
        <methodIterator id="findServiceRequestsIter"
                        Binds="findServiceRequests.result"
                        DataControl="SRPublicFacade" RangeSize="10"
                        BeanClass="oracle.srdemo.model.entities.ServiceRequest"/>
        <invokeAction Binds="findServiceRequests" id="tableRefresh"
                      Refresh="ifNeeded"
                      RefreshCondition="${(userState.refresh) and (!adfFacesContext.postback)}"/>     
        <!-- ... -->
      </executables>The same pageDefinition also contains this methodAction binding :
        <methodAction id="findServiceRequests"
                      InstanceName="SRPublicFacade.dataProvider"
                      DataControl="SRPublicFacade"
                      MethodName="findServiceRequests" RequiresUpdateModel="true"
                      Action="999"
                      ReturnName="SRPublicFacade.methodResults.SRPublicFacade_dataProvider_findServiceRequests_result">
          <NamedData NDName="userIdParam" NDValue="#{userInfo.userId}"
                     NDType="java.lang.Integer"/>
          <NamedData NDName="statusParam" NDValue="#{userState.listMode}"
                     NDType="java.lang.String"/>
        </methodAction>I added this navigateToSRList.jspx page to that application:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:af="http://xmlns.oracle.com/adf/faces"
              xmlns:afh="http://xmlns.oracle.com/adf/faces/html">
      <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
                  doctype-system="http://www.w3.org/TR/html4/loose.dtd"
                  doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
      <jsp:directive.page contentType="text/html;charset=windows-1252"/>
      <f:view>
        <afh:html>
          <afh:head title="navigateToSRList">
            <meta http-equiv="Content-Type"
                  content="text/html; charset=windows-1252"/>
          </afh:head>
          <afh:body>
            <h:form>
              <af:commandButton text="show Open requests" action="GlobalHome">
                <af:setActionListener from="#{false}" to="#{userState.refresh}"/>
                <af:setActionListener from="#{'Open'}" to="#{userState.listMode}"/>
              </af:commandButton>
              <af:commandButton text="show Pending requests" action="GlobalHome">
                <af:setActionListener from="#{false}" to="#{userState.refresh}"/>
                <af:setActionListener from="#{'Pending'}" to="#{userState.listMode}"/>
              </af:commandButton>
            </h:form>
          </afh:body>
        </afh:html>
      </f:view>
    </jsp:root>This navigateToSRList.jspx page contains two buttons that will bring you to the SRList.jspx page. Both buttons explicitly set the userState properties refresh and listMode.
    If I click the first button, I get to see the Open requests. If I click the second button, I get to see the Pending requests.
    Because the tableRefresh invokeAction configures RefreshCondition="${(userState.refresh) and (!adfFacesContext.postback)}" and the buttons on my navigateToSRList.jspx explicitly set userState.refresh to false, I would expect this invokeAction NOT to be refreshed. (I checked the value -false- of userState.refresh using an expressionResolver.jspx page, see tip : resolve JSF expressions at runtime.)
    (*) questions
    - What causes the SRList.jspx page to show the expected data when using the buttons on navigateToSRList.jspx? I suspect it has something to do with the value of the statusParam NamedData in methodAction findServiceRequests that gets changed. The userState.listMode gets set by a af:setActionListener, this "changed methodAction parameter value" might trigger a refresh of the methodIterator. Can someone confirm this (from experience or with documentation)?
    - Is it possible to prevent "executables to be refreshed" if "methodAction parameters were changed"?
    many thanks
    Jan Vervecken

    Please see section "10.5.5 How to Use Refresh Correctly for InvokeAction and Iterator Bindings" of the ADF Developer's Guide for Forms/4GL Developers on the ADF Learning Center at http://www.oracle.com/technology/products/adf/learnadf.html for more information on this.
    The information it contains is valid for Non-ADFBC data controls as well.

  • How to get BPM Payload attribute value in ADF TaskFlow

    Hi,
               Activities which I did : I have created ADF Project. Then I created ADF TaskFlow through 'ADF TaskFlow Based on Human Task' option by locating BPM task. So now TaskFlow is been generated and also respective dataControl value also generated. In TaskFlow I created new .jspx file. I am going to design this jspx page by drag and drop from VO instances from dataControl. So for this jspx page, at runtime value will be populated from DB Table.
                      My Requirement :  When the Flow initiated, there will be Parameter value passed to the TaskFlow through Payload which is available in DataControl. So now I based on the Payload parameter value I need to filter DBTable and show the respective value in jspx page which I created in TaskFlow. So getting Payload value and applying filter on VO based on Payload parameter value has to be done before rendering Page.
    I tried to achieve this schenario as like below :
           - Assume like there is attribute called 'transactionId', for which value will be passed to the TaskFlow through DataControl. I created VO based on EO and appended where clause as : "VO.Trans_Id = : bindVar". Created bindVariable called 'bindVar'. In jspx page I just Drag and Dropped VO instance as form. And also I drag and Dropped 'transactionId' as outputText from Payload. And also I created ExecuteWithParams in Binding section of PageDef and mapped that one with invokeAction item in executable section. So now both payload Iterator and invokeAction  will be created in PageDef. I kept Iterator as in the order of : PayloadIterator at first and InvokeAction second one, So that at runtime it will execute in that order. And also I given "refresh" property to payloadIterator and invokeAction to 'renderModel' and I mapped PayloadIterator id to  refreshAfter property of InvokeAction iterator. Now at runtime, So at runtime updated/Newvalue will be retrived to Payload attribute by executing payloaditerator. So now for 'transactionId' value vill be retrieved. Next invokeAction will take value from newly retrieved 'transactionId' as input and execute query. So now VO will be filtered and need to be shown. But instead of that getting error saying like 'No outcome metadata specified for method call activity 'null'.'
    Is this way is correct? If yes, then What mistake which I have done?
    Is any other way to acieve this schenario?
    Do the needful.
    Thanks with Regards,
    PraveenKumar.N

    Guessing you might have looked at this at some point, but you might want to consider using the setCurrentRowWithKeyValue method to do this.
    Here's a blog post that I wrote a while back that goes through step-by-step what I think you're trying to accomplish:  Using a BPM Process Variable on an ADF form to Retrieve Database Information | AVIO Consulting
    Hope this helps,
    Dan

  • How to map AM method return values in the bean

    Hello -
    I have this requirement to map AM method return values in the bean as explained below. Please suggest a solution.
    Scenario: I am calling an AM method, which returns a String object on page load.
    AMImpl Method-
    public String getProfileName (){
    return "Profile";
    I wish to catch this retun value in the Bean Variable on page Load. I have created a methodAction biding on page and invokeAction to call this method on Page Load, but I don't know how to catch this value in the bean. Please suggest how to achieve this. Also, I need to achieve this in jsp page. I can't use TaskFlow for this.
    I am using ADF 11g.
    Regards -
    Rohit
    Edited by: Rohit Makkad on Apr 21, 2010 12:23 AM

    Hi, I think there are two ways, from the data control drag n drop the methods return value to the page. This way a binding for that will be created at the page definition eg retVal.
    and in the backing bean you can access it by calling resolveExpression("#{bindings.retVal.inputValue}")
    You can also call your method directly from the backbean
    ((YourAppModuleImpl) getBindings().getDataControl().getApplicationModule()).yourMethod();
    public DCBindingContainer getBindings() {
    return (DCBindingContainer) resolveExpression("#{bindings}");
    I dont know if the second method suits you
    Tilemahos

  • Special characters an issue in reading email from server?

    I have an email application that uses javamail 1.4.1 that grabs emails out of flat files and displays the messages on the screen. Until recently, all email was sent within the business, but now they are able to receive emails from any email provider. We've been seeing issues where parts of messages go missing, even links to attachments that don't get displayed to the screen. All of the correct information is in the flat files, but it doesn't get displayed. Does Javamail do anything to handle special characters or is there anything you think I could try to get these messages to display? It's really causing some problems!

    As far as I can tell, it's not throwing any exceptions, the only ones I catch in retrieving emails are MessagingException, IOException, and IndexOutOfBoundsException, and I'm not seeing any errors in my log files. The headers are the only thing that come through correctly every time, it's always either the message or attachments that go missing. One of the messages is from a mobile phone, which could be a problem, but we've seen it from our company email addresses too. I'll see if I can get a hold of a sample message to post. In the meantime, what kinds of properties can be set? Is there a good place to look for that?
    EDIT: here is a sample message (names have been changed to protect the innocent, also removed attachment encoding)
    Return-Path: <[email protected]>
    X-Original-To: [email protected]
    Delivered-To: [email protected]
    Received: from localhost (unknown [IP])
         by company.com (Postfix) with ESMTP id AA0FB52B4F0
         for <[email protected]>; Wed, 17 Dec 2008 12:27:00 +0000 (UTC)
    Received: from company.com ([IP])
    by localhost (HOST [IP]) (amavisd-new, port 10024)
    with ESMTP id 02398-05 for <[email protected]>;
    Wed, 17 Dec 2008 06:27:00 -0600 (CST)
    Received: from fortimail (unknown [IPADDRESS])
         by company.com (Postfix) with ESMTP id 7EBC7178D95
         for <[email protected]>; Wed, 17 Dec 2008 06:27:00 -0600 (CST)
    Received: from atlmtaow03.cingularme.com (atlmtaow03.cingularme.com [IPADDRESS])
         by fortimail with ESMTP id mBHCQvRG003014
         for <[email protected]>; Wed, 17 Dec 2008 06:26:58 -0600
    X-Mms-MMS-Version: 18
    Date: Wed, 17 Dec 2008 06:31:21 -0600
    X-Nokia-Ag-Internal: ; smiltype=true; internaldate=1229517081559
    Content-Type: multipart/mixed; boundary="----=_Part_11936491_5421953.1229517081567"
    X-Mms-Delivery-Report: 1
    Received: from schagw02 ([IPADDRESS]) by atlmtaow03.cingularme.com (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20081217122656.MANG3081.atlmtaow03.cingularme.com@schagw02> for <[email protected]>; Wed, 17 Dec 2008 07:26:56 -0500
    X-Mms-Transaction-ID: MMS0000084841772
    From: <[email protected]>
    To: [email protected]
    X-Mms-Message-Class: 0
    X-Mms-Read-Reply: 1
    Mime-Version: 1.0
    Message-ID: <3200553.1229517081568.JavaMail.wluser@schagw02>
    X-Mms-Priority: 1
    X-Mms-Message-Type: 0
    Subject: Multimedia message
    X-Nokia-Ag-Version: 2.0
    X-Virus-Scanned: amavisd-new at location.company.com
    ------=_Part_11936491_5421953.1229517081567
    Content-Type: text/plain; charset=utf-8
    Content-Transfer-Encoding: base64
    Content-ID: <slide1.txt>
    Content-Location: slide1.txt
    Content-Disposition: inline
    TG9vawo=
    ------=_Part_11936491_5421953.1229517081567
    Content-Type: image/jpeg
    Content-Transfer-Encoding: base64
    Content-ID: <1215082150-01.jpg>
    Content-Location: 1215082150-01.jpg
    Content-Disposition: inline
    [Attachment encoding goes here]
    ------=_Part_11936491_5421953.1229517081567--
    Edited by: jlapoint on Dec 22, 2008 9:22 AM

  • Programmatically selecting row in af:table

    I have an instance of the <af:table> component that points to a value on a managed bean of type List<MyValueType>.
    I need to make the <af:table> have a preselected row, and I have the value of type MyValueType that represents the row I need selected.
    How do I programmatically select the appropriate row in the table?
    Thanks!

    Hi Rune,
    1) Expose the adf table to a managed bean property by using @binding attribute, say, requestScope. The property should be RichTable type.
    2) Create a method in java class which can find the managed bean created in step 1) by using EL expression and calling its RichTable.setRowKey(int) to set the current row. Other row currency method are also available besides setRowIndex(int).
    3) Create Data Control on the java class you created in step 2)
    4) Insert the method created in step 2) into <bindings> as methodAction in page definition file.
    5) Still in page definition file, insert an invokeAction into <executables> to invoke the method action created in step 4)
    6) Reorder the invokeAction created in step 5), place it below the table's <iterator>
    7) Set the @refresh attribute for the table <iterator> and <invokeAction> if you want, for example: "prepareModel"
    -Or-
    You can implement a custom page lifecycle to achieve the goal.
    Todd

  • [SOLVED] How to use return parameter of function as paramter of table?

    Hi all,
    As continue of post "ADF Faces: how to execute pl/sql function when page is loaded." I came up with an other problem where I can't find an easy solution for.
    The problem is easy.
    1) I execute a procedure, this returns a value
    2) I have a table which needs one input parameter
    3) How can I bind the return value of the procedure to the input paramter of the table:
    A simple example:
    1) I created a pl/sql function that returns 1
    CREATE FUNCTION zz_return_1
    is
    RETURN NUMBER
    BEGIN
      RETURN 1
    end;2) I exposed the function in my TestModule so I can use it on a jps page.
    3) I created a table TEST_PARAM_1_TABLE with two columns: a, b
    4) I created a view read-only object with one paramter
    SELECT a,b
    FROM zz_scn_test_tab
    where a = :var_15) I added the view object to a jps page as tabe > adf read-only
    6) I added a methodAction and invokeAction to execute the function on page load
    <executables>
          <iterator id="zzscntest1Iterator" RangeSize="10" Binds="zzscntest1"
                    DataControl="TestModuleDataControl"/>
                <invokeAction id="runProc" Binds="ftn_return_1"/>
          </executables>
    <bindings>
          <methodAction id="ftn_return_1"
                        InstanceName="TestModuleDataControl.dataProvider"
                        DataControl="TestModuleDataControl"
                        MethodName="ftn_return_1" RequiresUpdateModel="true"
                        Action="999" IsViewObjectMethod="false"
                        ReturnName="TestModuleDataControl.methodResults.TestModuleDataControl_dataProvider_ftn_return_1_result"/>
          <table id="zzscntest1" IterBinding="zzscntest1Iterator">
              <AttrNames>
                  <Item Value="A"/>
                  <Item Value="B"/>
              </AttrNames>
          </table>
    </bindings>how can I bind the return value of the function to the var_1 variable of the table?
    Additional to this: Is there a way to store the return value in a managed bean?
    for example: if I create a managed bean:
    public class globalVars {
        private Number ftnReturnValue;
        public globalVars() {
        public void setFtnReturnValue(Number ftnReturnValue) {
            System.out.println("return value is set to: " + ftnReturnValue);
            this.ftnReturnValue = ftnReturnValue;
        public Number getFtnReturnValue() {
            return ftnReturnValue;
    }how to store the return value in this ftnReturnValue variable?

    Thanks to Frank,
    I finally got it to work!
    For those with the same problem, this is what I did:
    - I created a VO material_details with one parameter :sequence_num
    - I created a master/detail viewlink from my materials list to the materials_details
    - In the application module, I created a call to the procedure, and within this procedure, I set the sequence_num variable.
        public Number f_ltf3_adf_syf_init(String reporting_group
                                         , String username
                                         , String RAG_code
                                         , String ABC_class
                                         , String SBU_code){
           CallableStatement st = null;
           String stmt = "M_LTF3_SFM_CALC.f_ltf3_adf_syf_init('"+ reporting_group
                                                           +"','"+ username
                                                           +"','"+ RAG_code
                                                           +"','"+ ABC_class
                                                           +"','"+ SBU_code+"')";
           try {
               // prepare the statement
               st = getDBTransaction().createCallableStatement("begin ? := "+stmt+";end;",0);
               st.registerOutParameter(1,2);  // register output parameter as Number
               //execute the statement
               st.executeUpdate();
               //set paramter in detail VO of master/view
               getLtfSyfRevDetails1().setNamedWhereClauseParam("session_seq", (Number)st.getObject(1));
               return (Number)st.getObject(1);
           }catch (Exception e){e.printStackTrace();}
           return null;
        }

  • Tree based on ViewObject with bindparams

    Hi,
    We have some pages that are tree-form based; the tree and the form and based on two different viewobject usages, but the same viewobject. This VO uses a bind parameter to limit the data. With JHeadstart we can provide this bindparameter with the group, but it seems that it generates a methodbinding and invokeaction only for the form and not for the tree and we have to add these after generation. Is there a way that we can generate these for both the tree and the form?
    Is this intended behaviour or can we request it as an enhancement?
    Fortunately in some cases can we use the same viewobjectusage for both the tree and the form and then it works out fine, but this is not possible for all the pages.
    Ciao
    Aino

    Aino,
    It is intended behavior, although I agree that we could apply the same bind params to the tree vo usage when it is based on the same VO. But a real solution is to add an additional group property: Tree Query Bind Parameters, as this also solves the case where the Tree Vo usage is based on a different VO. I have added this to the list of enhancements.
    Steven Davelaar,
    JHeadstart Team.

  • Applying different view criterias to af:query based different situations

    Hi all;
    Lets say i have 3 different view criterias ....and i want to apply only one of them to af:query based user's role....
    I dont have an idea how to do that...My only clue is my supervisor mentioned to me i can use page definition to do that;
    <searchRegion Criteria="DepartmentViewCriteria" Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"
                      Binds="DepartmentView1Iterator" id="DepartmentViewCriteriaQuery"/>Can u help me on this matter please!
    If post is too shallow to understand i can elaborate more...
    jDeveloper 11.1.2.1.0
    Oracle DB 11g

    Create a custom public method in yr applicationmoduleImpl class. Get the viewcriteria of target vo or programmatically create yr viewcriteria.
    Based on current loggedInUser role which can be access by ADFContext.getCurrent().getSecurityContext().getUserRoles(), u can apply specific viewcriteria on VO.
    After that u can follow this link - http://dstas.blogspot.com/2010/09/adf-11g-methodaction-and-invokeaction.html, from +"We will now expose the method in the client interface of the AM"+ teopic.
    At the end u will be able to execute this method from pagedef file, whenever u enter to this page.
    Hope this helps.

  • How to execute a backing-bean method before loading JSP Page?

    Hi everybody.
    Scene:
    An AdfForm, with
    -SelectChoice, referenced to a <list> of pageDef, which is referenced to an ADF BC.
    Goal:
    -Executing the query of the ADF BC before load the SelectChoice, to load the correct values.
    A good question to know:
    Exists any way to execute a method of backing before loading a JSP Page?
    Any similar to onload method of javascript. It could be fantastic.
    Thanks in advance,
    Jaime

    hi Jaime
    If I understand correctly, you are using the ADF Model for data binding.
    Because your goal is "Executing the query of the ADF BC ...", maybe you can also consider to refresh an executable in your Page Definition.
    See also "10.5.5 How to Use Refresh Correctly for InvokeAction and Iterator Bindings"
    at http://download.oracle.com/docs/html/B25947_01/bcdcpal005.htm#BJECHBHF
    It says "... You can use the Refresh property on iterator bindings and invokeAction executables in your page definition to control when each are evaluated during the ADF page lifecycle, either during the prepareModel phase, the prepareRender phase, or both. ...".
    Although you have posted your question in a structured way, which is a good thing, I think it would help to understand your question if you can explain how you determine "the correct values" for your list, what is varying?
    success
    Jan Vervecken

  • Method definition with reflection doesn't show Exceptions

    According to the documentation, http://java.sun.com/j2se/1.4.1/docs/api/java/lang/reflect/Method.html#toString(), returns checked exceptions. I don't know about checked exceptions, but the following code doesn't give me any exceptions:
    final Class[] parameters = {
       Class.forName("java.util.Collection")
    Method method = Class.forName("java.util.ArrayList").getDeclaredMethod("addAll", parameters);
    System.out.println(method.toString());Instead, I just get public boolean java.util.ArrayList.addAll(java.util.Collection)But addAll throws IndexOutOfBoundsException and NullPointerException - see http://java.sun.com/j2se/1.4.1/docs/api/java/util/ArrayList.html#addAll(java.util.Collection).
    Umm... I'm puzzled, and any help would be very appreciated!

    But addAll throws IndexOutOfBoundsException and NullPointerException Which are unchecked or runtime exceptions, not checked exceptions.
    Runtime exceptions are not declared in Java throws clauses, though they may be mentioned inthe API docs. They inherit from the RuntimeException class.
    Checked exceptions must be declared in the Java throws clause, and are subclasses of Exception which are not subclasses of RuntimeException. The compiler checks that checked exceptions are caught or declared by the calling method, hence the name.
    Pete

  • IndexOutOfBounds Exception using ArrayList running in a Thread

    Hi, I am a beginner in Java. While I am studying I became interested in Game Developing. So I tried to create a game like Space Shooting. Although the design and the ship lives are not yet finished it should run. Here is my whole code.
    import java.applet.Applet;
    import java.applet.AudioClip;
    import java.awt.*;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.io.File;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.util.ArrayList;
    import java.util.Random;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    class Ship
        int x,y,lives;
        long score,lastExplodeDisplay;
        public Ship()
            x = 307;
            y = 444;
            lives = 3;
            score = lastExplodeDisplay = 0;
        public void move(int xDir)
            x = x + xDir;
    class Asteroid
        int x,y,speed;
        Random asteroidGenerator;
        int explodeMode;
        long lastExplodeDisplay;
        public Asteroid()
            asteroidGenerator = new Random();
            x = asteroidGenerator.nextInt(600) + 10;
            y = asteroidGenerator.nextInt(1250) + 100;
            y = y * -1;
            speed =  1;
            explodeMode = 0;
            lastExplodeDisplay = 0;
    class Star
        int x,y,speed,radius,colorChooser;
        Color color;
        Random starGenerator;
        public Star()
            starGenerator = new Random();
            x = (starGenerator.nextInt(620) + 10);
            y = (starGenerator.nextInt(460) + 10);
            speed = starGenerator.nextInt(2) + 1;
            radius = (starGenerator.nextInt(3));
            colorChooser = starGenerator.nextInt(200);
            if(colorChooser % 3 == 0)
                color = Color.YELLOW;
            else if(colorChooser % 4 == 0)
                color = Color.BLUE;
            else if(colorChooser % 5 == 0)
                color = Color.RED;
            else
                color = Color.WHITE;
    class Shot
        int x,y,speed;
        public Shot(int position)
            x = position + 3;
            y = 440;
            speed = 7;
    public class Main extends JFrame implements Runnable{
        private Image dbImage, ship,shot,asteroid,explode,shield;
        private Graphics dbg;
        private ImageIcon i;
        private Font stageFont;
        long lastShot, start;
        AudioClip shoot;
        String scoreShow;
        int lastAsteroidPosition;
        Ship ship1 = new Ship();
        Star[] stars = new Star[200];
        ArrayList<Shot> shots = new ArrayList<Shot>();
        ArrayList<Asteroid> asteroids = new ArrayList<Asteroid>();
        ArrayList<Asteroid> exploded = new ArrayList<Asteroid>();
        boolean[] keys = new boolean[3];
        private boolean shipDestroyed,continued,shielded;
        private int ex;
        public class ActionList extends KeyAdapter{
            public void keyPressed(KeyEvent e)
                int keyCode = e.getKeyCode();
                if(keyCode == e.VK_A)
                    keys[0] = true;
                if(keyCode == e.VK_D)
                    keys[1] = true;
                if(keyCode == e.VK_Y)
                    keys[2] = true;
                if(keyCode == e.VK_F2 && !continued)
                    continued = true;
                    shipDestroyed = false;
                    ex = 0;
                    shielded = true;
                    start = System.currentTimeMillis();
                /*if(keyCode == e.VK_A)
                    if(ship1.x <= 15)
                        ship1.x = 15;
                    else
                        ship1.x -= 5;
                if(keyCode == e.VK_D)
                    if(ship1.x >= 589)
                        ship1.x = 589;
                    else
                        ship1.x += 5;
                if(keyCode == e.VK_Y)
                    Shot newShot = new Shot(ship1.x);
                    shots.add(newShot);
            public void keyReleased(KeyEvent e)
                int keyCode = e.getKeyCode();
                if(keyCode == e.VK_A)
                    keys[0] = false;
                if(keyCode == e.VK_D)
                    keys[1] = false;
                if(keyCode == e.VK_Y)
                    keys[2] = false;
        public Main()
            createStars();
            addKeyListener(new ActionList());
            setSize(640,480);
            setTitle("Shoot by Takeshi®");
            setResizable(false);
            setVisible(true);
            setBackground(Color.BLACK);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            i = new ImageIcon("C:/Documents and Settings/dioNisio.OWLCITY/My Documents/NetBeansProjects/GamePractice/src/ship1.png");
            ship = i.getImage();
            i = new ImageIcon("C:/Documents and Settings/dioNisio.OWLCITY/My Documents/NetBeansProjects/GamePractice/src/shot.png");
            shot = i.getImage();
            i = new ImageIcon("C:/Documents and Settings/dioNisio.OWLCITY/My Documents/NetBeansProjects/GamePractice/src/asteroid.png");
            asteroid = i.getImage();
            i = new ImageIcon("C:/Documents and Settings/dioNisio.OWLCITY/My Documents/NetBeansProjects/GamePractice/src/shield.png");
            shield = i.getImage();
            stageFont = new Font("Courier New",Font.BOLD,20);
            lastAsteroidPosition = 0;
            scoreShow = "0000000000";
            shielded = true;
            try
                URL sound = new URL("file:///C:/Documents%20and%20Settings/dioNisio.OWLCITY/My%20Documents/NetBeansProjects/GamePractice/src/laserfast.au");
                shoot = Applet.newAudioClip(sound);
            catch(MalformedURLException e)
                System.out.print(""+e.getMessage());
            continued = true;
            createAsteroids();
        @Override
        public void run()
                start = System.currentTimeMillis();
                while(true)
                    if((System.currentTimeMillis() - start) >= 5000)
                        shielded = false;
                    animateStars();
                    animateAsteroids();
                    animateExplosion();
                    animateShots();
                    if(continued)
                        animateShip();
                        createShot();
                try {
                    Thread.sleep(5);
                } catch (InterruptedException ex) {
                    Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        public static void main(String[] args)
            Main newMain = new Main();
            Thread t1 = new Thread(newMain);
            t1.start();
        @Override
        public void paint(Graphics g)
            dbImage = createImage(getWidth(), getHeight());
            dbg = dbImage.getGraphics();
            paintComponent(dbg);
            g.drawImage(dbImage, 0, 0, this);
            repaint();
        public void paintComponent(Graphics g)
            g.setColor(Color.WHITE);
            for(int c = 0; c < 200; c++)
                g.setColor(stars[c].color);
                g.fillOval(stars[c].x, stars[c].y, (stars[c].radius * 2), (stars[c].radius * 2));
            for(int c = 0; c < asteroids.size(); c++)
                g.drawImage(asteroid,asteroids.get(c).x, asteroids.get(c).y, this);
            for(int c = 0; c < exploded.size(); c++)
                i = new ImageIcon("C:/Documents and Settings/dioNisio.OWLCITY/My Documents/NetBeansProjects/GamePractice/src/e"+(exploded.get(c).explodeMode+1)+".png");
                explode = i.getImage();
                g.drawImage(explode,exploded.get(c).x, exploded.get(c).y, this);
                if(exploded.get(c).explodeMode < 14)
                    g.setColor(Color.white);
                    g.drawString("50",exploded.get(c).x, exploded.get(c).y);
            for(int c = 0; c < shots.size(); c++)
                g.drawImage(shot,shots.get(c).x, shots.get(c).y, this);
            if(!shipDestroyed)
                g.drawImage(ship, ship1.x, ship1.y, this);
                if(shielded)
                    g.drawImage(shield, ship1.x - 15, ship1.y - 15 , this);
            else
                if(ex<14)
                        i = new ImageIcon("C:/Documents and Settings/dioNisio.OWLCITY/My Documents/NetBeansProjects/GamePractice/src/e"+(ex+1)+".png");
                        explode = i.getImage();
                        g.drawImage(explode,ship1.x, ship1.y, this);
                        if((System.currentTimeMillis() - ship1.lastExplodeDisplay) >= 250)
                            ex++;
                            ship1.lastExplodeDisplay = System.currentTimeMillis();
                if(!continued)
                    g.setColor(Color.WHITE);   
                    g.drawString("PRESS F2 TO CONTINUE",470,50);
            g.setColor(Color.WHITE);
            g.setFont(stageFont);
            g.drawString("STAGE 1",20,50);
            g.setColor(Color.RED);
            for(int c = 0; c < ship1.lives; c++)
                g.drawString("♥",120+(c*10),50);
            g.setColor(Color.WHITE);
            g.drawString(""+ship1.score, 20, 70);
        public void animateStars()
            for(int c = 0; c < 200; c++)
                if(stars[c].y >= 460)
                    stars[c].y = 0;
                else
                    stars[c].y += stars[c].speed;
        public void animateShots() {
            boolean xTargeted = false, yTargeted = false, destroyed = false;
            for(int c = 0; c < shots.size() ; c++)
                for(int j = 0; j < asteroids.size(); j++)
                        if(((shots.get(c).x >= asteroids.get(j).x) && (shots.get(c).x < (asteroids.get(j).x + 30))) || (((shots.get(c).x + 30) >= asteroids.get(j).x) && ((shots.get(c).x + 30) < (asteroids.get(j).x + 30))))
                            xTargeted = true;
                        if((asteroids.get(j).y + 30 - shots.get(c).y) > 0)
                            yTargeted = true;
                        if(xTargeted && yTargeted)
                            exploded.add(asteroids.get(j));
                            asteroids.remove(j);
                            ship1.score += 50;
                            destroyed = true;
                        xTargeted = false;
                        yTargeted = false;
                if(destroyed)
                    shots.remove(c);
                    destroyed = false;
                else if(shots.get(c).y <=0)
                    shots.remove(c);
                else
                    shots.get(c).y -= shots.get(c).speed;
        public void animateAsteroids() {
            boolean xTargeted = false;
            boolean yTargeted = false;
            boolean sxTargeted = false;
            boolean syTargeted = false;
            for(int c = 0; c < asteroids.size() ; c++)
                if(shielded)
                    if(((ship1.x - 15 >= asteroids.get(c).x) && (ship1.x - 15 < (asteroids.get(c).x + 30))) || ((((ship1.x - 15) + 64) >= asteroids.get(c).x) && (((ship1.x - 15) + 64) < (asteroids.get(c).x + 30))))
                        sxTargeted = true;
                    if((asteroids.get(c).y + 30 - ship1.y) > 0)
                        syTargeted = true;
                    if(sxTargeted && syTargeted)
                        exploded.add(asteroids.get(c));
                        asteroids.remove(c);
                    sxTargeted = false;
                    syTargeted = false;
                else
                    if(((ship1.x >= asteroids.get(c).x) && (ship1.x < (asteroids.get(c).x + 30))) || (((ship1.x + 30) >= asteroids.get(c).x) && ((ship1.x + 30) < (asteroids.get(c).x + 30))))
                        xTargeted = true;
                    if((asteroids.get(c).y + 30 - ship1.y) > 0)
                        yTargeted = true;
                    if(xTargeted && yTargeted)
                        asteroids.remove(c);
                        shipDestroyed = true;
                        continued = false;
                        ship1.lives --;
                    xTargeted = false;
                    yTargeted = false;
                if(asteroids.get(c).y >=480)
                    asteroids.remove(c);
                else
                    asteroids.get(c).y += asteroids.get(c).speed;
        public void animateShip()
            if(keys[0] && !keys[1])
                if(ship1.x <= 15)
                    ship1.x = 15;
                else
                    ship1.x -= 5;
            else if(!keys[0] && keys[1])
                if(ship1.x >= 589)
                    ship1.x = 589;
                else
                    ship1.x += 5;
        public final void createStars()
            for(int c = 0; c < 200; c++)
                stars[c] = new Star();
        public void createShot()
            if(keys[2] && System.currentTimeMillis() - lastShot >= 150)
                Shot newShot = new Shot(ship1.x);
                shots.add(newShot);
                lastShot = System.currentTimeMillis();
                shoot.play();
        public final void createAsteroids()
            boolean verifiedGeneration = false;
            Asteroid newAsteroid = null;
            for(int c = 0; c < 100; c++)
                newAsteroid = new Asteroid();
                if((newAsteroid.y - lastAsteroidPosition) < 500)
                    newAsteroid.y -= (500 - (lastAsteroidPosition - newAsteroid.y));
                asteroids.add(newAsteroid);
                lastAsteroidPosition = newAsteroid.y;
        public void animateExplosion()
            for(int c = 0; c< exploded.size(); c++)
                if(exploded.get(c).y >= 480)
                    exploded.remove(c);
                else
                    exploded.get(c).y += exploded.get(c).speed;
                    if((System.currentTimeMillis() - exploded.get(c).lastExplodeDisplay) >= 150)
                        exploded.get(c).explodeMode++;
                        exploded.get(c).lastExplodeDisplay = System.currentTimeMillis();
    }So when I freshly run the program it works fine, but after a few shots and collisions with asteroids, the program throws an IndexOutOfBoundsException and I don't know where to trace it. I am beginning to think that the problem lies in my ArrayList. Here is a link to the program screenshot.
    Any help would be greatly appreciated.
    Thanks!
    Edited by: 893284 on Oct 26, 2011 4:59 AM

    First of all, put your program code between tags. Nobody's going to read unformatted code.
    Secondly, IOOBE is a very simple to understand exception. You're accessing a collection beyond its limits.
    Thirdly, the stacktrace will tell you where this happens. If you have multiple threads involved, you might need appropriate synchronization in there.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Programming catching exceptions to control program flow.

    Hello,
    I have the following snippet:
         public List subList(int fromIndex, int toIndex) {
              PGSearchEngineList subList = new PGSearchEngineList();
              for (int index = fromIndex; index < toIndex; index++) {
                   try {
                        subList.add(this.get(index));
                   } catch (IndexOutOfBoundsException e) {
                        return subList;
              return subList;
         }Notice that I use a try catch to catch a IndexOutOfBoundsException and to control program flow. Is this a bad practice?
    Julien Martin.

    I believe I read once that you shouldn't code an exception to deal with a condition that you could reasonably expect to occur. There is some sample code for the value list handler on the j2ee patterns page that deals with search result paging in a little "cleaner" way:
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/ValueListHandler.html
    Hope this helps.
    Amber

Maybe you are looking for

  • 13.3" macbook pro flickering screen when waking from sleep

    I have a Mid 2012 13.3" MacBook Pro (non-Retina) laptop that has been working well, until the last few days.  The laptop has had no physical damage and no liquid damage.  I have put the laptop to sleep by closing the lid.  When the laptop lid is rais

  • Using iPod with external Hard Drive connected to laptop

    Is there a way to use the iPod video and an external hard drive connected to a Dell Latitude D600 laptop at the same time? I can use one or the other but not both. When both are connected using the usb ports on the back of the laptop, the iPod is not

  • Can't get show/hide subform to work.

    Although I've done my best to show/hide a subform through a radio-button in Livecycle, I can't get it to work. Any help will be greatly appreciated. Please see: https://dl.dropboxusercontent.com/u/92058288/problem.jpg https://dl.dropboxusercontent.co

  • How can i create the blue "I"-Button for the Documentation in a view

    How can i create the blue "I"-Button for the documentation in a view? I want to prepare the button with user specified Information... and where must be create the documentation? thanks Edited by: DDC-TD on Apr 24, 2008 10:22 PM

  • Give  authorization object to fm

    Hi, How i can give  authorization object to new Fm , i new in this topic . P.S. if i ask in wrong forum plz tell me where . Regards