Article View: borland.public.jbuilder.java.swing
Article #12578Re: How to implement a JdbNavComboBox
From: Tammy McKean
Date: Wed, 09 Dec 1998 00:00
Date: Wed, 09 Dec 1998 00:00
73 lines
2781 bytes
2781 bytes
Hi,
I also have a question related to working with JdbNavComboBox editing. I have a
master-detail relationship setup on 2 JdbNavComboBoxes that is working fine. My
desire is to have both of these boxes also be editable and to save data entered
into the boxes into the underlying model. My question is how to approach this.
I can edit the boxes the renderer (I guess or the editor?) always resets my
selection back to an existing choice in the box after editing. Has anyone done
something similar that they'd like to share?!
thanks,
-tm
Ramanan Varadarajan wrote:
> Hi,
> I also struggled with JdbNavComboBox for a while...
> and found out this..
> the JdbNavComboBox fires only the events that are
> applicable to QueryDataSet it is naviagating with...
>
> for instance
> if you have queryDataSet1 attached to jdbNavComboBox1 then
> whenever u select an item in the ComboBox, it is equivalent to
> navigating to that element in the queryDataSet1..
> if u add a listener to Navigation event of the queryDataSet1 then
> u can capture the event occurence
> Hope this is clear... Feel free to ask me if not clear
>
> Thanks
> Ramanan
>
>
> code example:
>
> JdbNavComboBox jdbNavCboLname = new JdbNavComboBox();
>
> jdbNavCboLname.setDataSet(queryDataSetEmp);
>
>
> queryDataSetEmp.addMasterNavigateListener(new
> borland.jbcl.dataset.MasterNavigateListener() {
> public void masterNavigating(MasterNavigateEvent e) {
> }
> public void masterNavigated(MasterNavigateEvent e) {
> queryDataSetEmp_masterNavigated(e);
> }
> });
>
> void queryDataSetEmp_masterNavigated(MasterNavigateEvent e) {
> System.out.println("jdbNavCboLname itemState changed");
> if(jdbNavDeptName.getSelectedItem()!=null) {
> System.out.println("selected "
> +jdbNavCboLname.getSelectedItem().toString());
> System.out.println("jdbNavCboLname itemState changed");
> }}
>
--
tammy@synchronis.com
synchronis llc
2999 overland avenue suite 217
los angeles, ca 90064
www.synchronis.com
direct 310.837.8093
fax 310.837.8094
Technical Details
Message-ID:
<366F0E94.B5041D13@synchronis.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36681B0B.C42BFB37@gte.net> <366D559D.3675C352@lancomp.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,2fdf92b46fdaae02 X-Google-Attributes: gid111d45,public From: Tammy McKean <tammy@synchronis.com> Subject: Re: How to implement a JdbNavComboBox Date: 1998/12/09 Message-ID: <366F0E94.B5041D13@synchronis.com> X-Deja-AN: 420620045 Content-Transfer-Encoding: 7bit References: <36681B0B.C42BFB37@gte.net> <366D559D.3675C352@lancomp.com> To: Ramanan Varadarajan <rvaradar@lancomp.com> Content-Type: text/plain; charset=us-ascii Organization: synchronis Mime-Version: 1.0 Reply-To: tammy@synchronis.com Newsgroups: borland.public.jbuilder.java.swing