Article View: borland.public.jbuilder.java.swing
Article #12564Re: How to implement a JdbNavComboBox
From: Ramanan Varadarajan
Date: Tue, 08 Dec 1998 00:00
Date: Tue, 08 Dec 1998 00:00
94 lines
4001 bytes
4001 bytes
--------------8698D416E000D98F2AA7518B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
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");
}}
--------------8698D416E000D98F2AA7518B
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi,
<br>I also struggled with JdbNavComboBox for a while...
<br>and found out this..
<br>the JdbNavComboBox fires only the events that are
<br>applicable to QueryDataSet it is naviagating with...
<p>for instance
<br>if you have queryDataSet1 attached to jdbNavComboBox1 then
<br>whenever u select an item in the ComboBox, it is equivalent to
<br>navigating to that element in the queryDataSet1..
<br>if u add a listener to Navigation event of the queryDataSet1
then
<br>u can capture the event occurence
<br>Hope this is clear... Feel free to ask me if not clear
<p>Thanks
<br>Ramanan
<br>
<p>code example:
<p> JdbNavComboBox jdbNavCboLname = new JdbNavComboBox();
<p> jdbNavCboLname.setDataSet(queryDataSetEmp);
<br>
<p> queryDataSetEmp.addMasterNavigateListener(new borland.jbcl.dataset.MasterNavigateListener()
{
<br> public void masterNavigating(MasterNavigateEvent
e) {
<br> }
<br> public void masterNavigated(MasterNavigateEvent
e) {
<br> queryDataSetEmp_masterNavigated(e);
<br> }
<br> });
<p> void queryDataSetEmp_masterNavigated(MasterNavigateEvent e) {
<br> System.out.println("jdbNavCboLname itemState changed");
<br> if(jdbNavDeptName.getSelectedItem()!=null) {
<br> System.out.println("selected " +jdbNavCboLname.getSelectedItem().toString());
<br> System.out.println("jdbNavCboLname itemState
changed");
<br> }}
<br><font size=+1></font> </html>
--------------8698D416E000D98F2AA7518B--
Technical Details
Message-ID:
<366D559D.3675C352@lancomp.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36681B0B.C42BFB37@gte.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,2fdf92b46fdaae02 X-Google-Attributes: gid111d45,public From: Ramanan Varadarajan <rvaradar@lancomp.com> Subject: Re: How to implement a JdbNavComboBox Date: 1998/12/08 Message-ID: <366D559D.3675C352@lancomp.com> X-Deja-AN: 420042876 References: <36681B0B.C42BFB37@gte.net> X-Accept-Language: en Content-Type: multipart/alternative; boundary="------------8698D416E000D98F2AA7518B" Organization: LAN & Computer Integrators, Inc. Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing