Board index » jbuilder » attaching to a database field

attaching to a database field


2004-03-05 04:32:34 AM
jbuilder16
Hi
I thought it would be better to start a new question with this one, I got
following advise in the databse group, the problem is that I don't get how
to make it!
<snip>
If you attach the dbswing component to the database/field
</snip>
what I want to do is attach a JdbTextField to my database where I can add
data (string) to a field. I also need to make the same with a JdbTextArea. I
guess I will be best to add a button to save the changes with. I don't see
how I can use some of the nav tools (e.g. JdbNavToolbar) but I could be
wrong!!!!!!!!!
What I especially are after is a way to do this from inside the designer, I
mean, now Borland have made such a wonderfull tool and it would be a shame
to handcode the thing. I've tried to look into the dbSwing models to use the
databinding tools but no luck so far.
What I ask is a small push.
TIA
Tommy
 
 

Re:attaching to a database field

sorry
found the "columm name"
8(
It got me a part of the way, forgive me if I ask stupid but I have benn at
this many hours, how can I be sure my textfield and textarea follow my "id"
which is my primary key? so I'll have everything in the right row?
Yeah I know , go to bed!
Tommy
"Tommy" < XXXX@XXXXX.COM >skrev i en meddelelse
Quote
Hi

I thought it would be better to start a new question with this one, I got
following advise in the databse group, the problem is that I don't get how
to make it!

<snip>
If you attach the dbswing component to the database/field
</snip>

what I want to do is attach a JdbTextField to my database where I can add
data (string) to a field. I also need to make the same with a JdbTextArea.
I
guess I will be best to add a button to save the changes with. I don't see
how I can use some of the nav tools (e.g. JdbNavToolbar) but I could be
wrong!!!!!!!!!
What I especially are after is a way to do this from inside the designer,
I
mean, now Borland have made such a wonderfull tool and it would be a shame
to handcode the thing. I've tried to look into the dbSwing models to use
the
databinding tools but no luck so far.

What I ask is a small push.

TIA

Tommy


 

Re:attaching to a database field

Tommy wrote:
Quote
sorry

found the "columm name"

8(

It got me a part of the way, forgive me if I ask stupid but I have benn at
this many hours, how can I be sure my textfield and textarea follow my
"id" which is my primary key? so I'll have everything in the right row?

Yeah I know , go to bed!


You can do this from the QueryDataSet Form.
Highlight your QueryDataSet Name from the Class Inspector Pane (second frame
on the left).
Click on the Designer Tab.
You will now have a view of the QueryDataSet Showing Column Names and
information.
Click the Icon that looks like a popup Windows type icon.
When the JFrame pops up, select RowID and Resolvable and any other info you
wish to see. Click OK.
Now highlight your primary Key column and scroll to the right until you see
the Column named rowID. Make sure that is displays the value of True. Check
the value of Resolvable. It must be set to true as well.
Now you primary Key is set. Any editing done to the in memory component for
that QueryDataSet is now updatable. The Resolver will now handle these
issues automatically, IF OF COURSE, you have the JdbComponent set to
editable and the QueryDataSet Editable property is set to true (from the
Bean Inspector is set to true, or you have this in your code:
QueryDataset.setEditable(true);
 

{smallsort}

Re:attaching to a database field

Thanks a million! I look forward to try it! It's going to be late!
Tommy
 

Re:attaching to a database field

Works like a charm!
Thanks
Tommy