ViewObject reference 2 EO

I've created a viewobject wich use 2 EO (not on readonly mode).
When I try to insert a new row here is the error I get:
Error Message: JBO-26041: Failed to post data to database during "Insert": SQL Statement " INSERT INTO STOCK_QUANTITE(SQ_LOCALISATION_ID,SQ_QUANTITE,SQ_REMARQUE) VALUES (?,?,?)".
Does that means I can't have a VO referencing 2 EO and insert a row i each underlying tables?
Thanks.
null

Olivier,
The behavior you are seeing may depend somewhat on what else is going on in the database.
Do you have any database triggers that are firing on either of the tables? For instance to insert a primary key value from a sequence or update a tracking table.
If yes, then make sure you have set the 'Refresh after Insert' or Refresh after Update on the EO that represents the table the trigger runs on.
Laura

Similar Messages

  • Table-Export to XML

    Hi all!
    I'm a Newbie in BC4J, but I have to create an apllication with this technology.
    My problem is, that one table should be exported to XML. I know that the standard Apllication, created by a wizard got this feature, but I didn't found the sourcecode.
    Is there anybody, who knows how to implement an XML-Export?
    Thanx
    Peter Zerwes

    Get the ViewObject reference that you want to export, e.g, in an AM say there's Dept/Emp VOs setup as masterdetail,
    you may then get the DeptVO and call one of the writeXML() apis on it.
    See javadoc for oracle.jbo.ViewObject and oracle.jbo.XMLInterface.writeXML().

  • How to reference the Parent view Object attribute in Child View object

    Hi , I have the requirememt to generate Tree like struture to display Salary from joining date to retirement date in yearly form.I have writtent two Pl/SQL function to return parent node and child nodes(based on selected year).
    1.First function --> Input paramter (employee id, retirement date , joining date) --> return parent node row with start_date and end_date
    2. 2nd function --> input paarmter(employee id, startDate, end_date) --> return child node based on selected parent node i.e. start date and end date
    I have created two ADF view object based on two function return
    Parent Node --> select * from Table( EUPS.FN_GET_CONTR_SAL_BY_YR(employeeId,retirement Date, dateOf joining)) ;
    Child Node --> select * FROM TABLE( EUPS.FN_GET_CONTR_SAL_FOR_YEAR( employeId,startDate, endDate) ) based on selected parent node.
    I am giving binding variable as input for 2nd function (child node) . I don't know how to reference the binding variable value in child view from parent view.
    Like I have to refernce employeId,startDate, endDate values in 2nd function from parent view object. some thing like parentNode.selectedStart_date parentNode.employeeId.
    I know we can achive this writing the code in backing bean.But i want to know how can we refernce parent view object attribute values in child view object using Groovy or otherway?
    I will appreciate your help.
    Thanks

    I have two view com.ContractualSalaryByYearlyView for Parent Node and com.ContractualSalaryByYearlyView for child Node.
    I have created view link(ContractualSalYearlyByYearViewLink) betweem two view by giving common field empId, stDate , endDate.(below is the view link xml file).
    I tried give the binding attribute values using parent object reference like below in com.ContractualSalaryByYearlyView xml file but getting error
    Variable ContractualSalaryByYearlyView not recognized.I think i am using groovy expression.
    Thanks for quick response.
    com.ContractualSalaryByYearlyView xml
    <ViewObject
    <DesignTime>
    <Attr Name="_isExpertMode" Value="true"/>
    </DesignTime>
    <Variable
    Name="empId"
    Kind="where"
    Type="java.lang.Integer">
    <TransientExpression><![CDATA[adf.object.ContractualSalaryByYearlyView.EmpId]]></TransientExpression>
    </Variable>
    ContractualSalYearlyByYearViewLink.xml file
    <ViewLinkDefEnd
    Name="ContractualSalaryByYearlyView"
    Cardinality="1"
    Owner="com.ContractualSalaryByYearlyView"
    Source="true">
    <DesignTime>
    <Attr Name="_finderName" Value="ContractualSalaryByYearlyView"/>
    <Attr Name="_isUpdateable" Value="true"/>
    </DesignTime>
    <AttrArray Name="Attributes">
    <Item
    Value="com.ContractualSalaryByYearlyView.EmpId"/>
    <Item
    Value="com.ContractualSalaryByYearlyView.StDate"/>
    <Item
    Value="com.ContractualSalaryByYearlyView.EndDate"/>
    </AttrArray>
    </ViewLinkDefEnd>
    <ViewLinkDefEnd
    Name="ContractualSalaryForYearView"
    Cardinality="-1"
    Owner="com.ContractualSalaryForYearView">
    <DesignTime>
    <Attr Name="_finderName" Value="ContractualSalaryForYearView"/>
    <Attr Name="_isUpdateable" Value="true"/>
    </DesignTime>
    <AttrArray Name="Attributes">
    <Item
    Value="com.ContractualSalaryForYearView.EmpId"/>
    <Item
    Value="com.ContractualSalaryForYearView.StDate"/>
    <Item
    Value="com.ContractualSalaryForYearView.EndDate"/>
    </AttrArray>
    </ViewLinkDefEnd>

  • How to create a viewobject dynamically without using wizard

    Hi,
    I am Using jDEV 11G, i need to create a viewobject dynamically without using wizard, without binding from any entity.
    Actually my intention is to make a grid like in .Net, when a user want to create a new row in RichTable without using DB.
    just like shopping cart.
    i have done thsi code:
    ViewObjectImpl view=new ViewObjectImpl();
    view.addDynamicAttributeWithType("Att1","String",null);
    view.addDynamicAttributeWithType("Att2","String",null);
    view.addDynamicAttributeWithType("Att2","String",null);
    Row rw=view.createRow();
    rw.setAttribute("Att1","First1");
    rw.setAttribute("Att2","First2");
    rw.setAttribute("Att2","First3");
    view.insertRow(rw);
    I have a RichTable , i need bind this viewobject into that.
    Edited by: vipin k raghav on Mar 10, 2009 11:39 PM

    Hi Vipin,
    You can create the view object with rows populated at run time.
    [http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcquerying.htm#CEGCGFCA]
    For reference of how to create an empty rwo at run time on button click
    [http://kohlivikram.blogspot.com/2008/10/add-new-row-in-adf-table-on-button.html]
    ~Vikram

  • How can i reference a MIME object within a correspondence format through...

    how can i reference a MIME object within a correspondence format through TX oofo or se71?
    Hi, I need to put a MIME object within a correspondence's format that i've already done through Tx oofo. My problem is, that i don't know exactly how can i make the reference of that MIME object in the format? and What structure type do i have to use in order to make appear the MIME object in my correspondence's format? Does anybody can help me with this?   
    Regards    Hector

    Frank,
    I tried to find some examples/samples on how to create CollectionModel for a table component but not successful.
    Can you clarify the following ?
    1. "CollectionModel" is referenced only by af:table attributes "value", "selectedRowKeys" and "selectionListener".
    The rest of af:table attributes such as "rows", "fetchSize" used to reference the iterator binding in the binding container via the EL expression "#{bindings.VOIteratorBinding.xxx} .
    What should I replace that EL expression with?
    2. I heck out the bean method to create the CollectionModel as following, is it close to what you mean?
    public void initBusinessDataDashboardView() {
    OperationBinding operation = BeanUtils.getOperationBinding("getPanelBusinessData");
    Map params = operation.getParamsMap();
    Key panelKey = getPanelInfoView().getKey();
    params.put("panelKey", panelKey);
    params.put("maximizedView", false);
    panelView = (ViewObject)operation.execute();
    // Heck code to create CollectionModel
    RowSet rowSet = panelView.getRowSet();
    ArrayList rowList = new ArrayList();
    while (rowSet.hasNext()) {
    rowList.add(rowSet.next());
    model = new ChildPropertyTreeModel(rowList, null);
    // To be used to set up af:table value, selectRowKeys, selectionListener via EL expr #{backingBeanScope.MyBean.model.xxx}
    public CollectionModel getModel() {
    return model;
    Am I on the right track?
    Edited by: Pricilla on May 4, 2010 2:20 PM

  • How to get values in table using viewobject ?

    hi,iam using jdev 11.1.2.3.0
    my requirement as follows ..
    i have login form with  username and password and i was gave the option of forgot password.when ever the user clicks the forgot password link .i need to get the data from smtp configuration table(consists smtp port,smtp host,usermail,password) based on the usermail i need to get the data from the smtp table .
    when ever the user clicks forgot password it wil send the password to the respected email id given in the smtp tablem how tom achieve this requirement using view object ..............

    Hi,
    1. create VO and define Ciew Criteria to query rows based on a bind variable
    2. Go to Application Module and select VO, then press Edit button to associate View Criteria
    3. Build public method in Application Module Impl class to take user name as an input argument
    4. Expose this method on the AM client interface (also shown on the Java category of the AM editor)
    5. In the method, use this this.findViewObject("instance name"); to get a hold onto the VO
    6. Add the user name to the bind variable using the viewObject.getVariableManager()
    7. Execute VO
    8. get first row
    9. send mail
    10. Drag and drop method from the Data Control panel to your login page
    11. Use EL to reference the username provided by the user (managed bean reference?)
    This should be it
    Frank

  • Nullpointer: Reference entity null

    Hey,
    I have an view (PremiebetalerView) that consists of 4 entities:
    - PolisRelatie (updatable)
    - Relatie (reference FK between PolisRelatie and Relatie)
    - Straat (reference FK between Relatie and Straat)
    - Beroep (reference FK between Relatie and Beroep)
    In the SQL I added an outer join: PolisRelatie.REE_REE_ID = Relatie.REE_ID (+).
    I have also a Car view and a view link between CarView and PremiebetalerView, with CarView the master.
    In java code I create a Premiebetaler view row instance and set some defaults of the PolisRelatie entity. When I select in other screen a Relatie I want to set this ID in the column REE_REE_ID of the polis relatie and refresh the relatie (row.getRelatie().refresh(PremiebetalerViewRowImpl.REFRESH_CONTAINEES)). This works well in my first CarView instance but when I copy this instance to a new view row and again create a Premiebetaler view row instance then row.getRelatie() evaluates to null so I can't refresh the entity.
    Why is this entity null and how can I 'initialise' this entity?
    Thanx, Marianne

    Workaround: update the reference entity manually.
    Create a custom ViewRowImpl (generate accessors) for the view, and for the foreign key attribute, use a setter that goes something like:
    public void setQuoteSheetId(Number value) {
      setAttributeInternal(QUOTESHEETID, value);
      // workaround ADF bug
      // if not equal
      if ((value != null) ? !value.equals(getpkQuoteSheetId()) : (getpkQuoteSheetId() != null)) {
        // find the correct entity and set it
        if (value != null) {
          ViewObject quoteSheetView = getApplicationModule().findViewObject("QuoteSheetView1");
          Key key = new Key(new Object[] { value });
          Row[] rows = quoteSheetView.findByKey(key, 1);
          if ((rows != null) && (rows.length == 1) && (rows[0] != null)) {
            ViewRowImpl viewRowImpl = (ViewRowImpl)rows[0];
            setEntity(4, viewRowImpl.getEntity(0));
          } else {
            throw new RowNotFoundException(false, quoteSheetView.getName(), key);
        } else {
          setEntity(4, null);
    }where
    getpkQuoteSheetId() is the getter for the primary key attribute of the reference entity,
    "QuoteSheetView1" is a default view of the reference entity,
    and 4 is the index of the reference entity for the view.

  • Entity Serivice with Reference and UI patterns

    Hello
    I have question.
    How can I configure Object Editor in order to have New button on Refence tab of Object Editor?
    I have two Entity services. Company and Contacts. BO Contacts is an attribute of BO Company with Relation Type  Association and Cardinality 0..n.
    When I configure ObjectEditor and use for the Contacts Relation Tab pattern.
    I allowed only add already existing Contact to the Company reference. How can I configure or model my BO in order to have possibility to add new contact "in place"?
    Thanks
    Andrew

    What you suggested about "validation codes on the VO" is not written on the ADF Documentation.
    I try to blindly/strictly follow best practices (particularly on Validations, using Declartive and/or built in validators) on most ADF documentation and blogs but there are many scenarios on coding some large ADF projects that I think must veer away from the best practices stated on the documentation or maybe add new rules on the documentation depending on how complex an ADF project would be.
    I religiously followed best practices stated on the documentation to use Entity and Attribute Validators when performing validations. What I did was i had created lots of Custom Validators (by implementing JboVAlidatorInterface interface) for each of the attributes on an Entity Object that need validated. So those validator is valid only for one attribute, its not reusable. And those validation codes either have reference to a ViewObject or call some PL/SQL procedure. So at some point are codes became messy.
    Ultimately the whole project became harder to manage when the codes became large. Now I am trying to refactor the whole application by separating it into project/package and I am hoping to do it with little Re-coding as possible.
    Hope to get your opinion on this one.
    regards,
    Anton

  • ViewObject based on two entities strange behaviour on insert

    Hi,
    I've noticed a strange problem today when I insered a new record in a detail view object.
    I have a master entity and a detail entity and an composition association between the entities. I also have a third entity which is referenced by the detail entity using an association (and is read-only/referenced in the detail view object). Based on these entities I have the following view objects / viewlinks:
    MasterView (uses MasterEntity).
    \-- DetailView (uses DetailEntity, DetailRefEntity) using
        the view link MasterDetailViewLinkEverything works fine, but when I add a new record to the detail view I get to see *two* new records. The first record shows empty fields for the fields that are part of the read-only/referenced DetailRefEntity. The second record shows all columns fine (how it is supposed to do). When I do a refresh on the ViewObject's I only get to see the correct detail record.
    This seems like some weird entity/view cache problem to me. Is this a known problem and is there a work-around (next to refreshing the views, which I'd rather don't do)?
    Regards,
    Peter

    Looking at your post my problem could be related, but the row I create surely gets initialized because I also set some other attributes in the new row. Next to this I use a viewlink for the relationship so I don't need to set the foreign key reference manually (like you did in your post for the department no). Anyways, like I said 9.0.3.2 doesn't fix my problem so these are probably distinct issues. When I find a solution I will update this posting, but I think it's something internal which I don't have access to. Hopefully someone from Oracle knows a workaround.
    Regards,
    Peter

  • Put ViewObject into scope in Java

    I need put ViewObject into scope in Java. For example,
    <bc4j:findViewObject name="xxxxView"> (FindViewObjectEventHandler) puts "xxxxView" into scope.
    Could I do the same in Java:
    ApplicationModule am = (ApplicationModule) context.getProperty(JboConstants.BC4J_NAMESPACE,
    JboConstants.APP_MODULE_PROPERTY);
    ViewObject vo = am.findViewObject("xxxxView");
    and then put it into scope?

    Sergey -
    Usually, the reason for putting a view object into scope (using <bc4j:findViewObject>) is to make the view object available to other declarative event handlers. If you are writing Java code, then once you obtain a reference to your view object, you should be able to interact with it programmatically - without needing to "put it into scope".
    Can you tell me a bit more about the behavior that you are trying to implement? I want to get a better understanding of why you need to put the view object into scope... what UIX code is going to be accessing the view object after you have put it into scope? Where is the Java code that puts the view object into scope being called from (an event handler)?
    Andy

  • ADF 10.1.2/10.1.3: Preventing eagerly querying of detail viewobjects

    Ever since we started developer ADF applications we had issues with database queries being performed when we didn't expect it. It turned out that this is the default behavior of the master-detail synchronization in ADF 10.1.2 and 10.1.3 (haven't tested 11 yet). I've come up with a solution of our own, which I want to share with you all. I also want to check if anybody here sees any drawbacks in this approach.
    First some background info: Whenever the master view object is requeried or navigates to another row it requeries all detail view objects that have been queried previously. Detail view objects that are in their initial/clean state are not touched.
    So, on the very first page of your application you might need DEPT and EMP, and they are automatically queried (since the ADF bindings are refreshed). However, when you navigate to the next page it might only use the DEPT ViewObject. If you navigate to another DEPT, the EMP query is also re-executed even if this next page doesn't have a binding for EMP.
    Steve Muench described a possible workaround (number 74) at
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html
    Although his solution works, we didn't really like it. Here's a summary of his approach:
    <ul>
    <li> add a method <tt>enableDetailsForViewInstances()</tt> to the ADF BC Application Module. This accepts an array of view instance names representing the views used on the current page. It then enabled/disables the master-detail synchronization for each viewlink based so that only the viewlinks relevant to the current page are enabled.</li>
    <li> add a custom <tt>JSFPageLifecycle</tt> class that overrides the <tt>prepareModel()</tt> method.
    This methods assembles a list of all view instances used by the iterator bindings of the current page. It then calls the method on the ADF BC Application Module to enable/disable the viewlinks</li>
    </ul>
    The Application Module disables master-detail synchronization by calling <tt>removeMasterRowSetIterator()</tt> on the detail viewobject. This removes the master-RowSetIterator from the default RowSetIterator of the detail VO, effectively breaking the link. The old master-RowSetIterator is kept in a HashMap. Later, when both the master and detail VO are used on the same page the link is restored by calling <tt>setMasterRowSetIterator()</tt> on the detail with the master-RowSetIterator stored in the HashMap.
    The main objection we had to this approach is that you are pushing the relevant viewobjects from the View layer to the Model layer. We would like the Model not to be too knowledgable about the View layer. Also, this means things break if you get a hold of a detail viewobject some other way, for instance by calling findViewObject on the AppModule or by having an old reference to the detail VO. If you get hold of such a VO instance without calling <tt>enableDetailsForViewInstances()</tt> it would not have a master-rowsetiterator and an exception is thrown about the bind parameter from the viewlink being null.
    I tried to find a solution that is transparent to the View layer or other client. I wanted a solution where the eager master-detail navigation is disabled and the detail would only be requeried/refreshed when explicitely called for. This could either be your custom code calling the ViewObject or the JSF View layer having an ADF binding to the ViewObject. Basically I want to try to reset the detail ViewObject to its initial/clean state as the master VO won't requery the detail VO's that are in the initial stage. It only requeries the detail VOs that have a default RowSet and RowSetIterator.
    After quite some digging around I came up with:
    <ul>
    <li>clear/close the <tt>RowSetIterator</tt> on the detail <tt>ViewObject</tt> when navigating to another row in the master <tt>ViewObject</tt>. To do this, we use a <tt>DetailClearingListener</tt> class that implements the <tt>RowSetListener</tt> interface.</li>
    <li>The <tt>DetailClearingListener</tt> class implements the <tt>navigated(NavigationEvent event)</tt> method. This gets executed when the (master) ViewObject navigates to another row. In this <tt>navigate()</tt> method I iterate over <tt>ViewObject.getViewLinks()</tt> to find all the links where the navigating ViewObject is the source (=master). Then I look at the ViewObject from the destination (=detail) part of the link.
    For each detail ViewObject I get the RowSetIterators by calling <tt>ViewObject.getRowSetIterators()</tt>. Then I close all these RowSetIterators by calling <tt>closeRowSetIterator()</tt> on them</li>
    <li>The tricky part was to properly register this listener with the master ViewObject. As it turns out, you can call <tt>addListener()</tt> on the ViewObject, but in fact it is just relaying this to the default RowSetIterator of the ViewObject. It's the RowSetIterator that registers the listeners and calls them when required. This proved to be a problem, when a ViewObject is both the detail in a master-detail relationship and also the master in (another) master-detail relationship.
    With the DetailClearingListeners in place, the first (highest) master-detail relationship will close the default RowSetIterator on it's detail VO when navigating the master. Unfortunately this also destroys the registered listeners on this default RowSetIterator that need to managed the lower master-detail relationship.
    The only workable solution we could find is to override the <tt>getDefaultRowSet()</tt> method in the ViewObject and register the listener there. This means that whenever the default rowset (and rowsetiterator) is requested, we make sure we register the DetailClearingListener before returning the rowset. Since we can't test if the listener is already registered it does mean we frequently register the listener even when it is not necessary. Luckily enough the internal implemention does prevent duplicates and will ignore any new listeners that are already registered. This is why we are creating only a single instance of the DetailClearingListener and store it in a private member variable of the ViewObject. That way, we use the same DetailClearingListener instance each time and duplicates are prevented.</li>
    <li>The big benefit of this approach is that only relies on changes to the ViewObject. This can easily be implemented by giving all your ViewObjects a common superclass that implements this solution. In most cases, you already have an application- or enterprise-wide ViewObjectImpl class that is the basis for all your ViewObjects. In that case, you can just implement the solution in that global class.</li>
    </ul>
    We've tested this solution in ADF 10.1.2 and 10.1.3 applications and found dramatic performance gains. We had one application were page requests took 10-15 seconds once you visited all pages in the application (thereby activating each ViewObject at least once). It was not uncommon for a navigation to another row in the master ViewObject to trigger 70-100 queries, since all the detail (and detail-detail, etc) ViewObject where eagerly requeried. With this new approach, page response times have dropped below 1 second.
    So, at least in our situaton, this solution seems to work. I'm just wondering what the downside of closing the RowSetIterator is. There must be some drawbacks to this approach, but it seems I can't find any so far. Hopefully some of you can suggest what the danger/drawback is in closing a RowSetIterator.

    Shay's question about experience is a good one. If you're not already proficient at UIX then I would choose JSF. If you've done very little J2EE/Java/JSP/HTML development work, you've got a couple of months of ramping up to be able to accomplish much tangible.
    I've been working on a project for a couple of months using ADF BC on the backend and JSF/ADF Faces for the View. The enticement was built on the expectation that 10.1.3. would be going into production very soon, and it seems that this is true, from what little hints and clues I can pick up from these tight-mouthed Oracle guys. ;-)
    The disadvantage of going that way is that the documentation sucks for doing anything but the most basic, declarative user interface development, especially if you want to use ADF Faces (there's some decent resource out in the world for JSF development, although even that is pretty thin). This is promised to be much improved with the production release.
    For the business services development, unless you already know ADF Business Components I strongly recommend grabbing a copy of the Oracle JDeveloper 10g Handbook. It fills in many of the gaps that otherwise leave you at a loss for how to tie the backend pieces together.
    Good luck!
    Johnny Lee

  • Unable to uncheck queriable attribute in viewobject

    A customer of mine has build a business components viewobject in Jdeveloper 10G based on an updateable entity object and a reference entity object.
    The attribute that refers to the reference entity object (in database terms the foreign key column) has the queriable property checked. It should be
    unchecked, but the JDeveloper UI does not allow me to uncheck the queriable property for this attribute.
    What's the reason that JDevelopers forces this attribute to be queriable ? In the entity object, this attribute is not queriable

    When you create or edit your App ID on the Apple dev site, you indicate whether push is supported. The mobileprovision files include that information. Ask your client to make sure that push turned off in the App ID settings. If they have to edit the App ID, they need to rebuild the mobileprovision files.

  • Strange ADF behaviour: duplicated lookup references

    Hi,
    I'm developing a JSP - Struts - ADF BC application with JDeveloper 10.1.2.1.0 (1913).
    I have the following issue:
    I have a ViewObject based on three EntityObjects, one updatable and two as reference.
    Say the ViewObject is based on the Main Entity 'Dept' and has two look-ups to the 'Emp' entity (one for manager and one for secretary). The ViewObject will show the departments plus the names of the manager and the secreatry for each department.
    Now in my custom struts action I create new rows for the ViewObject and in this new row I set the Id (foreign key) for the Manager programmatically. (This Id is fixed). Now when I show the JSP showing the new rows for this ViewObject, It shows the names of the manager correctly but it also shows the names of the managers in the secretary fields while these Id's (foreign keys) are still empty (null)!!!
    How can I avoid this behaviour?
    I am setting the secretary Id (foreign key) to null but that doesn't help, and trying to clear the name of the secratry in my program is not allowed since it is a read-only field.
    Any help is appreciated.

    Solved this... Using a single XXXXXUIModel.xml file was causing this.
    Tom

  • Testing ViewObject from ApplicationModule

    Hi all,
    I am trying to test the ViewObject from the ApplicationModule, but the ViewObject is null, what is the proper way to initialize it? Here is my code:
    public static void main(String[] args) {
    MyAppModuleImpl impl = new MyAppModuleImpl ();
    MyClazzViewObjectImpl vpl = new getMyClazzViewObjectImpl1();
    vpl.executeQuery(); //NULL POINTER OCCURS UPON REFERENCE TO vpl
    System.out.println(vpl.getAllRowsInRange().length);
    Can someone point me to the right direction? Thanks very much in advance.

    Thanks John for the quick response, I should of been a bit more detail in my original post. After doing a bit more digging around here is the solution I found:
    public static void main(String[] args) {
    try
    ApplicationModule am = Configuration.createRootApplicationModule("model.MyAppModule", "MyAppModuleLocal");
    System.out.println(am.getTransaction().isConnected()); //should print true.
    ViewObject vo =am.findViewObject("MyClazzView1"); //This string should correspond to the accessor definition inside your Application Module.
    vo.executeQuery();
    am.getTransaction().commit();
    Row[] rows = vo.getAllRowsInRange();
    System.out.println("Rows in range: " + rows.length); //Should print out a number if you defined your VO correctly.
    catch (Exception ex) {
    ex.printStackTrace();
    -W

  • ViewObject is null ?

    I’m developing a jsp application with bc4j using jdev 10g. I have a problem with viewobjects in the application module suddenly becoming null. It doesn't happen every time and it seems to depend on the computer environment as well. It works fine in the development environment, but when I transfer the application to my clients environment I am getting the error. The error happens in dataAction class. I have tried to place the code in findForward method and prepareModel method but the result is the same. Debugging the application I found that mViewObjects and mViewLinks in the application module become null at some point. The action gets executed a couple times and it works fine and then it breaks down.
    I can't see what is causing the problem. Below is the code of the dataAction. 'bindContainer' and 'module' in the prepareModel method are not null, but 'view' becomes null. It is also interesting that the data on the page (from the same view) is displayed correctly.
    public class FindSredstvaViewPageAction extends DataAction
    String page;
    protected void findForward(DataActionContext actionContext) throws Exception
    //Postavi page attribute tako da se otvori stranica na kojoj je current row, SredstvaView
    actionContext.getHttpServletRequest().setAttribute(MyGlobals.PAGE, page);
    // TODO: Override this oracle.adf.controller.struts.actions.DataAction method
    super.findForward(actionContext);
    private String getPage(int index)
    int rows_per_page = MyGlobals.ROWS_PER_PAGE;
    int page = 0;
    while(true)
    if(index < 0) break;
    if(index == 0) // prvi red na strani
    page ++;
    break;
    index = index - rows_per_page;
    page ++;
    return String.valueOf(page);
    protected void prepareModel(DataActionContext actionContext) throws Exception
    DCBindingContainer bindContainer = actionContext.getBindingContainer();
    StalnaSredstvaModuleImpl module = ((StalnaSredstvaModuleImpl)actionContext.getBindingContainer().getApplicationModule());
    SredstvaViewImpl view = module.getSredstvaView();
    page = getPage(view.getCurrentRowIndex());
    // TODO: Override this oracle.adf.controller.struts.actions.DataAction method
    super.prepareModel(actionContext);

    Hi,
    Please use DCDataControl.getDataProvider() to acquire an AM reference. Because your logic is implemented before prepareModel DCBindingContainer may reference an uninitialized AM reference from a previous request (I filed bug 3829746 to resolve this issue).
    Also, it is not recommended that you downcast to an AM "Impl" class in client side code. This will prevent your code from being redeployed in different configurations (immediate vs. batch). Instead of downcasting to the "Impl" class you may export the VO getter to a remote AM interface using the AM wizard and then downcast to the AM interface or use findViewObject(String) on the base ApplicationModule interface.
    Hope this helps,
    JR

Maybe you are looking for

  • I need to sync my old iPhone to a new iTunes but need to keep the data?

    Hi, I have got a new computer, and so obviosuly have had to download a new verison of iTunes to go with it, however, I now cant sync my iPhone (which was linked previously to an iTunes account on my old computer) without it wanting to erase allll my

  • How does FCP Pro X handle mixed frame rate video clips?

    My camcorders are by Canon and both can shoot 50i or 25p. Normally I shoot 25p to avoid interlace artefacts. As I understand it, FCP Pro X conforms the clips to match the initial clip in the storyline. But what would be the outcome if I included clip

  • Recommendations for printer/all in one for use with 10.9+? Help!

    Does anyone have recommendations for a printer/all-in-one that will work with Mavericks? Monochrome (b&w) laser printer/all-in-one preferred. This is for a small office (5-8 people). Frequent pdf printing and 30+ page documents. Right now I'm looking

  • Data guard error 12541

    Hi All Am gettiing following error when using dgmgrl DGMGRL> add database 'child' as connect identifier is 'child.gbwonw9bp21' maintained as physical; RACLE Instance PARENT - Archival Error. Archiver continuing. /export/data/db1/PARENT/bdump (PARENT)

  • Variables with Authorization as Processing type ...

    Hi Gurus, I also wanted to see if we have any good example for this kind of variable? I also have a question. If we have Authorizations on 0ORGUNIT and 0EMPLOYEE. The users will be able to see only what they are supposed to see. Now what is the use o