TS 61 MasterDetailFormWizard

Master/Detail Form wizard

Author: Jiri Vagner
Version: 6.1
Last update: 2011/10/20
Introduction: A few test scenarios about using Master/Detail Form wizard.
Comments: M/D wizard generates different code in Java Desktop application project and in Java Application project. All suites are using Sample database, which is bundled with Java DB server in Oracle JDKs.

Contents


Test suite: M/D wizard in Java Application project

Purpose: Using wizard in simple Java application project.
Project Setup: Start IDE and create new Java Application project

  1. Create M/D form using M/D wizard with details as textfields
    1. Invoke "New file" wizard (CTRL + N)
    2. Select category "Swing GUI Forms"
    3. Choose file type "Master/Detail Sample Form"
    4. Press "Next" button
    5. Set class name to "MasterDetailAsTextForm"
    6. Press "Next" button
    7. In Database connection listbox choose Sample database JDBC connection string. (Username:app, password:app)
    8. Select database table CUSTOMER
    9. Move columns CUSTOMER_ID a DISCOUNT_CODE from Columns to Include list into Available Columns list.
    10. Press "Next" button
    11. Create Detail Area as Textfields option is set. Just remove column CREDIT_LIMIT from Fields to Include list.
    12. Press "Finish" button
    • EXPECTED RESULT: There is a table inside a form. Table contains 10 columns, there is no Customer Id and discount Code column, but table contains Credit Limit column. Beneath table there are nine textfields, there is no textfield for editing Credit Limit value.
    1. Build the Project and execute form file (SHIFT + F6)
    • EXPECTED RESULT: In executed form, jtable is filled with customers. Textfields beneath table are empty.
    1. Select row in table
    • EXPECTED RESULT: Beans Binding in action! Textfields are filled with selected customer's values.
  2. Create M/D form using M/D wizard with details as table
    1. Invoke "New file" wizard (CTRL + N)
    2. Select category "Swing GUI Forms"
    3. Choose file type "Master/Detail Sample Form"
    4. Press "Next" button
    5. Set class name to "MasterDetailAsTableForm"
    6. Press "Next" button
    7. In Database connection listbox choose Sample database JDBC connection string. (Username:app, password:app)
    8. Select database table PRODUCT_CODE
    9. Press "Next" button
    10. Check Create Detail Area as Table option
    11. Press "Finish" button
    • EXPECTED RESULT: Two tables are inside a form - masterTable and detailTable. Master table contains columns Prod Code, Discount Code and Description. Detail table is empty.
    1. Press "Source" button
    2. Find method responsible for adding new record
    • EXPECTED RESULT: "Add new record" functionality you can find in code in method newButtonActionPerformed(). It's common private java method.
    1. Build the Project and execute form file (SHIFT + F6)
    • EXPECTED RESULT: In executed form, master table is filled with product codes. Detail table is still empty.
    1. Select row in master table
    • EXPECTED RESULT: Beans Binding in action! Now in detail table you can see products which are connected with selected product code.
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo