Issue in attaching dynamic Query to the View Object

Hi,
We are having a View Object attached to the JRAD page.
The View object is build thru as Expert mode. There is no any CDATA
SQLQUERY stored in the VO.xml file.
We are building the query dynamically and attaching it to the VO in
RUNTIME.
The code is as below
// getFcstQuery() is method used to return the dynamic query
String query = getFcstQuery();
// Setting the Query to View Object
getViewDef().setQuery(query);
setQuery(query);
The JRAD page has sorting option on 5 columns. so when a sorting is
done the data are interchanged between the clients.
For example how the query will be build id
Say for the first user the query will be as
"select ename,eno,dno from emp where eno=1 "
for the second user the query may be
"select ename,eno,dno from emp where eno=2 "
Now if both the user hit the sorting on any of the column the data is
interchagned between this both users.
Please provide solution if possible.
Thanks in advance
Balamohan

Hi Steve,
We are using 5 tables in building the query.
Say,
1) summary
2) transactions
3) transactions_history
4) rules
5) rules_temp
but only 2 tables are used at a time
for read only we are using
summary table
for edit only mode we are using
1) transactions and
2) rules
tables
for edit and recalculate mode we are using
1) transactions and
2) rules_temp
tables
for one more condition we are using
1) transactions_history and
2) rules
tables
From all the above combination we are getting 5 columns. All the columns are defined the above combination tables. So using the same region. based on the conditions the combination of tables will change.
Becoz of this we are building the query dynamically.
Thanks
Balamohan

Similar Messages

  • Changing the query on a view object

    I have a view object right now, based on an entity. It is the default view object, so that means the query in the view object is straight forward, it grabs all of the attributes from the table. And there is no WHERE clause.
    In reality I only want to show a finite set of rows from my table. Every time a record is changed/edited in this entity and committed, a new row in the database is created with the same information (I'm using CreateWithParams) except for a few columns.
    I actually don't really have update on this table, just creation of new rows. But to the user, I want it to 'look' like they are editing something in the table.
    Example:
    12, 11:32,Thompson, 60 (the user edits this information in an adf table, and a new row is created in the db)
    12, 11:55, Thompson, 75
    I have a timestamp (see above) field in the database that is used as part of my primary key, so that I know which record is the latest.
    When the VO query is run, I want the user to only see the latest row from the db.
    12, 11:55, Thompson, 75
    So...
    I went to my VO, and I changed the WHERE query to add this:
    where t1.TimeStamp = (Select MAX(t2.TimeStamp) FROM rcl.x t2 where t1.uid = t2.uid);
    Now, this isn't a mysql/sql question. There's actually a better query that I'd rather run, but the VO editor doesn't allow me to change the query itself....
    When I save the new WHERE to my VO, run my page again, I get the expected result (showing me only the latest records).
    However, when I try and sort on the table in which my data is displayed, I am now getting ORDER BY errors.
    I don't want my VO to be read-only sql based. I want to be able to update my table, so I have my VO running off of the entity.
    Why doesn't the VO allow me to change the query itself? (Like do a subquery, instead of having my where clause do the work)
    Why are order by errors being thrown when I sort on my adf table after changing the where clause in my view?
    Hopefully I wasn't too convoluted in the explanation of my problem..
    Thanks in advance,
    Joel

    HI Joe,
    Regarding your problem you can do one of the following tasks:
    1- easily to tuning on your view object, I mean in the tuning page of the view you can set that only return 1 record or 2-3 record fetch not all the record.
    in the order by you will order by the timestamp field and descending.
    2- you can order by the timestamp descending and in the where clause only set the rownum<2 (will return the last record) you can also set rownum<5 and get the 4 last record etc.
    3-editing the view query in the expert mode is not advised at all because of many consequences that you will face.
    4- maybe it is not bat that you add a readonly view for the table you mentioned and every time you unpdate the entity just re-execute the read-only view.( this method maybe is good maybe is not it depends on your business logic)
    Regards.
    Edited by: Amir Khanof on Sep 3, 2010 11:11 PM

  • Passing an argument in the SQL Query of a View Object

    Hi,
    It is possible that this question has been asked before, however I have searched for a half an hour in the forums and couldn't find a solution.
    I am also new to using JDeveloper and ADF. Here's the situation:
    I am developing an application that doesn't have to do anything else then displaying data from a database. Pretty straightforward actually.
    Now I have made a vew pages with several collapsible panels (af:showDetailHeader) and have setup the datasources (or so I thought).
    All that remains is:
    - drag & drop a view object, from the application module that I created, onto the collabsible panels, so a child element gets created which displays data from the database.
    - hack the layout so it looks like I want it to.
    The problem that I have is the following:
    I am using a 'User'-class that contains values I need when quering the database.
    That User-object is part of a user-session.
    What I want, for example, is to use the 'getPersonId()' function of that User-object and pass the argument to a SQL-query of a certain view-object.
    The query would become something like:
    'SELECT * FROM people WHERE people.personId = :someNumber'.
    Now I've read some stuff about variable binding, which is complemented by something like (backing bean code):
    getDBTransaction().getRootApplicationModule().getACertainViewObject().setWhereClauseParameter(1, user.getPersonId());
    The examples I have found that might match my wishes are not using business components, but EJB's. I am having difficulty with understanding the 'how'-part of variable binding.
    Also, I do not know enough of ADF to be able to create a situation like:
    'User loads page, collapsible panel 1 is fully shown, the others are undisclosed.'
    (meaning, that for panel1 a query has been executed.)
    'User clicks on collapsible panel 2 which triggers a backingbean that somehow retrieves data from a view object'.
    I would appreciate any help that somebody can give.
    If it is not too much of a problem, please provide code snippets in case you have a solution. I am new to ADF :(.
    -edit
    I am using JDeveloper 10.1.3.3.0 in case that is of any importance.
    Message was edited by:
    Hugo Boog

    Hello Stijn,
    I didn't think about a referenced bean rule in the faces-config.
    I added it right away and I am now able to set parameters of a View-object, not using a page button and before the page loads. You made my day!
    In case anyone ever reads this post again, the summary of how to generate a table based on a View-object using dynamic parameters.:
    1a: Go to faces-config.xml -> Overview tab'
    1b: Go to the menuitem "Referenced Beans"
    1c: Click on 'new' and select the existing bean you want to access data from and input a name. In this example I use name="user"
    2: Create a View-object using the wizard.
    2a: Specify the query you want in the menuitem 'SQL Statement'.
    Add the 'parameters' you want to. You will have something like:
    "SELECT * FROM someTable WHERE table.columnname LIKE :someArgument".
    - hint: if you want the result to become something like:
    "SELECT * FROM someTable WHERE table.columnname LIKE '%someArgument%'" then you have to add the '%'-characters in your code itself (read: someClass.setParameter("%" + someArgument);).
    2b: In the menuitem 'Bind Variables' you have to add the variables you are referring to in the query. If you look at the query in 2a, then you have to add a variable with name "someArgument".
    2c: Add the View-object to a Application Module (create one if nessecairy).
    3a: Open a .jsp(x) file. Drag the View-object created in step 2 from the 'Data Controls'-pane to the page.
    3b: Click on the '+' of the View-object in the 'Data Controls'-pane and open 'Operations' and drag 'ExecuteWithParams' to your page as a button.
    3c: We do not want to use a button, the action has to be executed immediatly. So In the page source remove the lines that were created after dropping 'ExecuteWithParams'.
    3d: Right-click on the page and select "Go to Page Definition".
    3e: Go to the action id that is called 'ExecuteWithParams#', where # is a number.
    Change the id to something useful.
    3f: Change the NDValue so it corresponds with the value you want.
    Example:
    <action id="getAddressData" IterBinding="AddressesView1Iterator"
    InstanceName="MyHRServiceModuleDataControl.AddressView1"
    DataControl="MyHRServiceModuleDataControl" RequiresUpdateModel="true" Action="95">
    <NamedData NDName="someArgument" NDType="java.lang.String"
    NDValue="#{user.personId}"/>
    </action>
    Note: It is possible to use the value of a Backing Bean in NDValue.
    Note 2: user is the bean I referred to in the faces-config.xml!
    3g: Under the executables item, add an 'invokeAction' to pass the parameter to the View-object before your JSP-file loads:
    <executables>
    <invokeAction Binds="getAddressData"
    id="loadAddressDataOfPersonIdInSession"
    Refresh="prepareModel"/>
    Thank Stijn Haus for this :)

  • How to add a new table or view in the view object

    hello,every one.
    I wanna add a new table or view in the view object's query statement.
    when the table or view not in the where clause,the query statement is working fine.
    If they in the where clause,I got the "java.lang.NullPointerException".
    who can help me
    thank you very much

    thank you for your reply
    I wanna extend the VO
    oracle.apps.pay.selfservice.payslip.US.server.PayPayslipGetPersonDetail
    the original sql is:
    SELECT ppf.person_id,
    FROM per_people_f ppf,
    per_assignments_f paf,
    pay_assignment_actions paa
    where paa.assignment_action_id = :1 AND paf.assignment_id = paa.assignment_id AND SYSDATE BETWEEN paf.effective_start_date AND paf.effective_end_date AND paf.person_id = ppf.person_id
    I wanna extend:
    SELECT ppf.person_id, pay_v.element_name,pay_v.assignment_action_id
    FROM per_people_f ppf,
    per_assignments_f paf,
    pay_assignment_actions paa,
    pay_run_results_v pay_v
    where paa.assignment_action_id = :1 AND paf.assignment_id = paa.assignment_id AND SYSDATE BETWEEN paf.effective_start_date AND paf.effective_end_date AND paf.person_id = ppf.person_id
    pay_v.assignment_action_id =paa.assignment_action_id
    if the pay.v in the where clause. I will got the exception. whereas,it's works fine.

  • RowSetInfo; bc4j; how to get the View Object

    So I'm trying to get/update/insert/delete records in a database that contain an interMedia image in a blob.
    I've figured out that I can't simply set the ImmediateAccess attribute. It doesn't like that...
    So I'm trying to go after the view object, since the interMedia white paper uses a VO row setAttribute to accomplish the write.
    RowSetInfo extends ResultSetInfo which has a method getViewObject(). Cool.
    So I try it... and get an error that getViewObject() has protected access.
    Anyone know what I am doing wrong? Or should I be even taking this approach?!?!?!
    If I go exclusively with the VO layer... how do I preserve the navigationBar functionality? Or do I need to roll my own?
    ( NOTE: This hilights another example of the perception of 'friction' between rowsetinfos and the view objects/entity objects. An approach that makes "sense" to me as a naive novice didn't pan out. And oddly, most of the bc4j examples go against VOs when, if you are an application programmer, you may never see or use the VO methods ( although it looks like we should be)... we're working at the ResultSetInfo layer. )
    Is the the observation of other folk who are building Java Applications/Applets? Or do you all work directly with VOs instead of going through the ResultSetInfo "layer"?

    Here is some sample code that I am currently working on and will post on OTN when complete. The code shows how to access a BC4J Domain based on an Oracle type. Working with interMedia is similar since interMedia utilizes Oracle Object types. Please note that I have not tested this yet against interMedia, but I'm hoping that you may find the general process useful.
    // Copyright (c) 2000 Oracle Corporation
    package ObjectSampleDAC;
    import oracle.dacf.control.swing.*;
    import javax.swing.*;
    import oracle.dacf.dataset.*;
    import oracle.dacf.dataset.connections.*;
    import java.awt.*;
    import oracle.jdeveloper.layout.*;
    import java.awt.event.*;
    import javax.infobus.*;
    import oracle.jbo.domain.DomainInterface;
    import ObjectSampleBC4J.common.TAddress;
    import java.sql.SQLException;
    * A Frame class.
    * <P>
    * @author Scott Tiger
    public class Frame1 extends InfoFrame {
    * Constructs a new instance.
    public Frame1() {
    super();
    try {
    jbInit();
    sessionInfo1.publishSession();
    // call my initialization method
    bfInit();
    catch (Exception e) {
    e.printStackTrace();
    * Initializes the state of this instance.
    private void jbInit() throws Exception {
    /* All of the following code in this method was added by the designer except where noted below
    EmailrowSetInfo1.setName("Email");
    jPanel3.setLayout(gridBagLayout1);
    StatusrowSetInfo1.setName("Status");
    AddressrowSetInfo1.setName("Address");
    PasswordrowSetInfo1.setName("Password");
    UsernamerowSetInfo1.setName("Username");
    LastnamerowSetInfo1.setName("Lastname");
    FirstnamerowSetInfo1.setName("Firstname");
    IdrowSetInfo1.setName("Id");
    rowSetInfo1.setAttributeInfo( new AttributeInfo[] {
    IdrowSetInfo1,
    FirstnamerowSetInfo1,
    LastnamerowSetInfo1,
    UsernamerowSetInfo1,
    PasswordrowSetInfo1,
    AddressrowSetInfo1,
    StatusrowSetInfo1,
    EmailrowSetInfo1} );
    this.setDataItemName("infobus:/oracle/sessionInfo1");
    this.setTitle("Customer Information");
    this.getContentPane().setLayout(borderLayout1);
    this.setSize(new Dimension(536, 473));
    jPanel1.setLayout(borderLayout2);
    sessionInfo1.setAppModuleInfo(new ModuleInfo("ObjectSampleBC4J", "ObjectSampleBC4JModule"));
    sessionInfo1.setConnectionInfo(new LocalConnection("MyJdbcConn"));
    sessionInfo1.setName("sessionInfo1");
    rowSetInfo1.setQueryInfo(new QueryViewInfo(
    "CustomerView",
    rowSetInfo1.setSession(sessionInfo1);
    rowSetInfo1.setName("rowSetInfo1");
    /* The following listener was added using the event tab in the property inspector in design
    mode. The rowsetPopulated method is called when the rowset is queried/requeried.
    rowSetInfo1.addChangeListener(new oracle.dacf.dataset.ChangeAdapter() {
    public void rowsetPopulated(RowSetChangeEvent e) {
    rowSetInfo1_rowsetPopulated(e);
    textFieldControl1.setText("textFieldControl1");
    textFieldControl2.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1/Firstname");
    textFieldControl2.setText("textFieldControl2");
    textFieldControl3.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1/Lastname");
    textFieldControl3.setText("textFieldControl3");
    textFieldControl4.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1/Username");
    textFieldControl4.setText("textFieldControl4");
    textFieldControl5.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1/Password");
    textFieldControl5.setText("textFieldControl5");
    textFieldControl6.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1/Status");
    textFieldControl6.setText("textFieldControl6");
    textFieldControl7.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1/Email");
    textFieldControl7.setText("textFieldControl7");
    navigationBar1.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1");
    jLabel1.setText("ID:");
    jLabel2.setText("First Name:");
    jLabel3.setText("Last Name:");
    jLabel4.setText("User Name:");
    jLabel5.setText("Password:");
    jLabel6.setText("Status:");
    jLabel7.setText("Email:");
    jLabel8.setText("Address:");
    jPanel4.setLayout(      gridBagLayout2);
    textFieldStreet.setColumns(20);
    textFieldStreet.setText("textFieldStreet");
    /* The following listener (as well as the listeners on textFieldCity, textFieldState, and
    textFieldZipcode were added by the designer, but the focusGained and focusLost methods
    were modified in each case to call a common textField_focusGained method
    textFieldStreet.addFocusListener(new java.awt.event.FocusAdapter() {
    public void focusGained(FocusEvent e) {
    textField_focusGained(e);
    public void focusLost(FocusEvent e) {
    textField_focusLost(e);
    textFieldCity.setColumns(20);
    textFieldCity.setText("textFieldCity");
    textFieldCity.addFocusListener(new java.awt.event.FocusAdapter() {
    public void focusGained(FocusEvent e) {
    textField_focusGained(e);
    public void focusLost(FocusEvent e) {
    textField_focusLost(e);
    textFieldState.setColumns(20);
    textFieldState.setText("textFieldState");
    textFieldState.addFocusListener(new java.awt.event.FocusAdapter() {
    public void focusGained(FocusEvent e) {
    textField_focusGained(e);
    public void focusLost(FocusEvent e) {
    textField_focusLost(e);
    textFieldZipcode.setColumns(20);
    textFieldZipcode.setText("textFieldZipcode");
    textFieldZipcode.addFocusListener(new java.awt.event.FocusAdapter() {
    public void focusGained(FocusEvent e) {
    textField_focusGained(e);
    public void focusLost(FocusEvent e) {
    textField_focusLost(e);
    jLabel9.setText("Street:");
    jLabel10.setText("City:");
    jLabel11.setText("State:");
    jLabel12.setText("Zip Code:");
    textFieldControl1.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1/Id");
    this.getContentPane().add(jPanel1, BorderLayout.CENTER);
    jPanel1.add(jPanel2, BorderLayout.NORTH);
    jPanel2.add(navigationBar1, null);
    jPanel1.add(jPanel3, BorderLayout.CENTER);
    jPanel3.add(textFieldControl1, new GridBagConstraints2(1, 0, 1, 1, 1.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(37, 11, 0, 0), 0, 0));
    jPanel3.add(textFieldControl2, new GridBagConstraints2(1, 1, 1, 1, 1.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(7, 11, 0, 0), 0, 0));
    jPanel3.add(textFieldControl3, new GridBagConstraints2(1, 2, 1, 1, 1.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(7, 11, 0, 0), 0, 0));
    jPanel3.add(textFieldControl4, new GridBagConstraints2(1, 3, 1, 1, 1.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(6, 11, 0, 0), 0, 0));
    jPanel3.add(textFieldControl5, new GridBagConstraints2(1, 4, 1, 1, 1.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(6, 11, 0, 0), 0, 0));
    jPanel3.add(textFieldControl6, new GridBagConstraints2(1, 5, 1, 1, 1.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(7, 11, 0, 0), 0, 0));
    jPanel3.add(textFieldControl7, new GridBagConstraints2(1, 6, 1, 1, 1.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(6, 11, 0, 0), 0, 0));
    jPanel3.add(jLabel1, new GridBagConstraints2(0, 0, 1, 1, 0.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(37, 106, 0, 0), 0, 0));
    jPanel3.add(jLabel2, new GridBagConstraints2(0, 1, 1, 1, 0.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(8, 54, 0, 0), 0, 0));
    jPanel3.add(jLabel3, new GridBagConstraints2(0, 2, 1, 1, 0.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(8, 54, 0, 0), 0, 0));
    jPanel3.add(jLabel4, new GridBagConstraints2(0, 3, 1, 1, 0.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(10, 54, 0, 0), 0, 0));
    jPanel3.add(jLabel5, new GridBagConstraints2(0, 4, 1, 1, 0.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(8, 62, 0, 0), 0, 0));
    jPanel3.add(jLabel6, new GridBagConstraints2(0, 5, 1, 1, 0.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(9, 83, 0, 0), 0, 0));
    jPanel3.add(jLabel7, new GridBagConstraints2(0, 6, 1, 1, 0.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(9, 86, 0, 0), 0, 0));
    jPanel3.add(jLabel8, new GridBagConstraints2(0, 7, 1, 1, 0.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(7, 72, 94, 0), 0, 0));
    jPanel3.add(jPanel4, new GridBagConstraints2(1, 7, 1, 1, 0.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
    jPanel4.add(textFieldZipcode, new GridBagConstraints2(1, 3, 1, 1, 0.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 10, 0, 0), 0, 0));
    jPanel4.add(textFieldState, new GridBagConstraints2(1, 2, 1, 1, 0.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 10, 0, 0), 0, 0));
    jPanel4.add(jLabel9, new GridBagConstraints2(0, 0, 1, 1, 0.0, 0.0,
    GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 0, 0, 0), 0, 0));
    jPanel4.add(textFieldStreet, new GridBagConstraints2(1, 0, 1, 1, 0.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 10, 0, 0), 0, 0));
    jPanel4.add(jLabel10, new GridBagConstraints2(0, 1, 1, 1, 0.0, 0.0,
    GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 0, 0, 0), 0, 0));
    jPanel4.add(jLabel11, new GridBagConstraints2(0, 2, 1, 1, 0.0, 0.0,
    GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 0, 0, 0), 0, 0));
    jPanel4.add(jLabel12, new GridBagConstraints2(0, 3, 1, 1, 0.0, 0.0,
    GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 0, 0, 0), 0, 0));
    jPanel4.add(textFieldCity, new GridBagConstraints2(1, 1, 1, 1, 0.0, 0.0,
    GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 10, 0, 0), 0, 0));
    /* The following vaiable declarations were made by the designer
    BorderLayout borderLayout1 = new BorderLayout();
    JPanel jPanel1 = new JPanel();
    SessionInfo sessionInfo1 = new SessionInfo();
    RowSetInfo rowSetInfo1 = new RowSetInfo();
    AttributeInfo IdrowSetInfo1 = new AttributeInfo(java.sql.Types.NUMERIC);
    AttributeInfo FirstnamerowSetInfo1 = new AttributeInfo(java.sql.Types.VARCHAR);
    AttributeInfo LastnamerowSetInfo1 = new AttributeInfo(java.sql.Types.VARCHAR);
    AttributeInfo UsernamerowSetInfo1 = new AttributeInfo(java.sql.Types.VARCHAR);
    AttributeInfo PasswordrowSetInfo1 = new AttributeInfo(java.sql.Types.VARCHAR);
    AttributeInfo AddressrowSetInfo1 = new AttributeInfo();
    AttributeInfo StatusrowSetInfo1 = new AttributeInfo(java.sql.Types.VARCHAR);
    AttributeInfo EmailrowSetInfo1 = new AttributeInfo(java.sql.Types.VARCHAR);
    JPanel jPanel2 = new JPanel();
    JPanel jPanel3 = new JPanel();
    TextFieldControl textFieldControl1 = new TextFieldControl();
    TextFieldControl textFieldControl2 = new TextFieldControl();
    TextFieldControl textFieldControl3 = new TextFieldControl();
    TextFieldControl textFieldControl4 = new TextFieldControl();
    TextFieldControl textFieldControl5 = new TextFieldControl();
    TextFieldControl textFieldControl6 = new TextFieldControl();
    TextFieldControl textFieldControl7 = new TextFieldControl();
    BorderLayout borderLayout2 = new BorderLayout();
    NavigationBar navigationBar1 = new NavigationBar();
    JLabel jLabel1 = new JLabel();
    JLabel jLabel2 = new JLabel();
    JLabel jLabel3 = new JLabel();
    JLabel jLabel4 = new JLabel();
    JLabel jLabel5 = new JLabel();
    JLabel jLabel6 = new JLabel();
    JLabel jLabel7 = new JLabel();
    JLabel jLabel8 = new JLabel();
    GridBagLayout gridBagLayout1 = new GridBagLayout();
    JPanel jPanel4 = new JPanel();
    JTextField textFieldStreet = new JTextField();
    JTextField textFieldCity = new JTextField();
    JTextField textFieldState = new JTextField();
    JTextField textFieldZipcode = new JTextField();
    JLabel jLabel9 = new JLabel();
    JLabel jLabel10 = new JLabel();
    JLabel jLabel11 = new JLabel();
    JLabel jLabel12 = new JLabel();
    GridBagLayout gridBagLayout2 = new GridBagLayout();
    /* The following declarations were made manually
    /* DomainAccess provides a means for getting and setting values of a column object as domain
    DomainAccess da = null;
    /* TAddress is the domain class
    TAddress addr = null;
    /* Declare variables for determining if JTextField values have been changed by user
    String oldVal = null;
    String newVal = null;
    /* The following method is generated by the wizard when the frame was created
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSED) {
    System.exit(0);
    public void bfInit () throws Exception {
    /* To add code to be invoked when the user moves from one row to another, get the
    DataItemChangeManager from the RowSetInfo (via RowsetAccess) and add a
    DataItemChangeListener. The specific method we want to use here is rowsetCursorMoved
    which is invoked when the user moves from one row to another; the other methods are
    defined simply because the interface requires them.
    RowsetAccess ra = rowSetInfo1.getRowsetAccess();
    DataItemChangeManager dcm = (DataItemChangeManager)ra;
    dcm.addDataItemChangeListener(new DataItemChangeListener() {
    public void rowsetCursorMoved(RowsetCursorMovedEvent e) {
    rowSetInfo1_rowsetCursorMoved(e);
    public void dataItemAdded(DataItemAddedEvent e) {
    public void dataItemDeleted(DataItemDeletedEvent e) {
    public void dataItemRevoked(DataItemRevokedEvent e) {
    public void dataItemValueChanged(DataItemValueChangedEvent e) {
    /* This method was generated by the designer. See rowSetInfo1.addChangeListener(...) in jbInit
    above.
    void rowSetInfo1_rowsetPopulated(RowSetChangeEvent e) {
    try {
    /* When the rowset is populated, set the JTextField values based on the domain. See
    updateFields() below.
    updateFields();
    catch (Exception ex) {
    System.out.println("Error occurred while retrieving values");
    ex.printStackTrace();
    /* This method was added manually to track row navigation. See dcm.addDataItemChangeListener(...)
    in jbInit above.
    void rowSetInfo1_rowsetCursorMoved(RowsetCursorMovedEvent e) {
    try {
    /* When the user moves from one row to another, set the JTextField values based on the
    domain. See updateFields() below.
    updateFields();
    catch (Exception ex) {
    System.out.println("Error occured while assigning values");
    ex.printStackTrace();
    /* This method finds the values from each field of the column object by using the domain, then
    sets the values of the JTextFields respectively. It is invoked when the rowset is initially
    populated, and each time the user moves from one row to another.
    public void updateFields () throws Exception {
    /* Get DataItem for the Address column object and cast to DomainAccess for to prepare for
    getting and setting column value as domain.
    da = (DomainAccess)AddressrowSetInfo1.getImmediateAccess();
    /* Get the value of the attribute as a Domain and cast to DomainInterface.
    DomainInterface di = da.getValueAsDomain();
    /* null out addr. Otherwise, if the address column is null for a particular record, when
    the user navigates to the record with the null values, addr will retain the previous record's
    values. This ensures a clean slate.
    addr = null;
    /* Using DomainInterface allows us to cast the domain object to the specific Domain class for
    that type. So, cast the address attribute's value to TAddress, the class that
    represents the T_ADDRESS type created in the database. This provides getters and setters
    for each of the fields of the Object Type.
    if ( di instanceof TAddress ) {
    addr = (TAddress) di;
    /* If the above statement resulted in some non-null object assigned to addr, it is because
    one or more of the fields of the domain contained non-null values. Therefore, if addr is
    not null, get the values from each field of the domain and assign them to their
    respective JTextFields. Otherwise, set each JTextField to an empty string.
    if (addr != null) {
    textFieldStreet.setText(addr.getStreet());
    textFieldCity.setText(addr.getCity());
    textFieldState.setText(addr.getState());
    textFieldZipcode.setText(addr.getZipcode());
    else {
    textFieldStreet.setText("");
    textFieldCity.setText("");
    textFieldState.setText("");
    textFieldZipcode.setText("");
    /* If addr is null, after making sure the JTextFields are cleared, create a new TAddress
    object so that we have something to assign values to if the user edits the JTextFields.
    try {
    addr = new TAddress();
    catch (SQLException ex) {
    System.out.println("Error creating domain TAddress");
    ex.printStackTrace();
    /* The method below is invoked when the user navigates to textFieldStreet, textFieldCity,
    textFieldState, or textFieldZipcode. It's used just to find the value of the field when
    the user enters the field (the "before" value).
    void textField_focusGained(FocusEvent e) {
    Object obj = e.getSource();
    if (obj instanceof JTextField) {
    JTextField field = (JTextField)obj;
    oldVal = field.getText();
    /* The method below is invoked when the user navigates away from textFieldStreet, textFieldCity,
    textFieldState, or textFieldZipcode. It checks to see if the user changes the value of the
    field, and if so, updates the value of the address attribute.
    void textField_focusLost(FocusEvent e) {
    /* Find out the value of the JTextField now that the user is attempting to leave the field.
    Object obj = e.getSource();
    if (obj instanceof JTextField) {
    JTextField field = (JTextField)obj;
    newVal = field.getText();
    /* Compare the new value of the field ("after" value) to the "before" value captured
    in textField_focusGained above. If they are equal, we do nothing. If they are not equal,
    then the user must have changes the value in the field, and we have some work to do.
    if (!oldVal.equals(newVal)) {
    /* Since this same method is called regardless of which JTextField has been left, we find
    out which text field the user is leaving, and then set the value of the appropriate
    element of the addr domain.
    if (obj.equals(textFieldStreet)) {
    addr.setStreet(newVal);
    if (obj.equals(textFieldCity)) {
    addr.setCity(newVal);
    if (obj.equals(textFieldState)) {
    addr.setState(newVal);
    if (obj.equals(textFieldZipcode)) {
    addr.setZipcode(newVal);
    /* So, we've set the value of the appropriate element of the addr domain, but we have not
    "posted" those changes to the BC4J (middle-tier), so if we were to commit at this point
    our changes would not get saved to the database (because BC4J is not aware of these
    changes). The next step is to notify BC4J of the changes.
    try {
    da.setValueAsDomain(addr);
    catch (InvalidDataException ex) {
    System.out.println("Invalid Data assigned to TAddress");
    ex.printStackTrace();
    /* Clear out the oldVal and newVal variable so we are ready to track more changes.
    oldVal = null;
    newVal = null;
    }-- Brian

  • Issue with ADF Table bound to a View Object Iterator??

    Can anyone say what would prevent an ADF table bound to a View Object Iterator from displaying all the records retrieved by the View Object Query?
    I ran the query directly from sqlplus and it returned 21 rows, However when i use the same exact query in my view object and display the result in a ADF table, only 10 rows are retrieved and displayed in the table ?
    Help .. Please ???

    The ADF table is actually set to use 'Include Range Navigation' and to display 20 rows each time. However, only a 10 rows are retrieved and displayed and the other 10 rows are displayed as blanks with only the Table selection radio buttons in the Select Column.
    e.g.
    Select Data1 Data 2
    o xxxxxx xxxxxx
    o xxxxxx xxxxxx
    o
    o
    o
    o
    The four 'o' are blanks even though there is data to be displayed.

  • Keep the record in the view object if deletion failed.

    I have a view object which is based on the entity object, when I am trying to delete a row it failed because it has a child record associate with. I know the row is not delete from the database, but the record is deleted fromt the view.
    How to keep the record in the View object if delete failed?

    Hi,
    the row is not delete from the database,refresh the view . re-execute query and the view show the row

  • Replace default table sort with order by on the view object

    The Jdeveloper help for af:table says:
    If the underlying model is not a CollectionModel , the Table automatically examines the actual data to determine which properties are sortable. Any column that has data that implements java.lang.Comparable is sortable. This automatic support cannot be nearly as efficient as coding sorting directly into a CollectionModel (for instance, by translating the sort into an "ORDER BY" SQL clause), but is sufficient for small data sets.
    I have a database table with varchar2 columns that can contain string, date or number values. So in the af:table I want to sort the columns either in string, date or number order.
    I tried creating a sort listener and in that listener set the view object order by clause and execute the query, but it does not affect the row order - it is always sorted as a string. I assume that the collection is doing its sort after I do the query, and overwriting the query order. I have tried disabling the sort in the listener by setting the sortcriteria to null but it has no effect.
    Can anyone suggest how to stop the default sort re-ordering the rows, or else how to code sorting directly into the CollectionModel as suggested in the help.
    Hugh Nelson

    By running in debug I discovered that when you click on a column heading to sort by the column values it actually sets the order by clause on the view object and executes a query. The help says that the default sorting is not as efficient as setting the order by clause - perhaps the help is out of date because default sorting does set the order by clause.
    This means that you cannot do a column sort on a transient attribute. The attribute being sorted on must exist in the table/query.
    The easiest solution is to override the setOrderByClause method on the view object. The string parameter is the column to order by eg "COLUMNA". If this column holds date values I can change it to something like "TO_CHAR(TO_DATE(COLUMNA,'DD-MON-YYYY'),'YYYYMMDD')". For numbers I do "LPAD(COLUMNA,10,'0')".
    This works OK.
    Hugh Nelson

  • How to set Where clause in the View Object of the MessageChoice ?

    Hi,
    How to set Where clause in the View Object of the
    MessageChoice ?
    Example:
    <bc4j:rootAppModuleDef name="EdEscolaCampusView1AppModule"
    definition="ed00050.Ed00050Module"
    releaseMode="stateful" >
    <bc4j:viewObjectDef name="EdEscolaCampusView1" >
    <bc4j:rowDef name="CreateEdEscolaCampusView1" autoCreate="true" >
    <bc4j:propertyKey name="key" />
    </bc4j:rowDef>
    </bc4j:viewObjectDef>
    <bc4j:viewObjectDef name="ListaTipLocalView1"
    rangeSize="9999">
    </bc4j:viewObjectDef>
    </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    messageChoice declaration:
    <bc4j:messageChoice name="SeqTipoLocalCampus"
    attrName="SeqTipoLocalCampus"
    prompt="Local do Campus">
    <contents>
    <bc4j:optionList attrName="SeqTipoBasico"
    textAttrName="NomTipoBasico"
    voName="ListaTipLocalView1"/>
    </contents>
    </bc4j:messageChoice>
    I would like set where clause of ViewObject, with dinamic parameters (using attribute1 = :1), before populate messageChoice.
    thanks...
    Danilo

    Hi Andy,
    I try set a where clause using the message:
    Set where Clause parameter using UIX , but my UIX Page have 2 messageChoice's of different ViewObject's, then I need implement this Java Class:
    //Nome da Package da Tela Detail
    package br.com.siadem.siaed.ed00050;
    // Importa as Bibliotecas necessárias
    import oracle.jbo.ViewObject;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.client.Configuration;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.servlet.event.PageEvent;
    import oracle.cabo.servlet.event.EventResult;
    import oracle.cabo.data.jbo.servlet.bind.*;
    import oracle.cabo.ui.data.BoundValue;
    import oracle.cabo.ui.data.DataBoundValue;
    import javax.servlet.http.HttpServletRequest;
    import br.com.siadem.siaed.util.*;
    import javax.servlet.http.Cookie;
    import oracle.cabo.data.jbo.def.NestedAppModuleDef;
    import oracle.cabo.data.jbo.def.ViewObjectDef;
    import oracle.cabo.data.jbo.def.AppModuleDef;
    // Classe que configura os parametros para a execução da Query,
    // utilizando variáveis de Sessao
    public class FunPreQueryLista
    public static EventResult FunConfiguraQuery(BajaContext context, Page page, PageEvent event) throws Throwable
    // TrataDadosSessao - Classe utilizada para retornar os valores das variáveis de sessão genéricas
    // Ex: CodCliente, CodMunicipio etc...
    TrataDadosSessao varDadosSessao = new TrataDadosSessao();
    // 1o. Parametro Configurado - Através da classe TrataDadosSessao, utilizando um método Get
    // <alterar>
    String valor1 = varDadosSessao.getCodCliente();
    String valor2 = varDadosSessao.getCodMunicipio();
    //Cria o objeto que retorna o ApplicationModule
    ApplicationModule am = ServletBindingUtils.getApplicationModule(context);
    // Início das Configurações da Query da Lista
    //Cria o objeto que retorna o view object da lista desejada
    //alterar
    ViewObject TipoLocal = am.findViewObject("ListaTipoLocalView1");
    //Configuração dos parametros definidos na query do view Object
    //alterar
    TipoLocal.setWhereClauseParam(0,valor1);
    TipoLocal.setWhereClauseParam(1,valor2);
    // Executa a Query
    TipoLocal.executeQuery();
    // Fim das Configurações da Query da Lista
    // Início das Configurações da Query da Lista
    //Cria o objeto que retorna o view object da lista desejada
    //alterar
    ViewObject TipoDestLixo = am.findViewObject("ListaDestinoLixoView1");
    //Configuração dos parametros definidos na query do view Object
    //alterar
    TipoDestLixo.setWhereClauseParam(0,valor1);
    TipoDestLixo.setWhereClauseParam(1,valor2);
    // Executa a Query
    TipoDestLixo.executeQuery();
    // Fim das Configurações da Query da Lista
    // Retorna o Resultado para a Página
    return new EventResult(page);
    The code works very well...
    And, I'm sorry for my two repost's in UIX Forum about this in a few time.
    Thank very much...
    Danilo

  • How to get the view Object in UserDefined Action

    Hi  All,
       Any body tell me how to get the view object , like the view object avilable in the wdDoModifyView() method as parameter.
    I have requirement like, i want to change the , no of rows displaying in the table should be changed at the runtime based onthe no of rows  selected in the dropdown box.
    The action which i created will be assigned to that dropdown box, on select of the available option, i will get the view object and change the properties of the "maxrows" of the table .
    so for getting the view object in the  the Action methods tell me what is the procedure for getting the current view object.

    Hello Vishal,
    Simply create a value attribute (say rowCount) of type 'integer' and bind it to the 'visibleRowCount' property of your table. Then, in the actionHandler get the value from the UI element (in your case, I guess it is drop down) and set it to the attribute 'rowCount' like this.
    wdContext.currentContextElement.setRowCount(
        wdContext.current<nodeElement>.set<AttributeBound toDropDown>);
    Bala

  • How to populate the view object programetically

    Hi all,
    Is there any way to populate the records present in my backing bean. In my beacking Bean there is an array list how can i assign the array list values to the View Object.
    Thanks in Advance.,
    Mohan Krishna m.,

    It's something like this that are you finding ?
    populateViewObject(ViewObject vo, ArrayList<MyBean> arrayBean){
    Ror myRow = null;
    for(MyBean my : arrayBean){
    myRow = vo.createRow();
    myRow.setProperty("<PropertyName>", my.getPropertyName())
    //Another Properties ...
    vo.insertRow(myRow);
    }

  • Performance Issues due to Loading of ADF/JClient View Objects

    Hi,
    I developed a two-tier ADF/JClient application.
    When the ADF/JClient application opens for the first time, there's a big delay
    However opening it subsequently, takes less than half of the time to open the screen.
    I think it might the xml files of different view objects which the framework loads for the first time, and thus takes a lot of time. And after that, the time to open the application reduces.
    We have around 200 view objects in our application. Can this be the reason?
    If yes, then can we load the view objects before ahead, or can we just load them at the very time they are requested ?
    Thanks,
    Makrand Pare

    Hi Makrand,
    Check this out:
    "Limiting Fetching of Business Components Attributes in ADF Swing
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.developing_jclient_applications%7Cjui_plimitingfetching%7Ehtml/
    Note: In local mode deployment (the client and Business Components reside in the same VM), the fetching of attribute properties is not supported.
    You can optimize startup time for a Business Components client application and the remotely deployed Business Components by specifying the list of view object attributes that your client uses. If you create a project without the metadata, by coding to the API, you will want to add fetchAttributeProperties() to the bootstrap code of the client forms with a list of only the attributes used by the form. Without this method call, your client form would fetch all control hint properties (including the attributes format and label for example) for all the attributes of the named view objects in the application module, in a single network roundtrip.
    For example, when you do not intend to use all the attributes of the ADF Swing form's bound view object, with the fetchAttributeProperties() method, your ADF Swing form fetches only the information required to layout your forms, while ignoring the attributes you do not require.
    Note: In local mode deployment (the client and Business Components reside in the same VM), the fetching of attribute pro
    Calling fetchAttributeProperties() will prevent property methods such as getFormat() or getLabel() from being called on the Business Components attribute definition whenever the form is created."
    Vlad

  • How to Insert the row in the View object

    I want to insert the row in the view object by instantiating Impl.java file
    Could someone please let me know how to insert the blank row
    Thanks

    Inserting onto a view object should be done the following way:
    //vo is your view object
    Row aRow = vo.createRow();
    //Set your attributes
    aRow.setAttribute("AttributeName", objectValue);
    //insert
    vo.insertRow(aRow);
    That should work for you if you are programming the input. If you are using java components bound to columns in a view object then the input should be done automatically for you when you commit.

  • Can I operate the view object outside application module?

    I publish a Application Module into Oracle 8i Server. When I operate the view object in a class that published in Oracle 8i Server.
    It raise a remoteException. Can I operate the view object outside application module?

    Hi,
    The application module is the main point of contact for the ViewObject and EntityObject classes. It handles things like the connection pooling and other coordination aspects.
    You need to go through the app module to access the ViewObject class methods.

  • All the properties are not displying for the View Object

    i my one of the view Object it is only showing the properties
    Values
    Lable
    Render values
    I want to use text box (Input box )...but it is not showing in the property window
    why it is not showing the all the properties for the that view Object.
    Is it a read only view object ? if so then how to change it

    This question is confusing.
    You talk about properties, suggesting attribute properties are not showing up in the view object editor. Then you talk about a read-only view object, which suggests you talk about a running application?
    Normally a view object is updatable when it is based on an entity object and when on the entity object tab of the view object editor (the page in which you select the entity object) the updatable checkbox has been checked.
    But being updatable as such is not why attributes would not show up in a screen.
    Can you be more specific, and also tell us what JDeveloper version you are working with?
    Jan Kettenis

Maybe you are looking for

  • Where is the highlight pop up search gone?

    With the older version when you would hi lite a word on a web page, a box would pop up with a 1/2 " which included google and when you clicked on it, a new page of the item would pop up. It doesn't seem to work with beta 4 . CAN SOMEONE HELP ME FIND

  • New Process type:Is the previous run in the chain still active?

    Hi, Please provide details of the new process type Is the previous run in the chain still active? In SPS 12. Thanks in advance.

  • Button disolve transition

    I put together a simple DVD with one button pointing to a movie. I marked the disolve transition using the button info (inspector window). The resulting burn did not render the disolve - garbage breakup in the video. I changed to fade through black a

  • JProgressBar NullPointerException

    Hey all, I get this problem sometimes when using a JProgressBar in Indeterminate mode. Here is the stack trace. Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException         at javax.swing.plaf.basic.BasicProgressBarUI.updateSizes(Unk

  • How to use HTML in SQL

    hi guys,, i've a procedure to send emails to the employee,,, i want to format the text of the email ,, e.g i want to change the color of the employee name to be blue or any color,, Can i use an HTML code to do certain changes if NOT how can i do ?,,