« Return to Thread: [core] New Desktop Database Application Wizard resulting application behaviour

Re: [core] New Desktop Database Application Wizard resulting application behaviour

by ics :: Rate this Message:

Reply to Author | View in Thread

i said time ago that the problem with that wizard was that only one table can be used, now i see for the post, (now i cant try it) that can be used two tables, well , i would like to use the wizard several times in the same project, the only thing you have to do its not create the project, i mean in a project theres not only one master table an only one detail table, could be more, please ...;)

2007/11/18, RobertPage <page@...>:

Hi All,

   Another long subject line!

   I'm still trying to work with master and detail tables in a desktop
database application.
   Thanks to Jana Maleckova's pointer about the foreign key needing to be
declared, and sample
table example, the New Project Wizard will create for me a simple form based
on the two tables.

   I can enter a master record with no problem [1]. When I click the master
table's New button, a new row appears in the master table. It's even
selected [2]. I can enter data, save it, refresh it.

   The problem comes when I try to enter a detail row.

   I select a row in the master table, and click the detail table's New
button. The new row isn't visible.
You can't put data in it. You're stuck unless you select a different row in
the master table, and then select the row you actually wanted. The detail
table is drawn and the new row is visible and available.

   I've looked at the code that the wizard generates to handle new detail
rows. The new row is created, persisted, added and selected. For some
reason,

detailTable.scrollRectToVisible(detailTable.getCellRect (row, 0, true));

isn't making the row appear. I even tried some explicit repainting, without
success.
Is it just something I'm doing wrong? [3]

To create the same tables and invoke the wizard:
(Release RC1 on Windows XP Pro and Windows 2000)
I'm using the tables from  Jana's example, but I changed the table names
from TEST1 and TEST2.
These are created in a Java DB database.

CREATE TABLE AUTHOR
    (
    AUTHOR_ID INT NOT NULL,
    FIRSTNAME VARCHAR(200) NOT NULL,
    SURNAME VARCHAR(200) NOT NULL,
        PRIMARY KEY (AUTHOR_ID)
);

CREATE TABLE BOOK
    (
    ALBUM_ID INT NOT NULL,
    ALBUMNAME VARCHAR(200) NOT NULL,
        AUTHOR_INH INT,
    FOREIGN KEY (AUTHOR_INH) REFERENCES AUTHOR (AUTHOR_ID),
        PRIMARY KEY (ALBUM_ID)
);

Then run the New Project > Java Desktop Application > Database Application
wizard. Make AUTHOR your master table. Book will be your details table.  Run
the resulting application. Enter a new author with the ID 1. Save the
author. Try to enter a new book. If you can't, try entering another author
and use the trick of switching back and forth.

Thanks for reading this far,
Robert




[1] It took a while for the form to train me. Always exit the field to make
the data "real". Never use the Enter key for navigation. Always use the Tab
key, but don't expect it to go to the next column in the same row unless
there's only one row.

[2] Ideally, the focus would also go to the place where you're about to
enter data. Showing the row selected but not giving it focus is just a
tease.

[3] Again? But there are some redraw issues here. If the application
languishes in the background, say while you're posting a longwinded
description to NetCAT, when you bring it to the foreground sometimes
the frame only partly redraws. You have a lot of grey space where tables and
buttons should be. The tooltips still pop up for invisible buttons.
http://www.nabble.com/file/p13815728/HalfAnApp.jpg
--
View this message in context: http://www.nabble.com/-core--New-Desktop-Database-Application-Wizard-resulting-application-behaviour-tf4828905.html#a13815728
Sent from the NetBeans - NetCAT mailing list archive at Nabble.com.

 « Return to Thread: [core] New Desktop Database Application Wizard resulting application behaviour

LightInTheBox - Buy quality products at wholesale price