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);
}
Similar Messages
-
How to Populate the JTable Object programatically with SQL Results
I'm wondering if someone could help me on how to populate the JTable Object with SQL Results wherein the Row of tjhe JTable object is automatically adjusted depending on how many records you have queried.
Thanks in advance and God bless! (",)
* frmMain.java
* Created on October 4, 2006, 6:15 AM
package tds;
import java.io.*;
import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.imageio.*;
import javax.swing.JFrame;
import java.sql.*;
import javax.swing.table.DefaultTableModel;
* @author Dexter.Carlit
public class frmMain extends javax.swing.JFrame {
private Connection connection = null;
private DefaultTableModel model;
/** Creates new form frmMain */
public frmMain() {
initComponents();
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
jSplitPane = new javax.swing.JSplitPane();
jScrollPane1 = new javax.swing.JScrollPane();
jPanel3 = new javax.swing.JPanel();
jScrollPane2 = new javax.swing.JScrollPane();
jTree1 = new javax.swing.JTree();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
jPanel4 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jTextField3 = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jTextField4 = new javax.swing.JTextField();
jPanel5 = new javax.swing.JPanel();
jScrollPane3 = new javax.swing.JScrollPane();
jGrid = new javax.swing.JTable();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jProgressBar1 = new javax.swing.JProgressBar();
jPanel2 = new javax.swing.JPanel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
getAccessibleContext().setAccessibleName("frmMain");
jSplitPane.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
jSplitPane.setDividerLocation(200);
jSplitPane.setDividerSize(10);
jScrollPane2.setViewportView(jTree1);
org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel3Layout.createSequentialGroup()
.add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 916, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 410, Short.MAX_VALUE)
jScrollPane1.setViewportView(jPanel3);
jSplitPane.setLeftComponent(jScrollPane1);
jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
jLabel1.setText("First Name:");
jLabel2.setText("Last Name:");
jLabel3.setText("Position :");
jLabel4.setText("Department:");
jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Search Results"));
jGrid.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
new String [] {
"LName", "FName", "Position", "Department", "Office No", "Local No", "Office Mobile No", "Home No", "MobileNo", "Email Address"
jGrid.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
jGrid.setColumnSelectionAllowed(true);
jGrid.setName("");
jGrid.setTableHeader(jGrid.getTableHeader());
jScrollPane3.setViewportView(jGrid);
jScrollPane3.getAccessibleContext().setAccessibleName("rset");
org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 386, Short.MAX_VALUE)
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
jButton1.setText("Find");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton1MouseClicked(evt);
jButton2.setText("Clear");
jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton2MouseClicked(evt);
org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
.add(jLabel1)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE))
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
.add(jLabel2)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextField2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)
.add(1, 1, 1))
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
.add(jLabel3)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextField3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jLabel4)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jTextField4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE))
.add(jPanel4Layout.createSequentialGroup()
.add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
jPanel4Layout.linkSize(new java.awt.Component[] {jButton1, jButton2}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel1)
.add(jTextField1))
.add(18, 18, 18)
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel2)
.add(jTextField2))
.add(16, 16, 16)
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel3)
.add(jTextField3)
.add(jLabel4)
.add(jTextField4))
.add(14, 14, 14)
.add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jButton2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(jButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, jProgressBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 438, Short.MAX_VALUE))
.addContainerGap())
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.add(jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jProgressBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
jTabbedPane1.addTab("Search", jPanel1);
org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 458, Short.MAX_VALUE)
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 401, Short.MAX_VALUE)
jTabbedPane1.addTab("Directory", jPanel2);
jSplitPane.setRightComponent(jTabbedPane1);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jSplitPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 675, Short.MAX_VALUE)
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jSplitPane)
pack();
}// </editor-fold>//GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked
jGrid.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null, null, null, null, null, null, null},
{null, null, null, null, null, null, null, null, null, null},
{null, null, null, null, null, null, null, null, null, null},
{null, null, null, null, null, null, null, null, null, null}
new String [] {
"LName", "FName", "Position", "Department", "Office No", "Local No", "Office Mobile No", "Home No", "MobileNo", "Email Address"
jGrid.updateUI();
}//GEN-LAST:event_jButton2MouseClicked
private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
try {
//Load and register SQL Server driver
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
//Establish a connection
Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://X.X.X.X:1433","MyAccount","MyPassword");
//Create a Statement object
Statement sql_stmt = connection.createStatement();
//Create a ResultSet object, execute the query and return a
// resultset
ResultSet rset = sql_stmt.executeQuery("SELECT * FROM EpxDirectory..Directory Order By LName");
// Populates a JTABLE Object
int i=0;
while (rset.next()){
String LName = rset.getString(1);
String FName = rset.getString(2);
String Position = rset.getString(3);
String Dept_Code = rset.getString(4);
String OffPhoneNo = rset.getString(5);
String LocalNo = rset.getString(6);
String OffMobileNo = rset.getString(7);
String HomePhoneNo = rset.getString(8);
String MobileNo = rset.getString(9);
String Email = rset.getString(10);
jGrid.updateUI();
jGrid.setValueAt(rset.getString(1).trim(),i,0);
jGrid.setValueAt(rset.getString(2).trim(),i,1);
jGrid.setValueAt(rset.getString(3).trim(),i,2);
jGrid.setValueAt(rset.getString(4).trim(),i,3);
jGrid.setValueAt(rset.getString(5).trim(),i,4);
jGrid.setValueAt(rset.getString(6).trim(),i,5);
jGrid.setValueAt(rset.getString(7).trim(),i,6);
jGrid.setValueAt(rset.getString(8).trim(),i,7);
jGrid.setValueAt(rset.getString(9).trim(),i,8);
jGrid.setValueAt(rset.getString(10).trim(),i,9);
i++;
//Close the ResultSet and Statement
rset.close();
sql_stmt.close();
//Close the database connection
connection.close();
System.out.println(Integer.toString(i) + " rows found");
} catch(Exception e) {
System.out.println("Failed to connect; Please view Stack Trace");
e.printStackTrace();
}//GEN-LAST:event_jButton1MouseClicked
private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
}//GEN-LAST:event_formWindowOpened
public static void run(){
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
frmMain frmMain = new frmMain();
frmMain.setLocationRelativeTo(null); // Center the JFrame on the
frmMain.setVisible(true);
private void exitApplication() {
// try {
// //gui.putStatus("Closing the connection....please wait.....");
// if(connection != null) {
// // connection.close(); //Closing the connection object.
// } catch(SQLException ex) { //Trap SQLException
// //gui.putStatus(ex.toString());
System.exit(0); //Exit the aplication
* @param args the command line arguments
public static void main(String args[]) {
run();
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JTable jGrid;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JProgressBar jProgressBar1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JSplitPane jSplitPane;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
private javax.swing.JTree jTree1;
// End of variables declaration//GEN-END:variables
}Use code tags.
Don't mix GUI and JDBC together. Split them out into separate classes.
You have a good start, but you will need to loop through your resultset and also pull the ResultSet metaData for you column headings -
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 -
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 -
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...
DaniloHi 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 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
ThanksInserting 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. -
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 muchthank 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. -
How to Use Transient View Objects to Store Session-level Global Variables
hi
Please consider section "40.8.5 How to Use Transient View Objects to Store Session-level Global Variables"
at http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcstatemgmt.htm#ADFFD19610
Based on this documentation I created the example application
at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.01.zip
It behaves as show in the screencast at http://screencast.com/t/qDvSQCgpvYdd
Its Application Module has a Transient View Object instance "MyEmployeesContextVOVI", as master for the child View Object instance "EmpInCtxJobVI".
On rollback the Transient View Object instance keeps its row and attribute values.
Also when passivation and activation is forced (using jbo.ampool.doampooling=false ) the Transient View Object instance seems to keep its row and attribute values.
questions:
- (q1) Why does the expression #{bindings.MyEmployeesContextVOVIIterator.dataControl.transactionDirty} evaluate as true when a Transient View Object instance attribute value is changed (as shown in screencast at http://screencast.com/t/qDvSQCgpvYdd )?
- (q2) What would be a robust approach to make a Transient View Object instance more self-contained, and manage itself to have only one single row (per instance) at all times (and as such removing the dependency on the Application Module prepareSession() as documented in "5. Create an empty row in the view object when a new user begins using the application module.")?
many thanks
Jan VerveckenThanks for your reply Frank.
q1) Does sample 90 help ? http://blogs.oracle.com/smuenchadf/examples/
Yes, the sample from Steve Muench does help, "90. Avoiding Dirtying the ADF Model Transaction When Transient Attributes are Set [10.1.3] "
at http://blogs.oracle.com/smuenchadf/examples/#90
It does point out a difference in marking transactions dirty by different layers of the framework, "... When any attribute's value is changed through an ADFM binding, the ADFM-layer transaction is marked as dirty. ...".
This can be illustrate with a small change in the example application
at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.02.zip
It now shows the result of both these expressions on the page ...
#{bindings.MyEmployeesContextVOVIIterator.dataControl.transactionDirty}
#{bindings.MyEmployeesContextVOVIIterator.dataControl.dataProvider.transaction.dirty}... where one can be true and the other false respectively.
See also the screencast at http://screencast.com/t/k8vgNqdKgD
Similar to the sample from Steve Muench, another modification to the example application introduces MyCustomADFBCDataControl
at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.03.zip
public class MyCustomADFBCDataControl
extends JUApplication
@Override
public void setTransactionModified()
ApplicationModule vApplicationModule = (ApplicationModule)getDataProvider();
Transaction vTransaction = vApplicationModule.getTransaction();
if (vTransaction.isDirty())
super.setTransactionModified();
}Resulting in what seems to be more consistent/expected transaction (dirty) information,
see also the screencast at http://screencast.com/t/756yCs1L1
Any feedback on why the ADF Model layer is so eager to mark a transaction dirty is always welcome.
Currently, question (q2) remains.
regards
Jan -
How to create a view object and attach with extended AM
Hi,
I tried to create new vo and attach this vo with the extended AM. But it is throwing error like 'PC.NAME : invalid identifier' (Actually this PC.NAME is exiting one).
Now i want to know how to create a view object similar like seeded one but with one additional condition in the where clause.
It is possible though extension, but i want to create two view object similar like seeded one, one with some other condition in the where clause
and another one with some other condition.
So for my requirement, i'll extend one VO and i'll add my condition but how to do it for second condition.
But i want same seeded VO with two different condition.
Any suggestions please,
SANSAN,
There is no need to attach the newly created VO with extended AM. You need to attach the same with the standard AM.
Regards,
Gyan -
How to retrieve the java object in a proxy service in osb -- Plz help
Hi all,
I have a singleton java class which runs whenever the weblogic server gets started and store the output in its object. I need to access this java object from a proxy service in osb.
We tried using java call out and retrieved that object but we couldn't know how to parse that object into XML.
We are not sure of using the java call out in osb to solve this purpose because whenever we use a java callout, that particular java code will run which is not the case of singleton class.
So kindly help us how to retrieve the java object which holds the output without running the java code every time because its already run and holding the output in its object.
Regards
Prabhuhere the doc http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#wp1106656
but I guess you are already at the stage of getting a POJO in a first Java Callout and passing the POJO to a second Java Callout, which should then return it to OSB as a XMLObject.
My recommendation is to write a Java function which returns a XMLObject and uses a XMLCursor to populate it with the values of the POJO.
An XMLObject returned to the OSB is automatically transformed in a "XML" variable (which in reality is represented as a XMLObject in the Pipeline context)
Here some code sample:
http://www.javamonamour.org/2010/09/how-to-create-xmlobject-using-xmlcursor.html -
How to populate the Quering data into Excel sheet in Oracle
Dear Guys,
How to populate the Quering data into Excel sheet in oracle.
Please provide a solution.
Thanks & Regards,
Senthil K KumarHi
To make Excel sheets from sqlplus, you can use the markup html tag in sqlplus.
Here's an example.
Example
<code>
SET LINESIZE 4000
SET VERIFY OFF
SET FEEDBACK OFF
SET PAGESIZE 999
SET MARKUP HTML ON ENTMAP ON SPOOL ON PREFORMAT OFF
SPOOL c:\test_xls.xls
SELECT object_type
, SUBSTR( object_name, 1, 30 ) object
, created
, last_ddl_time
, status
FROM user_objects
ORDER BY 1, 2
SPOOL OFF
SET MARKUP HTML OFF ENTMAP OFF SPOOL OFF PREFORMAT ON
SET LINESIZE 2000 VERIFY ON FEEDBACK ON
</code> -
How to Populate the Dropdown from the xml file ?
Hi,
According to my requirement, Drop down has to be populated in a form, on selecting an element in the first drop down list, corresponding second drop down values has to be loaded dynamically.
I am using the ReferenceData file, which consists of the Dropdown list values in the form of Key,Value pair. I can able to populate one drop down,but I don't know how to populate the second dropdown dynamically.
can any one please help me to finish this task.Thanxs john.
My requirement is onChange of a value from the first drop down, particular values needs to load in the second drop down. Values that needs to pull are designed in XML Object as Map entries Key,Pair Values.
I already did all the things, what you have told.But,I don't know How to populate the second drop down, and where to write the condition.
If u don't mind can u send me the sample code to check the condition. -
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 NelsonBy 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 -
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
BalamohanHi 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
Maybe you are looking for
-
want to download itunes 10.6 and not 10.7 because my comp doesn't support yet, where can I download 10.6 still?
-
Restriction Password frequency isn't highlighted to change
On both of my children's iPod touch 5 under settings general restrictions require password (it's not highlighted for change) we are all going bonkers having to enter in a unique over 8 character with capitals and numbers password EVERY SINGLE TIME...
-
Other people cant view my profile
when other people try and view my profile their computers get messed up and they get signed off, is there anyway i can stop that?
-
WebLogic/Metro interop policy assertions
Hi, I'm merging Glassfish-Metro WS-policies into the WebLogic 10.3.1 server as part of a migration project. I call the web services with a Metro 2.0.1 client to verify that everything still works in WLS. My original policies contain the following ass
-
Table Name : Where OFFSET_TAX_CODE is Present
HI Team, Based on the OFFSET_TAX_CODE_ID i want to get the OFFSET_TAX_CODE. In which table : OFFSET_TAX_CODE is present ?