[jclient] TreeSelectionListener question

Hi,
I have a tree with a set of JUTreeDiscrAttrTypeBindings so each polymorphic row, based on a discriminator, has it's own icon etc.
Now, in the valueChanged() method of the TreeSelectionListener I added, I need to know what type of thingee I have clicked. I've tried this:
public void valueChanged(TreeSelectionEvent e)
    DefaultMutableTreeNode node = (DefaultMutableTreeNode)jTree1.getLastSelectedPathComponent();
    if (node != null)
      JUTreeNodeBinding tnb = (JUTreeNodeBinding)(node.getUserObject());
      ViewObject vo = tnb.getParent().getViewObject();
      Row r = vo.getCurrentRow();
      if (r!=null)
        System.out.println("Rowtype: "+r.getAttribute("type"));
  }However, r is always null, but I expected the selected row there. The type attribute is the discriminator of the entities of the view object that I used for the tree.
What's wrong in this example, or what is the correct way to retrieve this attribute?
Greetings,
Ivo

I believe this is duplicate thread from :
JUTreeNodeBinding question (nullpointer exception in getAttribute) (JUTreeNodeBinding question (nullpointer exception in getAttribute)
Ivo, let us know if you're situation is resolved with the discussion in the above thread (started by you)

Similar Messages

  • JClient Refresh Question (Am I trying too hard?)

    Environment: Windows 2000, JDeveloper (9.0.3.10.35)
    I have a JClient with a bunch of JTextFields bound to my BC4J app. I perform all of my business logic calculations/validations in the entity objects. I have some entity calculated attributes and these are calculating just fine. However, I also do some more complex calculations and manually set these entity attributes (about 5 of them). These calculations are triggered whenever a user modifies a textfield...
    My problem is that whenever I modify a textfield, the calculations are performed, the entity attributes updated, but they aren't shown/refreshed in the client. Hmmm... Here are some of the things I've been trying:
    - Override sourceChanged() in my view implementation. Ok, I can see "attribute changed" events, but how do I update the Swing textfield?
    - Got a handle to the iterator binding and forced a refresh from entity->view by calling "navigate(null)".
    Calling navigate(null) worked, so I then thought I could add this logic to the sourceChanged() handler but I am not sure about the easiest way to get the iterator binding from the view implementation. Hmmm... I think I'm making this way too hard... Am I missing something totally basic here? Any suggestions would be great? Thank you.
    BTW, the attributes are marked as updateable in both entity and view.

    I've done some more debugging, looking into the areas you referred me to... I think I have stumbled across the "eventing mechanism bug" between EO and VO when subclassing is involved (Re: package in all_objects shows invalid but compiles fine
    ). I failed to mention that I was using a polymorphic rowset because I didn't think it was relevant (shouldn't have assumed...)
    Here's what I've verified:
    When I set an attribute in the entity with no subclassing, notifyRowUpdated() is called in the view object. However, if the entity is a subclass, notifyRowUpdated() isn't called.
    Your first question may be if I have correctly setup the polymorphic rowset behavior. I think so... I've read all the articles/how to's that I've found about polymorphic rowsets in this discussion group. My "abstract" view points to my abstract entity, and then imports all of the subclasses (defined when you click the "subtypes" button in view object properties window). The discriminator is working and BC4J is instantiating the correct subclass, however, the view isn't getting notified when an entity's attribute is modified (ie, notifyRowUpdated() isn't getting called).This info along with the other link gives us enough to reproduce the bug and as mentioned in the other link, it is targeted for fix in our next release.
    The workaround to the "EO/VO eventing bug" was to call executeQuery() to refresh the detail. My problem seems to be in a slightly different context, so I'm not sure exactly what to do. As I had mentioned earlier, calling navigated(null) seemed to refresh the view. Should I pursue this or do you suggest something else? naviated(null) is a fine workaround. JClient bindings simply get the current row from 'the iterator' and displays that so that's effectively a refresh on the control-bindings.
    Would you like a small repro case? Thank you. Let us know if you hit any issues with this workaround.
    Thanks
    Shailesh

  • How to insert checkbox at a particular  cell  in jtable

    hello,
    I am a user of jdeveloper using jclient/swing .
    question:
    i am using jtable. i want that whenever i click on a specified cell then text at that particular cell get clear and a checkbox inserted in that cell . whenever i click on that checkbox i.e check the checkbox,
    again a text is inserted in that cell.
    thank you

    Did you ever get this to work? If I bind a JCheckbox to my attribute and add the checkbox to my JClient panel, the attribute value is properly bound to the checkbox with everything working correctly. Adding the checkbox as the TableCellEditor for the column doesn't work.
    Also, the link to using a Combobox as a table cell editor works, but the link doesn't tell where to donwload the sample code from. Doesn't anyone know the link?

  • How to insert jcheckbox in jtable

    hello
    i am user of oracle9i jdeveloper using jclient/swing .
    question:
    how to insert jcheckbox at a particular cell in jtable.
    please reply to me if anyone amongst you know the solution.
    thank you

    Please continue the discussion here: how to insert checkbox at a particular  cell  in jtable
    Correct me if this is not about the same subject.

  • General questions about JClient

    1. We are having problems with a business application we have developed using BC4J and a JClient client. The performance is horrible. On one update form we have 7 comboboxes, two tabels, some labels and one textfield. It takes 12 - 15 seconds to load, first time, and 4 - 7 seconds second time. Isn't it possible to get better performance on complexe GUI's using JClient?
    2. We have found out that the navigation binding on the comboboxes are about 10 - 15 times as slow as a LOV binding, but we are having problems using the LOV binding. The comboboxes work in a master - detail relationship, and we have that working with a view link and navigation binding. But we would like to use the faster LOV binding. Is it possible to use a LOV binding in a master - detail relationship?
    3. Why are navigation bindings so slow compared to LOV bindings?
    4. What are you general plans with JClient?
    5. Could you possible refer to another project or currently running program that is build using JClient. We feel that we are a little alone on this issue. Is JClient only running on samples, or has it shown it's effeciency in real life.
    6. It is running whitout problems in the samples and when we use the wizards to generate simple forms. But when we construct a complex GUI-structure we quickly run into performance problems. But also unexpected problems that we have difficulty solving, due to lack of documentation and knowledge.
    We would really appreciate, if you would take the time to answer our questions.
    A frustated development team.

    1. We are having problems with a business application we have developed using BC4J and a JClient client. The performance is horrible. On one update form we have 7 comboboxes, two tabels, some labels and one textfield. It takes 12 - 15 seconds to load, first time, and 4 - 7 seconds second time. Isn't it possible to get better performance on complexe GUI's using JClient?Depends on how the application is setup. There are a number of options for deployment that affects how the client app will perform. Are you running JClient app in client-server mode?
    Also in JDev 903, JClient designtime and runtime has fixed a number of issues that led to poor performance by default on a JClient wizard generated app by generating code that performs lazy load of controls and lazy bind of controls. This definitely affects the startup time of forms with tab windows such that only the required controls/bindings on the display is created to begin with.
    Further more if you have a certain example situation that you want us to look at, we'd definitely give that a test to see where the performance bottle-necks are? From our work with other customers, we've seen examples where application assumptions have led to "performance degradation" and when you remove those assumptions, the performance improvements are "noticable" - like how many queries get executed when you startup? Are all those needed? Could the queries be optimized? How many controls come up? Are they all visible and bound? Could they be lazily rendered/bound? etc.
    Yes, we do not have a suggested document yet, as JClient is still pretty new and customers are working on real-life apps which we've studied over time and are gathering "inputs" for best - practices kind of an article/example.
    2. We have found out that the navigation binding on the comboboxes are about 10 - 15 times as slow as a LOV binding, but we are having problems using the LOV binding. The comboboxes work in a master - detail relationship, and we have that working with a view link and navigation binding. But we would like to use the faster LOV binding. Is it possible to use a LOV binding in a master - detail relationship? In JDev 902, LOV Binding was "fetching" all the data for LOV Bindings upfront, so if your data set is small it'd perform well, however in most realtime customer apps that we saw, we found this to be a problem as LOVs would take time to come up the first time. That's been fixed in 903. Now Lovs and Navigation bindings both respect the fetch sizes and other tuning parameters set on the Bc4J ViewObject. So you can tune the fetchsize/rangesize on the VO in the Bc4J object to control how much data is fetched upfront for a given binding. that will definitely affect performance and memory usage as based on a case by case basis, apps would determine what/how many rows should be fetched upfront vs. how many to fetch on scroll/navigation etc.
    3. Why are navigation bindings so slow compared to LOV bindings?see 2 above.
    4. What are you general plans with JClient?See the JClient docs on OTN (jdeveloper page) for general information.
    If you have specific needs/questions we could sure get you answers for those.
    5. Could you possible refer to another project or currently running program that is build using JClient. We feel that we are a little alone on this issue. Is JClient only running on samples, or has it shown it's effeciency in real life.Again JDeveloper home page has referenceslinks that indicate which customers have used what kind of applications. Note that JClient was released for the first time in JDev 9.0.2 so it's still going thru the first round of performance and usability improvements.
    6. It is running whitout problems in the samples and when we use the wizards to generate simple forms. But when we construct a complex GUI-structure we quickly run into performance problems. But also unexpected problems that we have difficulty solving, due to lack of documentation and knowledge.This forum on OTN has a great amount of discussion on JClient issues and how to resolve various performance and other bugs in Jdev 902.
    I agree on lack of complete documentation and examples and we're working towards that. Note that we did put up a Jclient Bindings demo which is a good example of how to "architect" a medium complexity application, how to layout controls, bind them, show/hide etc. An improved version of this example will be placed on OTN alongwith a version of JDev 903 when it is made available on OTN.
    We would really appreciate, if you would take the time to answer our questions.
    A frustated development team. And your critique/bugs/feature ideas are always welcome.

  • A question about database schema when creating JClient Form

    Sir,
    I created a JClient Form application using the wizard, in which a JCLoginDialog was generated. Then I modified the JCLoginDialog.java file so that it works with JDBC instead of with the OracleAS JAAS Provider. My name is the database schama name, and I created the form using my name.
    When I log in using my name, It is fine. But when my colleague log in using her name, it is failed. The error message said that the table is not found. My colleague has access of the related database table through a database role.
    I think it is the schema problem when I create the model project. I do not know how to add the schema name before the table name, such as stephen.mytable .
    Please help me. Thanks
    Stephen

    I have solve the problem. That was a mistake I made.
    Stephen

  • Question about ADF JClient applications

    I have a View object based on an Entity object that represents an activity done and that has an ID of a worker that does it as a foreign key. I would also like to show the worker's name on the form, but that is an attribute not included in the View object or the Entity object. Is there an equivalent of an Oracle Forms WHEN-VALIDATE-ITEM trigger in a JClient form that would permit me to do so?
    Milos

    Milos,
    a View Object can be based on one or many Entity Objects. You can create a ViewObject that shows content from two tables, including the table containing the name of the worker. Alternatively you could use a query when creating a new attribute for the ViewObject that obtains the name of the worker. This would be a transient attribute.
    You may find the following web page helpful
    http://radio.weblogs.com/0118231/stories/
    Same for
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html
    Frank

  • JClient 3-tier questions

    How can I develop JClient which uses middle-tier on AS?
    I've created Application Modules from "Creating Swing Clients for Business Components Tutorial". Added Business Components Session EJB deployment profile. Added application modules as Session Facade (CMT). How to add remote middle-tier to Application Modules?
    What ports they use to communicate?
    Does protocol support proxy?

    Hi,
    check this out
    Re: My little BC4J EJB/Swing/JNLP HOWTO
    Frank

  • ADF-JClient Refresh (Newbie question)

    I've gotta believe this is an easy thing to do with ADF, yet after perusing the documentation I could find (most is struts oriented) I just can't seem to get this working and I'm sure somebody here has done it. Also I'm pretty green when it comes to this ADF stuff so hopefully I use all the right terms, etc.
    I have a simple app, that hooks up to a EJB application using a session facade. I have an Order bean, and I have an order line item bean and as you may guess there is a 1-M relationship between the two.
    I set up the page with all the ADF stuff, and basically both are displayed as JTables. When I go to add a line item I:
    1)want to call the ADF operation to do so
    2) refresh both tables with their appropriate data (orders has a total price item that needs to be incremented)
    3) select the orders JTable's order record that corresponds to the line item I just inserted
    4) select the lineItems JTable's line item record that I just inserted.
    The way I currently try to do this, which doesn't quite work is:
    1) call the ADF operation "addLineItem" passing it appropriate details
    2) define an ActionBindingListener class that has an afterActionPerformed() method that:
    a) calls panelBinding.execute() (to refresh the orders table)
    b) calls ordersTable.changeSelection(x, y, false, false) to try and select the appropriate row in the orders table
    c) calls "getLineItems" operation which looks at the row that ordersTable is pointing to to update the line items table
    d) calls lineItemsTable.changeSelect(x, y, false, false) to select the appropriate row in the line items table
    Doing this, after I add an item, I see the correct order get selected, but then the table seems to switch off of it and select the row at the top of the table (as if a refresh had been requested again). The odd thing is that sometimes the above logic seems to work. I'm thinking my problems probably stem from calling panelBinding.execute(), but I haven't found any other clear way to refresh the data without doing that. What am I doing wrong? or am I right and there is a bug with the refresh?
    Any ideas/suggestions, no matter how stupid it may seem are appreciated. I think this is something simple, I'm convinced I've just missed something obvious.

    I think I figured out my problem. The key was to not use the JTable.changeSelection() method to set my selection post update. I needed to set it on the the JUTableBinding via a using a NavigatableRowset, so I did something like:
    void selectLineItemRecord(Long oid)
    JUTableBinding tableBinding = (JUTableBinding) panelBinding.findControlBinding("lineItemList");
    NavigatableRowIterator iter = tableBinding.getIteratorBinding().getNavigatableRowIterator();
    if(oid != null)
    for(int i = 0; i < iter.getRowCount(); i++)
    Row row = iter.getRowAtRangeIndex(i);
    if(oid.equals(row.getAttribute("oid")))
    iter.setCurrentRow(row);
    return;
    // fall through if not found or oid doesn't exist
    iter.reset();
    This seems to work much better now. Now if I just need to figure out some scroll bar stuff and I should be all set.
    FYI, the thread I garnered this information from is Re: JTable returning to previously selected row after executeQuery()

  • JClient Find Mode question

    I have an application where I want to give the user the option of which columns to search for a user-given key. Everything works except that the find mode ANDs the results from the selected columns, so if I'm searching for a number string that appears in the Card ID column, no results are displayed, since that number doesn't appear in the Last Name column as well. Is there a way of setting Find Mode to OR the results?

    Scott,
    if i remember well just from looking at the table when going in find mode, then all entries in one lines are AND'ed together, while different lines are OR'ed together.
    Frank

  • ADF/Swing/JClient application migration problem from 10.1.3.5 to 11.1.1.3

    Hi,
    I am migrating an application from JDev 10.1.3.5 to 11.1.1.3 in order to deploy it to a java 1.6 JVM which is only certified with JDev 11.1.1.3
    No matter what I do the DataBindings.cpx file content is emptied by the IDE, the migration was successful => no errors displayed.
    I tried to solve the problem by doing the following but the file stays empty:
    1) the removing the project from the application and adding it again, migration is done again => FILE EMPTY
    2) adding manually the content in the source file then running XML validation => no errors, I close the file, reopen it and EMPTY AGAIN!
    Your is needed and will be appreciated!
    Thanks
    Fred
    Content of file DataBindings.cpx:
    <?xml version='1.0' encoding='UTF-8' ?>
    <Application xmlns="http://xmlns.oracle.com/adfm/application" id="DataBindings"
    Package="" version="10.1.2.18.73" SeparateXMLFiles="false"
    ClientType="JClient">
    <pageMap/>
    <pageDefinitionUsages>
    <page id="PanelWeventEditParamVO1UIModel"
    path="com.xxx.view.web.PanelWeventEditParamVO1UIModel"/>
    <page id="TogglePanelPrintSizeDpiUIModel"
    path="com.xxx.view.lab.TogglePanelPrintSizeDpiUIModel"/>
    <page id="PanelPhotographerLabROfPhotolabVO1UIModel"
    path="com.xxx.view.web.PanelPhotographerLabROfPhotolabVO1UIModel"/>
    <page id="PanelWeventEditStatusVO1UIModel"
    path="com.xxx.view.web.PanelWeventEditStatusVO1UIModel"/>
    <page id="MDDPhotographerGalleryWelcomeUIModel"
    path="com.xxx.view.web.MDDPhotographerGalleryWelcomeUIModel"/>
    <page id="PanelTranslationCountryRegionLangTableVO1UIModel"
    path="com.xxx.view.system.PanelTranslationCountryRegionLangTableVO1UIModel"/>
    <page id="PanelDestGroupDestRTableVO1UIModel"
    path="com.xxx.view.system.PanelDestGroupDestRTableVO1UIModel"/>
    <page id="PanelWeventEditPackageVO1UIModel"
    path="com.xxx.view.web.PanelWeventEditPackageVO1UIModel"/>
    <page id="PanelSiteTariffPaymentTableVO1UIModel"
    path="com.xxx.view.system.PanelSiteTariffPaymentTableVO1UIModel"/>
    <page id="PanelPhotolabClobFreePage1L1VO1UIModel"
    path="com.xxx.view.web.PanelPhotolabClobFreePage1L1VO1UIModel"/>
    <page id="PhotoWebshopDesktopUIModel"
    path="com.xxx.view.start.PhotoWebshopDesktopUIModel"/>
    <page id="PanelItemGiftKitItemGiftTableVO1UIModel"
    path="com.xxx.view.lab.PanelItemGiftKitItemGiftTableVO1UIModel"/>
    <page id="TabbedFormUIModel"
    path="com.xxx.view.system.TabbedFormUIModel"/>
    <page id="PanelEntityPhotolabVO1UIModel"
    path="com.xxx.view.system.PanelEntityPhotolabVO1UIModel"/>
    <page id="PanelAddressVO1UIModel"
    path="com.xxx.view.web.PanelAddressVO1UIModel"/>
    <page id="SiteEventTypesAndTariffsFormUIModel"
    path="com.xxx.view.start.SiteEventTypesAndTariffsFormUIModel"/>
    <page id="PanelSiteVO1UIModel"
    path="com.xxx.view.system.PanelSiteVO1UIModel"/>
    <page id="PanelSiteBonusTypeVO1UIModel"
    path="com.xxx.view.system.PanelSiteBonusTypeVO1UIModel"/>
    <page id="PanelWeventAccountFileUploaderUIModel"
    path="com.xxx.view.web.PanelWeventAccountFileUploaderUIModel"/>
    <page id="PanelLabelWhereVO1UIModel"
    path="com.xxx.view.system.PanelLabelWhereVO1UIModel"/>
    <page id="PanelLabelWhatVO1UIModel"
    path="com.xxx.view.system.PanelLabelWhatVO1UIModel"/>
    <page id="PanelLabelWhoVO1UIModel"
    path="com.xxx.view.system.PanelLabelWhoVO1UIModel"/>
    </pageDefinitionUsages>
    <dataControlUsages>
    <BC4JDataControl Configuration="BaseTablesAMLocal"
    Package="com.xxx.model.system"
    xmlns="http://xmlns.oracle.com/adfm/datacontrol"
    id="BaseTablesAMDataControl"
    FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl"
    syncMode="Immediate">
    <Parameters>
    <Parameter name="FactoryClass"
    value="oracle.adf.model.bc4j.DataControlFactoryImpl"/>
    <Parameter name="SupportsFindMode" value="true"/>
    <Parameter name="Configuration" value="BaseTablesAMLocal"/>
    <Parameter name="SupportsTransactions" value="true"/>
    <Parameter name="Package" value="com.xxx.model.system"/>
    <Parameter name="SubType" value="DCBC4J"/>
    <Parameter name="Name" value="BaseTablesAMDataControl"/>
    <Parameter name="id" value="BaseTablesAMDataControl"/>
    </Parameters>
    </BC4JDataControl>
    <BC4JDataControl Configuration="SiteTablesAMLocal"
    Package="com.xxx.model.system"
    xmlns="http://xmlns.oracle.com/adfm/datacontrol"
    id="SiteTablesAMDataControl"
    FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl"
    syncMode="Immediate">
    <Parameters>
    <Parameter name="FactoryClass"
    value="oracle.adf.model.bc4j.DataControlFactoryImpl"/>
    <Parameter name="SupportsFindMode" value="true"/>
    <Parameter name="Configuration" value="SiteTablesAMLocal"/>
    <Parameter name="SupportsTransactions" value="true"/>
    <Parameter name="Package" value="com.xxx.model.system"/>
    <Parameter name="SubType" value="DCBC4J"/>
    <Parameter name="Name" value="SiteTablesAMDataControl"/>
    <Parameter name="id" value="SiteTablesAMDataControl"/>
    </Parameters>
    </BC4JDataControl>
    <BC4JDataControl Configuration="SystemViewAMLocal"
    Package="com.xxx.model.system"
    xmlns="http://xmlns.oracle.com/adfm/datacontrol"
    id="SystemViewAMDataControl"
    FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl"
    syncMode="Immediate">
    <Parameters>
    <Parameter name="FactoryClass"
    value="oracle.adf.model.bc4j.DataControlFactoryImpl"/>
    <Parameter name="SupportsFindMode" value="true"/>
    <Parameter name="Configuration" value="SystemViewAMLocal"/>
    <Parameter name="SupportsTransactions" value="true"/>
    <Parameter name="Package" value="com.xxx.model.system"/>
    <Parameter name="SubType" value="DCBC4J"/>
    <Parameter name="Name" value="SystemViewAMDataControl"/>
    <Parameter name="id" value="SystemViewAMDataControl"/>
    </Parameters>
    </BC4JDataControl>
    <BC4JDataControl Configuration="PhotolabSetupAMLocal"
    Package="com.xxx.model.lab"
    xmlns="http://xmlns.oracle.com/adfm/datacontrol"
    id="PhotolabSetupAMDataControl"
    FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl"
    syncMode="Immediate">
    <Parameters>
    <Parameter name="FactoryClass"
    value="oracle.adf.model.bc4j.DataControlFactoryImpl"/>
    <Parameter name="Configuration" value="PhotolabSetupAMLocal"/>
    <Parameter name="SupportsFindMode" value="true"/>
    <Parameter name="SupportsTransactions" value="true"/>
    <Parameter name="Name" value="PhotolabSetupAMDataControl"/>
    <Parameter name="SubType" value="DCBC4J"/>
    <Parameter name="Package" value="com.xxx.model.lab"/>
    <Parameter name="id" value="PhotolabSetupAMDataControl"/>
    </Parameters>
    </BC4JDataControl>
    <BC4JDataControl Configuration="PhotolabWebAMLocal"
    Package="com.xxx.model.web"
    xmlns="http://xmlns.oracle.com/adfm/datacontrol"
    id="PhotolabWebAMDataControl"
    FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl"
    syncMode="Immediate">
    <Parameters>
    <Parameter name="FactoryClass"
    value="oracle.adf.model.bc4j.DataControlFactoryImpl"/>
    <Parameter name="Configuration" value="PhotolabWebAMLocal"/>
    <Parameter name="SupportsFindMode" value="true"/>
    <Parameter name="SupportsTransactions" value="true"/>
    <Parameter name="Name" value="PhotolabWebAMDataControl"/>
    <Parameter name="SubType" value="DCBC4J"/>
    <Parameter name="Package" value="com.xxx.model.web"/>
    <Parameter name="id" value="PhotolabWebAMDataControl"/>
    </Parameters>
    </BC4JDataControl>
    </dataControlUsages>
    </Application>

    Ok it seems I have resolved my problem see end of thread
    Still have following relevant question for an Oracle team member:
    Why is my <pageMap/> empty in my migrated application cpx file?
    => when I create a new ADF Swing application this tag is not empty:
    in new file:
    <pageMap>
    <page path="view.PanelPhotolabVO1" usageId="view_PanelPhotolabVO1PageDef"/>
    </pageMap>
    <pageDefinitionUsages>
    <page id="view_PanelPhotolabVO1PageDef"
    path="view.pageDefs.PanelPhotolabVO1PageDef"/>
    in migrated file:
    <pageMap/>
    <pageDefinitionUsages>
    <page id="PanelWeventEditParamVO1UIModel"
    path="com.photoswing.view.web.PanelWeventEditParamVO1UIModel"/>
    Solution to empty migrated cpx file:
    It seems the migration utility couldn't cope with the BC4JDataControl definitions, so I edited them manually.
    Example of 10.1.3... syntax:
    <dataControlUsages>
    <BC4JDataControl Configuration="BaseTablesAMLocal"
    Package="com.xxx.model.system"
    xmlns="http://xmlns.oracle.com/adfm/datacontrol"
    id="BaseTablesAMDataControl"
    FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl"
    syncMode="Immediate">
    <Parameters>
    <Parameter name="FactoryClass"
    value="oracle.adf.model.bc4j.DataControlFactoryImpl"/>
    <Parameter name="SupportsFindMode" value="true"/>
    <Parameter name="Configuration" value="BaseTablesAMLocal"/>
    <Parameter name="SupportsTransactions" value="true"/>
    <Parameter name="Package" value="com.photoswing.model.system"/>
    <Parameter name="SubType" value="DCBC4J"/>
    <Parameter name="Name" value="BaseTablesAMDataControl"/>
    <Parameter name="id" value="BaseTablesAMDataControl"/>
    </Parameters>
    </BC4JDataControl>
    New syntax:
    <BC4JDataControl id="BaseTablesAMDataControl"
    Package="com.xxx.model.system"
    FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl"
    SupportsTransactions="true" SupportsFindMode="true"
    SupportsRangesize="true" SupportsResetState="true"
    SupportsSortCollection="true"
    Configuration="BaseTablesAMLocal" syncMode="Immediate"
    ExceptionMode="Immediate"
    xmlns="http://xmlns.oracle.com/adfm/datacontrol"/>
    Tip:
    Do this editing outside JDev with ide closed to avoid crashing it.
    Regards
    Fred

  • [Bug: JClient tree binding] Workaround for 'random' collapsing of branches

    Hi all.. For those of you who have been bothered by a bug in the JClient tree binding model regarding (seemingly) random collapsing of branches, I have a small workaround which may brighten your day. I know it brightened mine. :)
    Anyways, here's my situation:
    - A JTree with a master VO ("MasterView", for the top) and a detail VO ("DetailView", for the 'body'), recursively bound.
    - A JComboBox bound to a VO ("TopsView" or whatever), which is used to 'select a tree'
    - When a the currency of TopsView is changed, the selected row's ID is used to build a new tree. I use my own simple synchronizing mechanism, so I can do some additional checks. I suppose you could make MasterView a detail of TopsView, but that's not really important.
    masterView.setWhereClause("ID = " + selID);
    masterView.executeQuery();At this point, the tree will automatically be rebuilt.
    However, based on my experiences, I figure that this is not really the way the JDev guys pictured how I'd work because there's a pretty huge bug which at some point pretty much makes the tree useless (or 'act weird' to say the least).
    Here's a description of how to reproduce the bug and some of my observations. I will refer to the collection of currently displayed nodes/records as 'tree'.
    1. When you first expand certain branches in the current tree, all goes well. No problems.
    2. Next, you use the JComboBox to select another tree. (The new tree will appear totally collapsed.)
    3. At this point, you will also be expanding branches 'in that tree', 'for the first time'.
    4. After that, you switch back to the first tree.
    5. Now it becomes interesting: when you expand ANY branch that you previously expanded in this tree, the bug will surface (details will follow). When you expand branches that you DID NOT expand during your last visit to this tree, all goes well -- no problems.
    Note that re-expanding a branch after manually collapsing it, does not cause the bug. The key is that you expand a branch for the first time during a 'visit' to this tree (ie, so that it has to gather it's child nodes).
    Details about the bug:
    - The problem surfaces when expanding certain branches. (See above.)
    - Effects will vary from collapsing different branches under the same parent node to collapsing the entire tree.
    - The selection in the JTree component (or its selection model, if you will) will also be canceled.
    Observations:
    - It seems that JClient was not designed to handle multiple trees (as described above). It appears that, before the newly selected tree is built, the old tree has not been properly cleaned up. By this I mean the collection of JUTreeNodeBinding objects, which continue to refer to DefaultMutableTreeNodeBinding objects of the destroyed tree. In effect, these orphaned objects continue to work their magic in the background and will influence the JTree and its associated objects in a way so that this problem (and possibly others) surfaces.
    The workaround I will present below is designed to suppress this problem. It does not deal with orphaned objects in a proper way, it will merely partially suppress their functionality.
    How to suppress the bug:
    - In case you haven't done so already, you have to copy the source file of oracle.jbo.uicli.jui.JUTreeNodeBinding into your project directory and then make small modification to it.
    - On line 482 (if I'm not mistaken), you will see //if (al.size() > 0) Change it to if (!(mTreeNode.getParent() == null && getParent() != null)) Now the enclosed code will only be executed when the tree is fully synchronized (as in: the 'tree' of JUTreeNodeBinding objects has the same structure as the 'current tree' of DefaultMutableTreeNodeBinding objects).
    In a nutshell, it checks whether the parents of this JUTreeNodeBinding object and the associated DefaultMutableTreeNode object are not null. Because in case it concerns an 'orphaned' JUTreeNodeBinding object, the parent of its associated DefaultMutableTreeNode object will be null. However, in case it concerns the tree's root node, both parents will be null, in which case this condition will have to evaluate to true as well.
    I hope that this information will be of use to others :) and that possibly someone of the JDev team could comment on this matter. Thanks.

    One question though. What exactly do you mean by 'copy
    the source file of
    oracle.jbo.uicli.jui.JUTreeNodeBinding into your
    project directory'.. would I need to change the package
    name of this binding, and modify the client code
    somewhere to have it use my modified version? Or will
    it use this local copy instead of the original one?The simplest way to go is to create a new (empty) class in your project, which is to be located in the package "oracle.jbo.uicli.jui", and name it "JUTreeNodeBinding". Next, open the source of the original JUTreeNodeBinding class and copy-paste it into your newly created class in JDeveloper.
    Now, when you run your application, it will use your 'custom' version of JUTreeNodeBinding, while it will function exactly the same. You can make any modifications, like the one I suggested in my original post, in this class.
    Good luck.

  • TreeSelectionListener

    A question about the TreeSelectionListener. I was having trouble adding the interface to my app, and after reading one of the examples under the JTree tutorials, I tried adding an import statement for TreeSelectionListener, along with TreeSelectionEvent, which fixed the problem. My question is, why is that necessary? I've never had to import a listener interface or event class before today, with ActionListener or MouseListener or any of the other commonly used interfaces. Thx.

    That is probably just a fluke that you have never had to do this. Listener classes and interfaces are usually in different packages so you always will have to import those packages.
    Bryan

  • VO OK in JClient but not in AM tester: Missing IN or OUT?

    Hi,
    JDEv 10.1.2.
    I have a ViewObject with bind variables that I set at the beginning of the ViewObjectImpl.executeQuery() method.
    In my jClient application I get no error but in AM tester it shows:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT SiteEventType.SITE_EVENT_TYPE_ID,
    SiteEventType.SITE_ID,
    SiteEventType.EVENT_TYPE,
    SiteEventType.IS_WITH_BOOK,
    SiteEventType.EVENT_INIT_PERIOD,
    SiteEventType.EVENT_EXTENSION_PERIOD, NVL(SiteEventTypeLang.NAME_LANG,SiteEventType.NAME) AS NVL_NAME, NVL(SiteEventTypeLang.DESCRIPTION_LANG,SiteEventType.DESCRIPTION) AS NVL_DESCRIPTION,
    SiteEventType.MAX_EXTRA_ALBUMS,
    SiteEventType.MAX_PHOTOS,
    SiteEventType.STATUS,
    SiteEventType.IS_LOCKED,
    SiteEventType.T_CREATED,
    SiteEventType.NAME,
    SiteEventType.DESCRIPTION,
    SiteEventTypeLang.NAME_LANG,
    SiteEventTypeLang.DESCRIPTION_LANG,
    SiteEventTypeLang.SITE_EVENT_TYPE_ID AS SITE_EVENT_TYPE_ID1,
    SiteEventTypeLang.LANG_ID
    FROM SITE_EVENT_TYPE SiteEventType, SITE_EVENT_TYPE_LANG SiteEventTypeLang
    WHERE (SiteEventType.SITE_ID = :1 AND SiteEventTypeLang.SITE_EVENT_TYPE_ID (+) = SiteEventType.SITE_EVENT_TYPE_ID AND SiteEventTypeLang.LANG_ID (+) = :2)) QRSLT ORDER BY "SITE_EVENT_TYPE_ID"
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:774)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:547)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3422)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:663)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:617)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2593)
         at oracle.jbo.server.ViewRowSetIteratorImpl.hasNext(ViewRowSetIteratorImpl.java:1741)
         at oracle.jbo.server.ViewRowSetImpl.hasNext(ViewRowSetImpl.java:2648)
         at oracle.jbo.server.ViewObjectImpl.hasNext(ViewObjectImpl.java:5446)
         at oracle.jbo.jbotester.NavBar.resetButtons(NavBar.java:476)
         at oracle.jbo.jbotester.NavBar.setIterator(NavBar.java:153)
         at oracle.jbo.jbotester.SimpleForm.setIterator(SimpleForm.java:56)
         at oracle.jbo.jbotester.SimpleForm.<init>(SimpleForm.java:50)
         at oracle.jbo.jbotester.VOTreeNode.showForm(VOTreeNode.java:112)
         at oracle.jbo.jbotester.BaseTree.processTreeMouseClicked(BaseTree.java:387)
         at oracle.jbo.jbotester.BaseTree.access$5000171(BaseTree.java:46)
         at oracle.jbo.jbotester.BaseTree$TreeMouseListener.mouseClicked(BaseTree.java:494)
         at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212)
         at java.awt.Component.processMouseEvent(Component.java:5103)
         at java.awt.Component.processEvent(Component.java:4897)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3207)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
         at java.awt.Container.dispatchEventImpl(Container.java:1613)
         at java.awt.Window.dispatchEventImpl(Window.java:1606)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    ## Detail 0 ##
    java.sql.SQLException: Missing IN or OUT parameter at index:: 1
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:161)
         at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1535)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2879)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2925)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:691)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:547)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3422)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:663)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:617)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2593)
         at oracle.jbo.server.ViewRowSetIteratorImpl.hasNext(ViewRowSetIteratorImpl.java:1741)
         at oracle.jbo.server.ViewRowSetImpl.hasNext(ViewRowSetImpl.java:2648)
         at oracle.jbo.server.ViewObjectImpl.hasNext(ViewObjectImpl.java:5446)
         at oracle.jbo.jbotester.NavBar.resetButtons(NavBar.java:476)
         at oracle.jbo.jbotester.NavBar.setIterator(NavBar.java:153)
         at oracle.jbo.jbotester.SimpleForm.setIterator(SimpleForm.java:56)
         at oracle.jbo.jbotester.SimpleForm.<init>(SimpleForm.java:50)
         at oracle.jbo.jbotester.VOTreeNode.showForm(VOTreeNode.java:112)
         at oracle.jbo.jbotester.BaseTree.processTreeMouseClicked(BaseTree.java:387)
         at oracle.jbo.jbotester.BaseTree.access$5000171(BaseTree.java:46)
         at oracle.jbo.jbotester.BaseTree$TreeMouseListener.mouseClicked(BaseTree.java:494)
         at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212)
         at java.awt.Component.processMouseEvent(Component.java:5103)
         at java.awt.Component.processEvent(Component.java:4897)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3207)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
         at java.awt.Container.dispatchEventImpl(Container.java:1613)
         at java.awt.Window.dispatchEventImpl(Window.java:1606)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    ----- LEVEL 1: DETAIL 0 -----
    java.sql.SQLException: Missing IN or OUT parameter at index:: 1
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:161)
         at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1535)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2879)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2925)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:691)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:547)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3422)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:663)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:617)
         at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2593)
         at oracle.jbo.server.ViewRowSetIteratorImpl.hasNext(ViewRowSetIteratorImpl.java:1741)
         at oracle.jbo.server.ViewRowSetImpl.hasNext(ViewRowSetImpl.java:2648)
         at oracle.jbo.server.ViewObjectImpl.hasNext(ViewObjectImpl.java:5446)
         at oracle.jbo.jbotester.NavBar.resetButtons(NavBar.java:476)
         at oracle.jbo.jbotester.NavBar.setIterator(NavBar.java:153)
         at oracle.jbo.jbotester.SimpleForm.setIterator(SimpleForm.java:56)
         at oracle.jbo.jbotester.SimpleForm.<init>(SimpleForm.java:50)
         at oracle.jbo.jbotester.VOTreeNode.showForm(VOTreeNode.java:112)
         at oracle.jbo.jbotester.BaseTree.processTreeMouseClicked(BaseTree.java:387)
         at oracle.jbo.jbotester.BaseTree.access$5000171(BaseTree.java:46)
         at oracle.jbo.jbotester.BaseTree$TreeMouseListener.mouseClicked(BaseTree.java:494)
         at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212)
         at java.awt.Component.processMouseEvent(Component.java:5103)
         at java.awt.Component.processEvent(Component.java:4897)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3207)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
         at java.awt.Container.dispatchEventImpl(Container.java:1613)
         at java.awt.Window.dispatchEventImpl(Window.java:1606)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    I have a small question on the "Oracle Style" of binding variables.
    In the where clause I used :1 and :2
    But in my code in order to set :1 I used setWhereClauseParam(0,...)
    and to set :2 I wrote setWhereClauseParam(1,...)
    So the numbers :1, :2 are not indexes but the process order to set their values, which always starts with 0,1,etc
    Thanks for your clarications.
    Frederic

    Your overridden executeQuery() is the method will be invoked only if client code specifically invokes the executeQuery() method. There are many ways that a view object's query could get executed that would not go through that method.
    For example, calling first() on a VO that's never been executed would cause the query to be executed but that won't explicitly execute the executeQuery() method.
    You want the executeQueryForCollection() method instead.
    See this article for some tips...
    http://radio.weblogs.com/0118231/stories/2004/10/07/providingDefaultValuesForViewObjectBindVariables.html

  • JBO DebugOutput Question

    We're having some trouble with our views auto-querying when we attempt to add a new row. It's a JClient app that doesn't initially query any rows. We turned on jbo.debugoutput=console to get more information on the problem. Now we have a couple of questions on what some of the debug messages mean. The entries below were generated when we brought the form up and went into Find mode. Here is a snippet from the console:
    [751] Changing iterator range size from :1 to :1000
    [752] Column count: 13
    [753] ViewObject: PaymentTermsView Created new QUERY statement
    [754] PaymentTermsView>#q computed SQLStmtBufLen: 999, actual=982, storing=1012
    [755] SELECT * FROM (SELECT PaymentTerms.PAYMENT_TERM,
           PaymentTerms.LAWSON_TERM_CODE,
           PaymentTerms.DESCRIPTION,
           PaymentTerms.IP_TERM_CODE,
           PaymentTerms.DISCOUNT_PCT,
           PaymentTerms.DISCOUNT_DAYS,
           PaymentTerms.NET_DAYS,
           PaymentTerms.ACTIVE_FLAG,
           PaymentTerms.CREATE_SOURCE,
           PaymentTerms.CREATE_DATE,
           PaymentTerms.LAST_UPDATE_SOURCE,
           PaymentTerms.LAST_UPDATE_DATE,
            PaymentTerms.PAYMENT_TERM as SORTED
    FROM PAYMENT_TERMS PaymentTerms
    WHERE PaymentTerms.ACTIVE_FLAG = 1
    union all
    SELECT null as PAYMENT_TERM,
           null as LAWSON_TERM_CODE,
           null as DESCRIPTION,
           null as IP_TERM_CODE,
           null as DISCOUNT_PCT,
           null as DISCOUNT_DAYS,
           null as NET_DAYS,
           null as ACTIVE_FLAG,
           null as CREATE_SOURCE,
           null as CREATE_DATE,
           null as LAST_UPDATE_SOURCE,
           null as LAST_UPDATE_DATE,
            -1 as SORTED
    FROM dual) QRSLT  ORDER BY SORTED asc
    [757] Bind params for ViewObject: PaymentTermsView
    [758] EntityCache:add WARNING - ignoring row with no primary key
    [759] $$added root$$ id=-2
    [760] EntityRowSetImpl's jbo.assoc.consistent = true (1) This query is used as the lookup for a Combobox binding and we need a blank row to provide a null selection, so that is the reason for the union.
    What we are most curious about is what the meaning of lines 758, 759, and 760 is.
    I suspect that line 758 is caused by the unioned null row since it wouldn't have a valid primary key.
    Also, I would expect that line 759 might be ADF creating a row in the Entity cache for the null row and attempting to generate a temp id if the primary key was an attribute type of DbSequence, but that isn't the case here.
    Line 760 seems to be enforcing/setting the association consistency property for the view, but most of the other views don't have this entry. Seems like it might have been due to the Entity the view is based on having a Composition Association to another Entity, but that isn't the case for this view.
    Any help understanding these entries would be greatly appreciated.
    Thanks
    Erik

    After further review, I have discovered that line 760 does indeed correlate to the Composition setting of the Association. It also appears to come in the beginning when setting up the view's query, so it actually goes with the next view in our log, which does have a Composition Association.
    Also, I believe my assessment of line 758 is correct in that it is caused by the null row. This could explain why we have noticed that the trick of including a queried null row doesn't always work for some comboboxes. In some cases the null row still doesn't show in the list. Now, I believe that this is because those Views are based on an Entity. The Entity most contain the primary key for a row in order to cache it. For the null row, there is no valid primary key, so the cache ignores it. This would mean that the combobox wouldn't show the null row, because it doesn't get it back from the Entity cache. For the comboboxes based on Views that are ViewOnly, they would show the null row because the View cache has no requirement for a valid primary key. This is only speculation at this point. I'll try and confirm.
    If the above answers are correct, then we really only need clarification on what line 759 means.
    Erik

Maybe you are looking for