Accessing components from Action, ActionListener

Our backend does not map well into a bean model. Rather than force it to fit, we have decided to skip the Update Model phase and instead read form inputs in Action/ActionListener classes, then persist. What is the preferred way to access nodes in the component tree? I was thinking something like:
  public void processAction(ActionEvent event)
       String s = NamingContainer.SEPARATOR_CHAR + "form01" + NamingContainer.SEPARATOR_CHAR  + "input 01";
       UIComponent source = event.getComponent();
       UIComponent result = source.findComponent(searchString);
       // persist result value 

I'm fond of using the "binding" attribute to force the component you're searching for to be available directly on the same object as the "actionListener" (which I'd implement using a method binding, rather than implementing ActionListener). I rather dislike findComponent().
-- Adam Winer (EG member)

Similar Messages

  • How to access components in a iview from program

    Hi,
        Can we access the iview components from program dynamically? I have a Table Control , i want to refresh it in my program.
        How to set Mandatory (*) mark for a label? Is there any property for that?
    Thanks,
    Sridhar

    If table is displayed in current view, it will be refreshed with most of the events(There are few exceptions) from that view. You don't need to do anything for that.
    Suppose You have one Input Fields - Inp, and Lable - Lb.
    From the label properties select "Label For" with Inp from DropDown menu. From properties of the inputfield change property "Status" to required.
    Now u would get required mandatory mark.
    Note that, selecting the status "Required" for inputfield only displays the asterisk. But it doesnt stop you from navigating to another view with out entering a value.

  • Can not access CRM from outside the office network - Access denied You do not have sufficient access rights or privileges to perform this action.

    Hi,
    I can not access CRM from outside the office network - Access denied You do not have sufficient access rights or privileges to perform this action.  I can access CRM with same user id and password from our office inside the network.  I can get
    the page to give login details once I have login details I got below error. Please help me to solve this issue.  It was working before.
    Access denied You do not have sufficient access rights or privileges to perform this action. 
    Regards,
    Noushad
    [email protected]

    On Premise system Configured with AD FS server for claims-based authentication you need to update your host file with server url to access it from outside office network.
    Refer
    this on how to update host file.
    Regards, Saad

  • Accessing components in a module from my applciation

    Hey all, I have this simple module:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Module xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" implements="fo_ImoduleInterface">
    <mx:Script>
    <![CDATA[
    import mx.controls.MenuBar;
    public function test():String {
    return "Test String";
    public function getMenuBar():Array {
    return myMenuBar.menus;
    ]]>
    </mx:Script>
    <mx:ApplicationControlBar dock="true" paddingTop="0"
    paddingBottom="0">
    <mx:MenuBar id="myMenuBar" labelField="@label">
    <mx:XMLList>
    <menuitem label="menu" >
    <menuitem label="sub 1" />
    <menuitem label="sub 1" />
    </menuitem>
    </mx:XMLList>
    </mx:MenuBar>
    </mx:ApplicationControlBar>
    </mx:Module>
    Now I want to access getMenuBar from my application to create
    a 'general' menu in my main application (much like what OSX does).
    I can successfully access the function test and get my test
    string back, so I know my module is loaded (I can see it on the
    screen to) but trying to get access to the component always fails.
    What is the proper solution to let my main application access
    a component in a module?
    Ries

    quote:
    Originally posted by:
    Sreenivas R
    The way I would do it would be to create a interface and add
    necessary APIs to it. Make the module implement the interface.
    In the main app convert the module instance to the interface
    and access things.
    Isn't this what the module does???
    see here : <mx:Module .....
    implements="fo_ImoduleInterface">
    fo_ImoduleInterface implements to correct function aswell,
    it's created like this:
    package
    import flash.events.IEventDispatcher;
    public interface fo_ImoduleInterface extends
    IEventDispatcher {
    function getMenuBar():Array;

  • Accessing tables from java

    I am creating an inventory system. I have used Java for front-end where i have created forms which display the vendor table, customer table, item table, order table, invoice tbl etc.
    I have created class files for each form that im displaying. i have also made connection to the oracle dbs succesfully. i can access data from the dbs.
    but my problem is,
    1)
    for instance i have created a vendor_master table in oracle with certain constraints like vendor_number can contain only 5 varchar2 characters ,
    eg.
    create table vendor_master
    (v_no varchar2(5) constraint v_no_pk primary key,
    v_name varchar2(25),
    v_add varchar2(15),
    city varchar2(15),
    st varchar2(15),
    zip number(10),
    tel number(11),
    fax number(11));
    now when i want 2 insert any row in the table i should be able 2 insert only "certain" characters of "certain" length depending on the constraints i have set. how do i do tht? coz java does not allow me 2 set the max chars like VB in the properties column
    i have my vendor Master class file here:
    code:--------------------------------------------------------------------------------
    package mainpage;
    import java.io.*;
    import java.io.Serializable;
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.String.*;
    import javax.swing.*;
    import javax.swing.JPanel;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import java.util.Vector;
    import oracle.jdbc.driver.OracleDriver;
    import oracle.jdbc.OracleResultSet;
    import java.sql.PreparedStatement;
    public class VendorMaster extends JPanel implements java.io.Serializable
    JFrame venMastFrame = new JFrame("Vendor Master");
    JLabel vennolbl = new JLabel();
    JLabel venNamelbl = new JLabel();
    JLabel venAdd = new JLabel();
    JTextField venAddtxt = new JTextField();
    JTextField venNotxt = new JTextField();
    JTextField venNmtxt = new JTextField();
    JLabel venCitylbl = new JLabel();
    JTextField venCitytxt = new JTextField();
    JLabel venStlbl = new JLabel();
    JTextField venSttxt = new JTextField();
    JLabel venZiplbl = new JLabel();
    JTextField venZiptxt = new JTextField();
    JLabel venTellbl = new JLabel();
    JTextField venTeltxt = new JTextField();
    JLabel venFaxlbl = new JLabel();
    JTextField venFaxtxt = new JTextField();
    JButton vPrevbtn = new JButton();
    JButton vNxtbtn = new JButton();
    JButton vExitbtn = new JButton();
    JButton vNewbtn = new JButton();
    JButton vDelbtn = new JButton();
    JButton vUpdtbtn = new JButton();
    JButton vSavebtn = new JButton();
    int currentIndex = 0;
    int totalRecords = 0;
    private Vector vendorMasterRecords = new Vector();
    public VendorMaster()
    venMastFrame.setSize(850,760);
    venMastFrame.setVisible(true);
    //venMastFrame.show();
    try
    jbInit();
    } catch (Exception e)
    e.printStackTrace();
    } // end of constructor
    private void jbInit() throws Exception
    Connection myConnection = DataManager.createConnection();
    vendorMasterRecords = loadVendorMasterRecords(myConnection);
    VendorMasterBean vmBean = null;
    venMastFrame.getContentPane().setLayout(null);
    if(vendorMasterRecords != null)
    {                 vmBean = (VendorMasterBean)vendorMasterRecords.elementAt(0);
    totalRecords = vendorMasterRecords.size();
    currentIndex = 0;
    if(vmBean == null)
    vmBean = new VendorMasterBean();
    venNamelbl.setText("Vendor Name:");
    venNamelbl.setBounds(new Rectangle(22, 87, 89, 23));
    venNmtxt.setBounds(new Rectangle(153, 81, 224, 22));
    venNmtxt.setEnabled(false);
    venNmtxt.setText(vmBean.getVendorName());
    venAdd.setText("Address:");
    venAdd.setBounds(new Rectangle(25, 130, 113, 31));
    venAddtxt.setBounds(new Rectangle(152, 126, 201, 22));
    venAddtxt.setEnabled(false);
    venAddtxt.setText(vmBean.getAddress());
    vennolbl.setText("Vendor No:");
    vennolbl.setBounds(new Rectangle(23, 41, 73, 22));
    venNotxt.setBounds(new Rectangle(155, 38, 108, 22));
    venNotxt.setEnabled(false);
    venNotxt.setText(vmBean.getVendorNumber());
    venCitylbl.setText("City:");
    venCitylbl.setBounds(new Rectangle(25, 175, 61, 29));
    venCitytxt.setBounds(new Rectangle(153, 172, 156, 24));
    venCitytxt.setEnabled(false);
    venCitytxt.setText(vmBean.getCity());
    venStlbl.setText("State:");
    venStlbl.setBounds(new Rectangle(25, 225, 64, 32));
    venSttxt.setBounds(new Rectangle(152, 223, 158, 24));
    venSttxt.setEnabled(false);
    venSttxt.setText(vmBean.getState());
    venZiplbl.setText("Zip:");
    venZiplbl.setBounds(new Rectangle(24, 275, 58, 24));
    venZiptxt.setBounds(new Rectangle(150, 272, 108, 24));
    venZiptxt.setEnabled(false);
    venZiptxt.setText(vmBean.getZipcode());
    venTellbl.setText("Telephone No:");
    venTellbl.setBounds(new Rectangle(25, 323, 106, 26));
    venTeltxt.setBounds(new Rectangle(149, 326, 108, 26));
    venTeltxt.setEnabled(false);
    venTeltxt.setText(vmBean.getTelephone());
    venFaxlbl.setText("Fax No:");
    venFaxlbl.setBounds(new Rectangle(27, 375, 97, 26));
    venFaxtxt.setBounds(new Rectangle(149, 375, 107, 26));
    venFaxtxt.setEnabled(false);
    venFaxtxt.setText(vmBean.getFax());
    /* code for buttons */
    vExitbtn.setBounds(new Rectangle(681, 457, 111, 29));
    vExitbtn.setText("EXIT");
    vExitbtn.addKeyListener(new VendorMaster_vExitbtn_keyAdapter(this));
    vExitbtn.addActionListener(new VendorMaster_vExitbtn_actionAdapter(this));
    vPrevbtn.setText("PREVIOUS");
    vPrevbtn.addKeyListener(new VendorMaster_vPrevbtn_keyAdapter(this));
    vPrevbtn.addActionListener(new VendorMaster_vPrevbtn_actionAdapter(this));
    vPrevbtn.setBounds(new Rectangle(14, 457, 110, 29));
    vPrevbtn.setEnabled(false);
    vNxtbtn.setText("NEXT");
    vNxtbtn.addKeyListener(new VendorMaster_vNxtbtn_keyAdapter(this));
    vNxtbtn.addActionListener(new VendorMaster_vNxtbtn_actionAdapter(this));
    vNxtbtn.setBounds(new Rectangle(124, 457, 111, 29));
    vNewbtn.setText("NEW");
    vNewbtn.setBounds(new Rectangle(235, 457, 111, 29));
    vNewbtn.setActionCommand("NEW");
    vNewbtn.addActionListener(new VendorMaster_vNewbtn_actionAdapter(this));
    vNewbtn.addKeyListener(new VendorMaster_vNewbtn_keyAdapter(this));
    vDelbtn.setText("DELETE");
    vDelbtn.setBounds(new Rectangle(346, 457, 111, 29));
    vDelbtn.setHorizontalAlignment(SwingConstants.CENTER);
    vDelbtn.addActionListener(new VendorMaster_vDelbtn_actionAdapter(this));
    vDelbtn.addKeyListener(new VendorMaster_vDelbtn_keyAdapter(this));
    vUpdtbtn.setText("UPDATE");
    vUpdtbtn.addActionListener(new VendorMaster_vUpdtbtn_actionAdapter(this));
    vUpdtbtn.setBounds(new Rectangle(457, 457, 113, 29));
    vUpdtbtn.setMaximumSize(new Dimension(71, 25));
    vUpdtbtn.setMinimumSize(new Dimension(71, 25));
    vUpdtbtn.setPreferredSize(new Dimension(71, 25));
    /* Add all the txtboxes, lbls and buttons to the frame */
    vSavebtn.setBounds(new Rectangle(570, 457, 111, 29));
    vSavebtn.setText("SAVE");
    vSavebtn.addActionListener(new VendorMaster_vSavebtn_actionAdapter(this));
    venMastFrame.getContentPane().add(vennolbl, null);
    venMastFrame.getContentPane().add(venNotxt, null);
    venMastFrame.getContentPane().add(venNamelbl, null);
    venMastFrame.getContentPane().add(venNmtxt, null);
    venMastFrame.getContentPane().add(venAdd, null);
    venMastFrame.getContentPane().add(venAddtxt, null);
    venMastFrame.getContentPane().add(venCitylbl, null);
    venMastFrame.getContentPane().add(venCitytxt, null);
    venMastFrame.getContentPane().add(venStlbl, null);
    venMastFrame.getContentPane().add(venSttxt, null);
    venMastFrame.getContentPane().add(venZiplbl, null);
    venMastFrame.getContentPane().add(venZiptxt, null);
    venMastFrame.getContentPane().add(venTellbl, null);
    venMastFrame.getContentPane().add(venTeltxt, null);
    venMastFrame.getContentPane().add(venFaxlbl, null);
    venMastFrame.getContentPane().add(venFaxtxt, null);
    venMastFrame.getContentPane().add(vPrevbtn, null);
    venMastFrame.getContentPane().add(vNxtbtn, null);
    venMastFrame.getContentPane().add(vNewbtn, null);
    venMastFrame.getContentPane().add(vDelbtn, null);
    venMastFrame.getContentPane().add(vUpdtbtn, null);
    venMastFrame.getContentPane().add(vSavebtn, null);
    venMastFrame.getContentPane().add(vExitbtn, null);
    } // end of jbinit
    public static void main(String[] args)
    VendorMaster vendorMaster1 = new VendorMaster();
    } //end of main
    /* this is where the data will be retrieved from the dbs */
    protected Vector loadVendorMasterRecords(Connection connection)
    //Connection connection = null;
    Vector masterRecords = new Vector();
    // From database getting values
    try
    //connection = connectionManager.getConnection();
    Statement stmt = connection.createStatement();
    String queryall = "Select * from vendor_master order by v_no";
    ResultSet rs = stmt.executeQuery(queryall);
    while (rs.next())
    String vendorNumber = rs.getString("v_no");
    String vendorName = rs.getString("v_name");
    String address = rs.getString("v_add");
    String city = rs.getString("city");
    String state = rs.getString("st");
    String zipCode = rs.getString("zip");
    String telephone = rs.getString("tel");
    String fax = rs.getString("fax");
    VendorMasterBean vendorMasterBean = new VendorMasterBean(vendorNumber,
    vendorName,
    address,
    city,
    state,
    zipCode,
    telephone,
    fax);
    /* data retrieved from the vendormasterbean is then inserted in vector*/
    masterRecords.addElement(vendorMasterBean);
    } // end of while
    } catch (Exception e) // end of try & start of catch
    e.printStackTrace();
    } // end of catch
    finally
    if(connection != null)
    DataManager.freeConnection(connection);
    return masterRecords; /* the data stored in
    masterRecords is passed 2 vendormasterRecords*/
    } // finally ends here
    } // end of loadvendorMasterrecords
    /*example- when previous button is pressed then an event is triggered
    captured by the key listener and then actionPerformed method is called
    which in turn calls the getPreviousRecord*/
    /* to insert records */
    protected void addVendorMasterRecord(VendorMasterBean vmBean )
    Connection connection = null;
    Vector masterRecords = new Vector();
    // first check whether all the textboxes are empty
    // also check whether there is already a record
    //existing with the same v_no
    // From database getting values
    try
    connection = DataManager.createConnection();
    PreparedStatement newRecord = connection.prepareStatement("insert into vendor_master values(?,?,?,?,?,?,?,?)");
    newRecord.setString(1,vmBean.getVendorNumber());
    newRecord.setString(2, vmBean.getVendorName());
    newRecord.setString(3, vmBean.getAddress());
    newRecord.setString(4, vmBean.getCity());
    newRecord.setString(5, vmBean.getState());
    newRecord.setString(6, vmBean.getZipcode());
    newRecord.setString(7, vmBean.getTelephone());
    newRecord.setString(8, vmBean.getFax());
    newRecord.executeUpdate();
    // Insert statement
    // PreparedStatement pStmt = ....;
    // The assign each value in the vmBean to the pStmt
    // and finally execute the pStmt
    } catch (Exception e) // end of try and begin of catch
    e.printStackTrace();
    } // end of catch
    finally
    if(connection != null)
    DataManager.freeConnection(connection);
    }// end of if
    } // end of finally
    } // end of addVendorMasterRecord
    void vNewbtn_actionPerformed(ActionEvent e)
    /* First empty all the textboxes */
    venNotxt.setText(" ");
    venNmtxt.setText(" ");
    venAddtxt.setText(" ");
    venCitytxt.setText(" ");
    venSttxt.setText(" ");
    venZiptxt.setText(" ");
    venTeltxt.setText(" ");
    venFaxtxt.setText(" ");
    venNotxt.setEnabled(true);
    venNmtxt.setEnabled(true);
    venAddtxt.setEnabled(true);
    venCitytxt.setEnabled(true);
    venSttxt.setEnabled(true);
    venZiptxt.setEnabled(true);
    venTeltxt.setEnabled(true);
    venFaxtxt.setEnabled(true);
    vPrevbtn.setEnabled(false);
    vNxtbtn.setEnabled(false);
    void vNewbtn_keyPressed(KeyEvent e)
    /* to delete records */
    protected void removeVendorMasterRecord(VendorMasterBean vmBean )
    Connection connection = null;
    Vector masterRecords = new Vector();
    // From database getting values
    try
    connection = DataManager.createConnection();
    PreparedStatement deleteRecord = connection.prepareStatement("delete from vendor_master where v_no = ?");
    deleteRecord.setString(1, vmBean.getVendorNumber());
    deleteRecord.executeUpdate();
    // Delete statement for where condition pass the vendor number as parameter
    //"delete from vendor_master where v_no = ?"
    //PreparedStatement pStmt = ....;
    // The assign v_no in the vmBean to the pStmt
    // and finally execute the pStmt
    } catch (Exception e)
    e.printStackTrace();
    finally
    // After executing this new record should be removed from the Vector of results.
    // uncomment this
    if(connection != null){
    DataManager.freeConnection(connection);
    } // end of finally
    } // end of removeVendorMasterRecord
    void vDelbtn_actionPerformed(ActionEvent e)
    String vendorNumber = venNotxt.getText();
    String vendorName = venNmtxt.getText();
    String address = venAddtxt.getText();
    String city = venCitytxt.getText();
    String state = venSttxt.getText();
    String zipCode = venZiptxt.getText();
    String telephone = venTeltxt.getText();
    String fax = venFaxtxt.getText();
    VendorMasterBean vmBean = new VendorMasterBean(vendorNumber,vendorName, address, city, state, zipCode, telephone, fax);
    removeVendorMasterRecord(vmBean);
    void vDelbtn_keyPressed(KeyEvent e)
    /* To get next record */
    protected VendorMasterBean getNextRecord()
    VendorMasterBean vmBean = new VendorMasterBean();
    if(currentIndex < totalRecords)
    vmBean =(VendorMasterBean)vendorMasterRecords.elementAt(++currentIndex);
    if(currentIndex == (totalRecords-1) )
    // reached last, so disable the Next button
    vNxtbtn.setEnabled(false);
    // enable the Previous
    vPrevbtn.setEnabled(true);
    } // end of if stmt
    } // end of outer if stmt
    return vmBean;
    } // end of getnextrecord
    void vNxtbtn_keyPressed(KeyEvent e)
    void vNxtbtn_actionPerformed(ActionEvent e)
    VendorMasterBean vmBean = getNextRecord();
    venNotxt.setText(vmBean.getVendorNumber());
    venNmtxt.setText(vmBean.getVendorName());
    venAddtxt.setText(vmBean.getAddress());
    venCitytxt.setText(vmBean.getCity());
    venSttxt.setText(vmBean.getState());
    venZiptxt.setText(vmBean.getZipcode());
    venTeltxt.setText(vmBean.getTelephone());
    venFaxtxt.setText(vmBean.getFax());
    /* to get previous record */
    protected VendorMasterBean getPreviousRecord()
    VendorMasterBean vmBean = new VendorMasterBean();
    if(currentIndex > 0)
    vmBean =(VendorMasterBean)vendorMasterRecords.elementAt(--currentIndex);
    if(currentIndex == 0)
    // reached first so disable the Previous button
    vPrevbtn.setEnabled(false);
    // enable the Next
    vNxtbtn.setEnabled(true);
    } // end of inner if stmt
    } // end of outer if stmt
    return vmBean;
    } // end of previousrecord
    void vPrevbtn_actionPerformed(ActionEvent e)
    VendorMasterBean vmBean = getPreviousRecord();
    venNmtxt.setText(vmBean.getVendorName());
    venAddtxt.setText(vmBean.getAddress());
    venNotxt.setText(vmBean.getVendorNumber());
    venCitytxt.setText(vmBean.getCity());
    venSttxt.setText(vmBean.getState());
    venZiptxt.setText(vmBean.getZipcode());
    venTeltxt.setText(vmBean.getTelephone());
    venFaxtxt.setText(vmBean.getFax());
    void vPrevbtn_keyPressed(KeyEvent e)
    void vUpdtbtn_actionPerformed(ActionEvent e)
    /* when the update button is pressed , only the v_no is disabled
    vPrevbtn.setEnabled(false);
    vNxtbtn.setEnabled(false);
    venNmtxt.setEnabled(true);
    venAddtxt.setEnabled(true);
    venCitytxt.setEnabled(true);
    venSttxt.setEnabled(true);
    venZiptxt.setEnabled(true);
    venTeltxt.setEnabled(true);
    venFaxtxt.setEnabled(true);
    //then the user should press the save button
    void vExitbtn_actionPerformed(ActionEvent e)
    venMastFrame.setDefaultCloseOperation(venMastFrame.EXIT_ON_CLOSE);
    void vExitbtn_keyPressed(KeyEvent e)
    void vSavebtn_actionPerformed(ActionEvent e)
    String vendorNumber = venNotxt.getText();
    String vendorName = venNmtxt.getText();
    String address = venAddtxt.getText();
    String city = venCitytxt.getText();
    String state = venSttxt.getText();
    String zipCode = venZiptxt.getText();
    String telephone = venTeltxt.getText();
    String fax = venFaxtxt.getText();
    VendorMasterBean vmBean = new VendorMasterBean(vendorNumber, vendorName,address, city, state, zipCode, telephone, fax);
    addVendorMasterRecord(vmBean);
    } // end of vSavebtn_actionPerformed
    } // end of class vendormaster
    //Adapter classes
    class VendorMaster_vNxtbtn_actionAdapter implements java.awt.event.ActionListener
    VendorMaster adaptee;
    VendorMaster_vNxtbtn_actionAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e)
    adaptee.vNxtbtn_actionPerformed(e);
    class VendorMaster_vNxtbtn_keyAdapter extends java.awt.event.KeyAdapter
    VendorMaster adaptee;
    VendorMaster_vNxtbtn_keyAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void keyPressed(KeyEvent e)
    adaptee.vNxtbtn_keyPressed(e);
    class VendorMaster_vPrevbtn_actionAdapter implements java.awt.event.ActionListener
    VendorMaster adaptee;
    VendorMaster_vPrevbtn_actionAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e)
    adaptee.vPrevbtn_actionPerformed(e);
    class VendorMaster_vPrevbtn_keyAdapter extends java.awt.event.KeyAdapter
    VendorMaster adaptee;
    VendorMaster_vPrevbtn_keyAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void keyPressed(KeyEvent e)
    adaptee.vPrevbtn_keyPressed(e);
    class VendorMaster_vExitbtn_actionAdapter implements java.awt.event.ActionListener
    VendorMaster adaptee;
    VendorMaster_vExitbtn_actionAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e)
    adaptee.vExitbtn_actionPerformed(e);
    class VendorMaster_vExitbtn_keyAdapter extends java.awt.event.KeyAdapter
    VendorMaster adaptee;
    VendorMaster_vExitbtn_keyAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void keyPressed(KeyEvent e)
    adaptee.vExitbtn_keyPressed(e);
    class VendorMaster_vNewbtn_actionAdapter implements java.awt.event.ActionListener
    VendorMaster adaptee;
    VendorMaster_vNewbtn_actionAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e)
    adaptee.vNewbtn_actionPerformed(e);
    class VendorMaster_vNewbtn_keyAdapter extends java.awt.event.KeyAdapter
    VendorMaster adaptee;
    VendorMaster_vNewbtn_keyAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void keyPressed(KeyEvent e)
    adaptee.vNewbtn_keyPressed(e);
    class VendorMaster_vDelbtn_actionAdapter implements java.awt.event.ActionListener
    VendorMaster adaptee;
    VendorMaster_vDelbtn_actionAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e)
    adaptee.vDelbtn_actionPerformed(e);
    class VendorMaster_vDelbtn_keyAdapter extends java.awt.event.KeyAdapter
    VendorMaster adaptee;
    VendorMaster_vDelbtn_keyAdapter(VendorMaster adaptee)
    this.adaptee = adaptee;
    public void keyPressed(KeyEvent e)
    adaptee.vDelbtn_keyPressed(e);
    class VendorMaster_vUpdtbtn_actionAdapter implements java.awt.event.ActionListener {
    VendorMaster adaptee;
    VendorMaster_vUpdtbtn_actionAdapter(VendorMaster adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.vUpdtbtn_actionPerformed(e);
    class VendorMaster_vSavebtn_actionAdapter implements java.awt.event.ActionListener {
    VendorMaster adaptee;
    VendorMaster_vSavebtn_actionAdapter(VendorMaster adaptee) {
    this.adaptee = adaptee;
    public void actionPerformed(ActionEvent e) {
    adaptee.vSavebtn_actionPerformed(e);
    the following code is the vendorMasterBean class file- this file helps 2 assign data to the various textboxes.
    code:--------------------------------------------------------------------------------
    package mainpage;
    public class VendorMasterBean
    private String vendorNumber;
    private String vendorName;
    private String address;
    private String city;
    private String state;
    private String zipcode;
    private String telephone;
    private String fax;
    public int Mandatory_Value;
    public VendorMasterBean()
    } // end of constructor
    public VendorMasterBean(String vendorNumber,String vendorName,String address,String city,String state,String zipcode,String telephone,String fax)
    setVendorNumber(vendorNumber);
    setVendorName(vendorName);
    setAddress(address);
    setCity(city);
    setState(state);
    setZipcode(zipcode);
    setTelephone(telephone);
    setFax(fax);
    /* Set Method */
    public void setVendorNumber(String vendorNumber)
    try
    if ( (vendorNumber == null) || (vendorNumber.length() <= 0) || (vendorNumber.length() > 5))
    throw new ValidateException(ValidateException.MANDATORY_VALUE,
    "Vendor Number");
    } // end of if stmt
    else {
    this.vendorNumber = vendorNumber;
    } // end of else
    catch(Exception e)
    e.printStackTrace();
    } // end of setVendorNumber
    public void setVendorName(String vendorName)
    try
    if((vendorName == null) || (vendorName.length() <=0 && vendorName.length() > 25))
    throw new ValidateException(ValidateException.MANDATORY_VALUE,
    "Vendor Name");
    }// end of if
    else
    this.vendorName = vendorName;
    } // end of else
    } // end of try
    catch(Exception e)
    e.printStackTrace();
    }// end of set method
    public void setAddress(String address)
    try
    if((address == null) ||(address.length() <=0 && address.length()>15))
    throw new ValidateException(ValidateException.MANDATORY_VALUE,
    "Address");
    else
    this.address = address;
    catch(Exception e)
    e.printStackTrace();
    public void setCity(String city)
    try
    if((city == null) ||(city.length()<=0 && city.length() > 15))
    throw new ValidateException(ValidateException.MANDATORY_VALUE,
    "City");
    else
    this.city = city;
    catch(Exception e)
    e.printStackTrace();
    public void setState(String state)
    try
    if((state == null) || (state.length()<=0 && state.length() >15))
    throw new ValidateException(ValidateException.MANDATORY_VALUE,
    "State");
    else
    this.state = state;
    catch(Exception e)
    e.printStackTrace();
    public void setZipcode(String zipcode)
    try
    if((zipcode==null) ||(zipcode.length()<=0 && zipcode.length() > 10))
    throw new ValidateException(ValidateException.MANDATORY_VALUE,
    "Zipcode");
    else
    this.zipcode = zipcode;
    catch(Exception e)
    e.printStackTrace();
    public void setTelephone(String telephone)
    try
    if((telephone==null) || (telephone.length() <= 0 && telephone.length()> 7))
    throw new ValidateException(ValidateException.MANDATORY_VALUE,
    "Telephone");
    else
    this.telephone = telephone;
    catch(Exception e)
    e.printStackTrace();
    public void setFax(String fax)
    try
    if((fax == null) ||(fax.length()<=0 && fax.length() > 7))
    throw new ValidateException(ValidateException.MANDATORY_VALUE,
    "Fax");
    else
    this.fax = fax;
    catch(Exception e)
    e.printStackTrace();
    /* Get method */
    public String getVendorNumber()
    return vendorNumber;
    public String getVendorName()
    return vendorName;
    public String getAddress()
    return address;
    public String getCity()
    return city;
    public String getState()
    return state;
    public String getZipcode()
    return zipcode;
    public String getTelephone()
    return telephone;
    public String getFax()
    return fax;
    /* end of get method*/
    } // end of class
    2) the 2nd error is in the save button method , everytme i try 2 save the inserted record it gives me an error.
    in case u need my mainpage.java, here it is
    code:--------------------------------------------------------------------------------
    package mainpage;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JPanel;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    //import java.sql.Statement;
    //import java.sql.ResultSet;
    import oracle.jdbc.driver.OracleDriver;
    import oracle.jdbc.OracleResultSet;
    public class MainPage extends JFrame implements ActionListener
    public static String title = "Warehouse Management System";
    JFrame frame = new JFrame();
    JMenuBar menuBar = new JMenuBar();
    JMenu viewMenu = new JMenu("VIEW");
    JMenuItem vendorItem = new JMenuItem("Vendor Master");
    JMenuItem custItem= new JMenuItem("Customer Master");
    JMenuItem salesrepItem= new JMenuItem("Sales Rep Master");
    JMenuItem itemmastItem= new JMenuItem("Item Master");
    JMenuItem orderItem= new JMenuItem("Order Master");
    JMenuItem invoiceItem = new JMenuItem("Invoice Master");
    JMenuItem payItem= new JMenuItem("Payment Master");
    JMenu transactionMenu = new JMenu("EDIT");
    JMenuItem veneditItem = new JMenuItem("Vendor");
    JMenuItem custeditItem = new JMenuItem("Customer");
    JMenuItem saleItem = new JMenuItem("Rep Information");
    JMenuItem itmeditItem= new JMenuItem("Item");
    JMenuItem ordeditItem= new JMenuItem("Order");
    JMenuItem inveditItem = new JMenuItem("Invoice");
    JMenuItem payeditItem = new JMenuItem("Payment");
    JMenu exitMenu = new JMenu("EXIT

    2 parts to this
    Limit characters in jtextfield using a custom document
    http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html#customdocument
    Specify a custom editor (jtextfield) for jtable (or column)
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#validtext

  • What happened to annotations? building components from tables

    File > New > Business Tier > ADF Business Components > Business Components from Tables]
    there are no longer Entity Beans beign generated.. just useless views.
    no java files to modify for complex foreign key relationships..
    how to go about this?

    Just like in 10g, you can use drag & drop. However, the data control palette was moved and is no longer a fully fledged independent palette, but rather a sub component of the Application navigator, check the data control accordion element of the Application navigator to see all your data controls, and view object. You can drag them in page or on task flow for actions.
    As for session bean specifically, do you mean EJB session beans (that wouldn't make much sense since you're using BC4J) or JSF managed bean in session scope? if the latter, you can always evaluate the ValueExpression #{bindings} at any time in your code to get access to the current binding container.
    Regards,
    ~ Simon

  • Can not add a picture to the JFrame from an ActionListener class

    As topic says, I can not add a picture to the JFrame from an ActionListener class which is a class inside the JFrame class.
    I have a Map.java class where I load an image with ImageIcon chosen with JFileChooser.
    I my window class (main class), I have following:
    class OpenImage_Listener implements ActionListener
         public void actionPerformed(ActionEvent e)
              int ans = open.showOpenDialog(MainProgram.this);     // "open" is the JFileChooser reference
              if(ans == open.APPROVE_OPTION)
                   File file = open.getSelectedFile();                    
                   MainProgram.this.add(new Map(file.getName()), BorderLayout.CENTER);     // this line does not work - it does not add the choosen picture on the window,
                            //but if I add the picture outside this listener class and inside the MainProgram constructor, the picture apperas, but then I cannot use the JFileChooser.
                            showMessageDialog(MainProgram.this, fil.getName() ,"It works", INFORMATION_MESSAGE);  // this popup works, and thereby the ActionListener also works.
    }So why can�t I add a picture to the window from the above listener class?

    The SSCCE:
    Ok, I think I solved it with the picture, but now I cannot add new components after adding the picture.
    Look at the comment in the actionlistener class:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class Test extends JFrame{
         JButton b = new JButton("Open");
         JFileChooser jfc = new JFileChooser(System.getProperty("user.dir"));
         Picture pane;
         Test(){
              super("Main Program");
              setLayout(new BorderLayout());
              JPanel north = new JPanel();
              add(north, BorderLayout.NORTH);
              north.add(b);
              b.addActionListener(new Listener());
              setVisible(true);
              setSize(500,500);
              pane = new Picture("");
              add(pane, BorderLayout.CENTER);
         class Listener implements ActionListener {
              public void actionPerformed(ActionEvent e){
                   int ans = jfc.showOpenDialog(Test.this);
                   if(ans == jfc.APPROVE_OPTION)
                        File file = jfc.getSelectedFile();
                        Test.this.add(new Picture(file.getName()), BorderLayout.CENTER);
                        pane.add(new JButton("NEW BUTTON")); // Why does this button not appear on the window???
                        pane.repaint();
                        pane.revalidate();
         public static void main(String[] args)
              Test t = new Test();
    class Picture extends JPanel
         Image pic;
         String filename;
         Picture(String filename)
              setLayout(null);
              this.filename = filename;
              pic = Toolkit.getDefaultToolkit().getImage(filename);
            protected void paintComponent(Graphics g)
                super.paintComponent(g);
                g.drawImage(pic,0,0,getWidth(),getHeight(),this);
                revalidate();
    }

  • Error while trying to import Software components from SLD.

    Hi Gurus,
    Need Help.
    When we are trying to import Software components from SLD we are getting following error. Could not read list of software component versions from SLD. In Description  i am getting following two points.
    1. Could not read list of software component versions from SLD (COULD_NOT_READ_SWCV)
    2. User credentials are invalid or user is denied access
    We have tried following
    1. LCRSAPRFC and SAPSLDAPI are working fine.
    2  SLDAPICUST is ok
    3. In nwa connections are available for LCRSAPRFC and SAPSLDAPI.
    Request you to let us know how to resolve this issue.
    Thanks in advance.

    Hello ,
    Can you check below roles assigned to the user id?
    SAP_SLD_CONFIGURATOR
    SAP_SLD_DEVELOPER
    SAP_SLD_ORGANIZER
    Thanks

  • How to Install Oracle Data Access Components (ODAC) on Windows Server 2003?

    I recently installed "32-bit Oracle Data Access Components (ODAC) with Oracle Developer Tools for Visual Studio" on my computer (Windows 7, 64bit). Everything seems fine and I can develop and run my application in Visual Studio 2010 and IIS 7.
    Now, when I deploy my application to the Server, it raises error:
    Exception: System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleCommand' threw an exception. ---> Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client
    Obviously I need to install ODAC on the server, too. My server is:
    - Windows 2003 32 bit R2 (I know, I know!)
    - IIS 6
    So. I downloaded the same installation from Oracle website (ODAC 11.2 Release 5 and Oracle Developer Tools for Visual Studio [11.2.0.3.20]) and installed it on the server. But still getting the same error.
    PS: When I was installing, I chose Oracle Data Access Component for Oracle Client 11.2.0.3.20 in Oracle Universal Installer. hmmmm. Should I choose "Oracle Server" instead? Screenshot
    Edited by: 1000434 on Apr 17, 2013 6:35 AM
    Edited by: 1000434 on Apr 17, 2013 6:36 AM

    ODP.NET, Unmanaged Driver uses unmanaged dependencies in the Oracle Client. The error you see means you have another Oracle Client installed on the Win2003 machine and ODP.NET is attempting to load the incorrect Oracle Client version, rather than the version you installed ODP.NET with.
    What you need to do is direct ODP.NET where to find the correct version of its unamanaged Oracle Client dependencies. This will be generally the bin directory of your Oracle Client home that was installed with ODP.NET.
    You can learn more about DllPath here:
    http://docs.oracle.com/cd/E20434_01/doc/win.112/e23174/InstallODP.htm#sthref94
    If you're not familiar with how to set ODP.NET settings in the Registry or .NET config files, you can read how to do that here:
    http://docs.oracle.com/cd/E20434_01/doc/win.112/e23174/featConfig.htm#sthref106

  • How to check if Oracle Data Access Components  is installed?

    How to check if  Oracle Data Access Components is installed and version on my computer?
    Also How to check if Oracle Data Provider is installed and version?
    TIA
    Steve42

    Regedit HKLM->Software->Oracle.  See what's there...
    At the very least, that can give you paths and can check file versions from there.

  • "Can't get Action from Action Reference"?

    I really can't figure out why I get java.lang.IllegalArgumentException with "Can't get Action from Action Reference: BeanName.actionName" message. I specified all properties in faces-config.xml. Bean and its action names are all checked several times, but I still get that exception. Is it a JSF bug, or my simple mistake? Is there anyone who experienced the same problem?
    I'm using two forms in one page. all components' ids are all different. Only one form generated the exception not regarding the order of the forms. (the one is login form and the other (which doesn't generate exception) is leave-comment form.)
    Here is the form code:
                   <h:form id="loginForm" formName="loginForm" >
                        Login >
                        <h:input_text id="loginUserName" valueRef="UserBean.userName">
                             <f:attribute name="style" value="width:64px;"/>
                        </h:input_text>
                        |
                        Password >
                        <h:input_secret id="loginPassword" valueRef="UserBean.password">
                             <f:attribute name="style" value="width:64px;"/>
                        </h:input_secret>
                        |
                        <h:command_button id="loginSubmit" label="login" commandName="loginSubmit" actionRef="UserBean.loginAction" />
                   </h:form>
    and here is managed-bean part:
    <managed-bean>
         <managed-bean-name>UserBean</manager-bean-name>
              <managed-bean-class>
                   net.gleamynode.notes.http.faces.UserBean
              </managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
    <property-name>idStr</property-name>
    <null-value/>
    </managed-property>
    <managed-property>
    <property-name>userName</property-name>
    <null-value/>
    </managed-property>
              <managed-property>
                   <property-name>password</property-name>
                   <null-value/>
              </managed-property>
         </managed-bean>
    Thanks in advance!

    here goes the source code of NotesBean:
    abstract class NotesBean {
         protected static final String SUCCESS = "success";
         protected static final String FAILURE = "failure";
         private String connectionProfile;
         protected NotesBean() {}
         public String getConnectionProfile() {
              return connectionProfile;
         public void setConnectionProfile(String newProfileName) {
              connectionProfile = newProfileName;
         public abstract Action getCreateAction();
         public abstract Action getDeleteAction();
         public abstract Action getUpdateAction();
         protected Connection getConnection() throws NotesException {
              ConnectionProfile profile = ConnectionProfileFactory.getProfile(connectionProfile);
              return DriverManager.getConnection(profile.getUrl(), profile.getProperties());
    }I think everything is ok with the beans, right?
    By the way: shouldn�t the error message be:
    "Can't get Action from Action Reference: UserBean.loginAction"I just examplified the message using somewhat generic name. Sorry for confusion :)
    As a final try, here is the whole JSP code: (ignore korean texts)
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://gleamynode.net/notes" prefix="notes" %>
    <html>
    <head>
         <title>gleamynode.net :: gathering of my mentality</title>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
         <link rel="stylesheet" HREF="css/gleamynode.css" type="text/css" />
    </head>
    <body>
    <f:use_faces>
    <notes:useNotes>
         <c:choose>
              <c:when test="${empty param['id']}">
                   <notes:getPages var="pages" />
                   <c:forEach var="p" items="${pages}" begin="0" end="0">
                        <c:set var="p" value="${p}" scope="request"/>
                   </c:forEach>
              </c:when>
              <c:otherwise>
                   <notes:getPage var="p" pageId="${param['id']}" />
              </c:otherwise>
         </c:choose>
         <div id="header">
              <h:command_hyperlink href="index.jsp" label="gleamynode.net :: gathering of my mentality"/>
         </div>
         <div id="menu">
              About | Essays | Projects | Others | Links
         </div>
         <div id="content">
              <div id="page">
                   <div id="pageTitle">
                        #${p.id}. ${p.title}
                   </div>
                   <div id="pageContent">
                        ${p.content}
                        <div id="pageTimestamp">
                             ${p.timestamp}
                        </div>
                   </div>
              </div>
              <c:choose>
                   <c:when test="${fn:length(p.comments) > 0}">
                        <div id="comments">
                             <div id="teaser">
                                  ${fn:length(p.comments)} ?? ??? ????
                             </div>
                             <c:forEach var="c" items="${p.comments}">
                                  <div id="commentHeader">
                                       #${c.id}. ${c.userName}
                                  </div>
                                  <div id="commentContent">
                                       ${c.content}
                                       <div id="commentTimestamp">
                                            ${c.timestamp}
                                       </div>
                                  </div>
                             </c:forEach>
                        </div>
                   </c:when>
              </c:choose>
              <div id="commentForm">
                   <jsp:useBean id="CommentBean" class="net.gleamynode.notes.http.faces.CommentBean" scope="request" />
                   <jsp:setProperty name="CommentBean" property="pageIdStr" value="${p.id}"/>
                   <jsp:setProperty name="CommentBean" property="content" value=""/>
                   <div id="teaser">
                   </div>
                   <h:form id="commmentForm" formName="commentForm" >
                        <input type="hidden" name="id" value="${p.id}"/>
                        <h:input_hidden id="pageId" valueRef="CommentBean.pageIdStr"/>
                        <table width="95%">
                             <tr>
                                  <td class="name" width="9%">Name:</td>
                                  <td class="value" width="25%">
                                       <h:input_text id="userName" valueRef="CommentBean.userName">
                                            <f:attribute name="style" value="width:75%;"/>
                                       </h:input_text>
                                  </td>
                                  <td class="name" width="8%">Email:</td>
                                  <td class="value" width="25%">
                                       <h:input_text id="userEmail" valueRef="CommentBean.userEmail">
                                            <f:attribute name="style" value="width:75%;"/>
                                       </h:input_text>
                                  </td>
                                  <td class="name" width="8%">URL:</td>
                                  <td class="value" width="25%">
                                       <h:input_text id="userURL" valueRef="CommentBean.userURL">
                                            <f:attribute name="style" value="width:100%;"/>
                                       </h:input_text>
                                  </td>
                             </tr>
                             <tr>
                                  <td colspan="6">
                                       <h:input_textarea id="content" valueRef="CommentBean.content">
                                            <f:attribute name="style" value="width:100%; height: 12em;"/>
                                       </h:input_textarea>
                                  </td>
                             </tr>
                             <tr>
                                  <td class="buttons" colspan="6">
                                       <h:command_button id="submit" label="leave a comment" commandName="submit" actionRef="CommentBean.createAction" />
                                  </td>
                             </tr>
                        </table>
                   </h:form>
              </div>
              <div id="loginForm">
                   <div id="teaser">
                   </div>
                   <h:form id="loginForm" formName="loginForm" >
                        Login >
                        <h:input_text id="loginUserName" valueRef="UserBean.userName">
                             <f:attribute name="style" value="width:64px;"/>
                        </h:input_text>
                        |
                        Password >
                        <h:input_secret id="loginPassword" valueRef="UserBean.password">
                             <f:attribute name="style" value="width:64px;"/>
                        </h:input_secret>
                        |
                        <h:command_button id="loginSubmit" label="login" commandName="loginSubmit" actionRef="UserBean.loginAction" />
                   </h:form>
              </div>
              <div id="copyright">
                   Copyright � 1999~ by Trustin Lee, All Rights Reserved.
              </div>
         </div>
         <div id="footer">
         </div>
    </notes:useNotes>
    </f:use_faces>
    </body>
    </html>and, here is the whole faces-config.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC
              "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
              "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
    <faces-config>
        <navigation-rule>
            <from-tree-id>/index.jsp</from-tree-id>
            <navigation-case>
                <from-outcome>success</from-outcome>
                <to-tree-id>/index.jsp</to-tree-id>
            </navigation-case>
            <navigation-case>
                <from-outcome>failure</from-outcome>
                <to-tree-id>/failure.jsp</to-tree-id>
            </navigation-case>
        </navigation-rule>
         <managed-bean>
              <managed-bean-name>PageBean</managed-bean-name>
              <managed-bean-class>
                   net.gleamynode.notes.http.faces.PageBean
              </managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
            <managed-property>
                <property-name>idStr</property-name>
                <null-value/>
            </managed-property>
              <managed-property>
                   <property-name>title</property-name>
                   <null-value/>
              </managed-property>
              <managed-property>
                   <property-name>content</property-name>
                   <null-value/>
              </managed-property>
         </managed-bean>
         <managed-bean>
              <managed-bean-name>CommentBean</managed-bean-name>
              <managed-bean-class>
                   net.gleamynode.notes.http.faces.CommentBean
              </managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
            <managed-property>
                <property-name>idStr</property-name>
                <null-value/>
            </managed-property>
            <managed-property>
                <property-name>pageIdStr</property-name>
                <null-value/>
            </managed-property>
              <managed-property>
                   <property-name>userName</property-name>
                   <null-value/>
              </managed-property>
              <managed-property>
                   <property-name>userEmail</property-name>
                   <null-value/>
              </managed-property>
              <managed-property>
                   <property-name>userURL</property-name>
                   <null-value/>
              </managed-property>
              <managed-property>
                   <property-name>content</property-name>
                   <null-value/>
              </managed-property>
         </managed-bean>
        <managed-bean>
             <managed-bean-name>UserBean</manager-bean-name>
              <managed-bean-class>
                   net.gleamynode.notes.http.faces.UserBean
              </managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
            <managed-property>
                <property-name>idStr</property-name>
                <null-value/>
            </managed-property>
            <managed-property>
                <property-name>userName</property-name>
                <null-value/>
            </managed-property>
              <managed-property>
                   <property-name>password</property-name>
                   <null-value/>
              </managed-property>
         </managed-bean>
    </faces-config>Thank you for your continuous help, Rene! Learned alot from you about JSF :)

  • Struts - Data pass from Action class to JSP

    hello ,
    I am new to struts and have a strange question in my mind .
    How do we pass business logic data from action class to JSP.Do we use session object or any other best way to be used to pass data.
    Example scenario:
    Once the user logins into application by passing userid and password ,we need to display his open queries (from database table) on jsp.
    Components used :
    Login.jsp
    LoginForm(getter and setter methods of userid & password)
    LoginAction(get database connection,perform query to fetch user's open queries form the database)
    OpenQueries.jsp(to display Open queries on a tabular format)
    In LoginAction - We fetched user's open Queries from the database and stored them in collection object .
    My question is : what is the best way to pass Collection object from LoginAction to OpenQueries.jsp ?
    Thanks in advance...
    Ram
    Edited by: ram_76uk on Apr 10, 2008 8:21 PM

    You can use plain javabeans to transfer the data. Check out the jsp:usebean tag. If you don't know how to do, check out the Java EE tutorial: http://java.sun.com/javaee/5/docs/tutorial/doc/ Using javabeans in JSP pages starts halfway chapter 4.

  • Few basic doubts about accessing AM from backing bean class

    Hi ADF experts,
    I have just started working in ADF Faces.I made a sample search page.My page is attached to a managed backing bean. I have attached command button on my page to a custom method in backing bean class.
    So on, click of button this method is called in backing bean.Now, i have few doubts:
    1)How to get values of various UI beans in this event code?
    2)I am accesing AM , in my method with this code:
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext extContext = facesContext.getExternalContext();
    Application app = facesContext.getApplication();
    DCBindingContainer binding = (DCBindingContainer)app.getVariableResolver().resolveVariable(facesContext, "bindings");
    //Accessing AM
    ApplicationModule am = binding.getDataControl().getApplicationModule();
    iS this correct ?
    3) After getting handle of am how to call my custom method in AM Class?there was "invokeMethod" API in application module class in OAF, is there any such method here?
    Please help me.
    --ADF learner.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Thanks for ur response Frank, actually I am from OA Framework back ground.It would be great if help us a little with ur valuble thoughts.
    OA Framework also uses bc4j in model layer of framework. We have a requirement where our existing developers from OA Framework have to move to ADF to make a new application where time lines are quite strict.If this would not be possible we will switch to plain jsp and jdbc,but our tech experts say ADF Faces is the best tech.
    In OA Framework, Application Module is key class for all busiess logic and Controller is used for page navigation. So, I m just trying to find the same similarity , where we write we add all event codes in custom action methods in the backing bean class of page, which we consider equivalent to process form request method in Controller class of OAF.
    But there are two things, I still want to know:
    1)While page render, how to call specific AM methods(like setting where clause of certain VOs)
    2)In action methods, the way i described(I found that in one thread only)to access AM, what is wrong in that?Also, I went through
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html
    where coule of examples use similar approach to access AM from backing bean class and call custom methods of AM(Doing various, deletes etc from VOs).
    3)In these methods can we set any property of beans on the page, I am asking because in OAF, generally we use PPR for js alternatives.But all properties of beans cannot be set in post event.
    Thanks and Regards
    --ADF Learner                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Updating Swing components from a different class

    I would like to use the JTextArea component in a JFrame to display fast updating text from my application. My application is very simple. When the app launches the GUI is created then my application engine would start processing and displaying text data into the GUI. After reading about Thread safety when using Swing components I concluded it would not be a good idea for my app engine class to update the JTextArea class directly using methods such as .append(String).
    I would be grateful for any suggestions on how I should approach updating Swing components from different classes.
    Many Thanks in advance Sean

    Hi
    Why don't you just implement a basic callback method?
    To do this the right way you should probably define a simple Interface that has a public method like updateProcessText(String s). Your swing class then implements this interface, basically forcing it to provide the public method you defined (this is no different than implementing ActionListener, which forces you to define actionPerformed). Secondly modify your processing class, so that it take's a class that implements the interface you just created, as one of the arguments in it's constructor. Lastly assign the argument from your construnctor to a private var - this will enable your processing class to have a handle to your swing class and update it as it pleases.
    This might sound very complex, but it's really simple once you've done it once.

  • Business Components from Any Device

    Articles and sample code show how to use Oracle XSQL Servlet to access BC4J components from XML documents. Query the database and manipulate data from any Web-enabled device.
    http://otn.oracle.com/sample_code/products/jdev/htdocs/x2vo/x2vohome.html
    Regards,
    -rh

    Hi,
    There are many ways to achieve this.
    If your requirement is just to read data from different database (and not to update it), then using a database link would be a better approach.
    You could create a database link in the primary database (target database being the one you would like to query). Base your sql query for the vo using the db link.
    -Arun

Maybe you are looking for