Opening a JClient Form with an Action Handler

You can use the JClient wizards to create JClient forms with various databound controls. Later, when you want your JClient forms to run from a single main window, you can create a JClient frame that contains:

When the user performs an action in the UI, such as clicking a button, an event is issued. Events are objects that describe what happened and are only reported to registered listeners. JDeveloper generates all of this code for you. The following procedure describes the code you must supply to open a JClient form when the button is clicked.

To define an action to open a JClient form:

  1. Create a empty JClient frame that creates a connection to the business service for the form.
  2. Open the empty JClient frame in the Java Visual Editor and delete the Navigation Bar and Status Bar generated by the Create JClient Empty Form wizard.
  3. Add a JButton control from the Component Palette the data panel of the empty form.
  4. Select the button in the Java Visual Editor.
  5. Click the Events tab of the Property Inspector.
  6. Type the name of the function you want executed whenever the button is clicked in the space next to actionPerformed and press the Enter key. JDeveloper will take you to a stub of your function in the Code Editor.
  7. Add the code to the event stub to create the JClient form you want to display and set its visible property to true:

    FrameMyNewView frame = new FrameMyNewView(getPanelBinding());
    frame.setVisible(true);

    The getPanelBinding() method allows you to share the panel binding from main JClient frame. This results in the iterator bindings to be shared between JClient forms. The new frame will automatically be synchronizeded with the navigation bar and status bar in the first detail of the master-detail frames.

    OR

    Add create the JClient form and set a new panel binding when you don't want the form to be sync'ed with the frame that opened it:

    FrameMyNewView(new JUPanelBinding(getPanelBinding().getApplicationName(),null));
    frame.setVisible(true);


About the JClient Application Code
About Data Binding in JClient Application

Opening a JClient Form Multiple Times

 

Copyright © 1997, 2004, Oracle. All rights reserved.