list filed with menu navigation problem

I list filed and I ' I use navigation () method to get the row index selected by a click but navigation click () method does not work, when I click on list fied line menu will open here is my code

list = new ListField() {}
protected boolean navigationClick (int status, int time)
{
index = list.getSelectedIndex ();
System.out.println ("index is" + index);
Dialog.Inform(""+index);
Returns true;
}

};
list.setEmptyString ("Empty", DrawStyle.HCENTER);
list.setRowHeight (2 * getFont () .getHeight ());
list.setCallback (this);
List.Invalidate ();

{public drawListRow Sub (ListField listField, Graphics g, int index, int y, int width)}
TODO self-generating method stub

String text = (String) favector.elementAt (index);

g.setColor (0x000000);
g.drawLine (0, y, Display.getWidth (), y);
g.drawText (text, 0, y, DrawStyle.ELLIPSIS, width);

}

public Object get (ListField listField, int index) {}
TODO self-generating method stub
Return favector.elementAt (index);
}

public int getPreferredWidth (ListField listField) {}
TODO self-generating method stub

Return Display.getWidth ();
}
public int indexOfList (String prefix, int start, ListField listField) {}
TODO self-generating method stub
return 0;
}

Here is my update of the code, sorry the bad code

public class Mysearch extends MainScreen implements FieldChangeListener, ListFieldCallback{

    private VerticalFieldManager mainManager;
    private VerticalFieldManager subManager;
    private Bitmap _backgroundBitmap = Bitmap.getBitmapResource("a.png");
    private int deviceWidth = Display.getWidth();
    private int deviceHeight = Display.getHeight();
    ButtonField gobtn;
    EditField editfild = new EditField();
    ListField list;
    String getedtflddata;
    Vector favector;
    URI str;
    Database db = null;
    int index;
    String text;

    public Mysearch() {
        // TODO Auto-generated constructor stub
        super(NO_VERTICAL_SCROLL);
        setTitle("Search");

        editfild.setBorder( BorderFactory.createSimpleBorder( new XYEdges(2, 2, 2, 2),
                new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK), Border.STYLE_SOLID));
        editfild.setBackground(BackgroundFactory.createSolidBackground(Color.WHITE));
        gobtn = new ButtonField("go",ButtonField.CONSUME_CLICK);

        list = new ListField(){

            protected boolean navigationClick(int status, int time) {
                // TODO Auto-generated method stub
                index = list.getSelectedIndex();
                Dialog.alert(""+index);
                return super.navigationClick(status, time);
            }

        };
        list.setEmptyString("Empty", DrawStyle.HCENTER);
        list.setRowHeight(2*getFont().getHeight());
        list.setCallback(this);
        list.invalidate();

        //this manager is used for the static background image
        mainManager = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR )
        {
            public void paint(Graphics graphics)
            {
                graphics.clear();
                graphics.drawBitmap(0, 0, deviceWidth, deviceHeight, _backgroundBitmap, 0, 0);
                super.paint(graphics);
            }
        };

        //this manger is used for adding the componentes
        subManager = new VerticalFieldManager( Manager.VERTICAL_SCROLL |  Manager.VERTICAL_SCROLLBAR )
        {
            protected void sublayout(int maxWidth, int maxHeight)
            {
                int displayWidth = deviceWidth;
                int displayHeight = deviceHeight;

                super.sublayout( displayWidth, displayHeight);
                setExtent( displayWidth, displayHeight);
            }
        };

        /// add your component to this subManager
        subManager.add(editfild);
        subManager.add(gobtn);
        subManager.add(list);
        gobtn.setChangeListener(this);

        //add subManager over the mainManager
        mainManager.add(subManager);

        //finally add the mainManager over the screen
        this.add(mainManager);   

    }

    public void fieldChanged(Field field, int arg1) {
        // TODO Auto-generated method stub
            getedtflddata = editfild.getText().toString();
            System.out.println("string value"+getedtflddata.length());
            if(!(getedtflddata.length() == 0)){
            favector = new Vector();
            try{
                System.out.println("inside try======");
                str = URI.create("file:///SDCard/mydatabase.db");
                db = DatabaseFactory.open(str);
                db.beginTransaction();
                Statement statmnt1 = db.createStatement(
                                "select * from tbthought where goldenquote like '% "
                                        + getedtflddata + " %' or goldenquote like '"
                                        + getedtflddata + "' or goldenquote like '"
                                        + getedtflddata + " ' or goldenquote like '% "
                                        + getedtflddata + "' or goldenquote like ' "
                                        + getedtflddata + "' or goldenquote like '"
                                        + getedtflddata
                                        + " %' or goldenquote like '% "
                                        + getedtflddata + ".'");

                statmnt1.prepare();
                Cursor c = statmnt1.getCursor();
                if(c.isEmpty())
                {
                    Status.show("no match found");
                    System.out.println("no data found");
                }else
                {
                    c.first();
                    Row mr = null;
                     int il = 0;
                     while(c.next()) {

                       mr = c.getRow();
                       il++;
                       System.out.println("---"+mr.getString(5));

                       favector.addElement(mr.getString(5));
                     }
                     list.setSize(favector.size());
                     }
                     statmnt1.execute();
                     statmnt1.close();

                     db.commitTransaction();
                     db.close();

                     System.out.println("gfavector.size()="+favector.size());
                }catch(Exception e)
                {
                    try {
                        db.close();
                    } catch (Exception e1) {
                        // TODO Auto-generated catch block
                        System.out.println("go btn excptn="+e1.getMessage());
                        e1.printStackTrace();
                    }
                    System.out.println("go btn excptn="+e.getMessage());
                }
            }else{

                Status.show("please write some word..");
                System.out.println("else part----------");
            }

    }

    public void drawListRow(ListField listField, Graphics g, int index,int y, int width) {
        // TODO Auto-generated method stub

        String text = (String)favector.elementAt(index);

        g.setColor(0x000000);
        g.drawLine(0, y, Display.getWidth(), y);
        g.drawText(text,0, y, DrawStyle.ELLIPSIS, width);   

    }

    public Object get(ListField listField, int index) {
        // TODO Auto-generated method stub
        return favector.elementAt(index);
    }

    public int getPreferredWidth(ListField listField) {
        // TODO Auto-generated method stub

        return  Display.getWidth();
    }
    public int indexOfList(ListField listField, String prefix, int start) {
        // TODO Auto-generated method stub
        return favector.indexOf(prefix, start);
    }

}

Tags: BlackBerry Developers

Similar Questions

  • Firefox 38.0.1 window resized with menu bar problem

    After update to 38.0.1, I have the active menu bar, and I have a problem with the firefox window, changing size when displaying pages. The entire window jitters then I lose the bar menu at the top of the tab bar. at this point, I can't click or enter data into a web page. If I select the border of the window and resize or move the window back to its original with the menu bar size and displayed correctly tabs.

    I also developer of Firefox v 40.a02 it was OK last week I was last updated on 29/05 and now also has the same problem.

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem.

    • Put yourself in the DEFAULT theme: Firefox/tools > Modules > appearance
    • Do NOT click on the reset button on the startup window Mode safe

    You can try to disable hardware acceleration in Firefox.

    • Tools > Options > advanced > General > Browsing: "use hardware acceleration when available.

    You will need to close and restart Firefox after enabling/disabling this setting.

  • Menu navigation problem

    I create a website for my fire department. http://www.newhartfordfire.com

    It has six pages: home, about us, membership, cameras, contact us (the last three are under construction).

    Who we are drops to another page and this page leads to three others.

    Members drops down for more than three pages.

    When you enter the site, if you click on membership, camera, or communicate with us, nothing happens.

    If you click on About Us, that open and then allow the membership, devices, pictures and contact us to meet the "mousing" or by clicking on.

    I tried to make the large menu, thinking that they could be a sweet spot that the mouse has hit to activate the last 4 buttons, but that did not work.

    How can I make sure all the buttons act independently without having to click on 'About Us '?

    It seems that there are some items on the top menu with which it does not. Could you please check if there is an additional element in the menu?

  • list drop-down menu-margin problem

    Hi all.  I need help with this drop "portfolio".  I don't want the space between each item in the list when the subNav goes down. I'm puzzled.

    http://carriecoren.com/test/print.html

    Thanks for your help!

    In http://carriecoren.com/test/css/styles2.css

    Try adding the margin-bottom: 0;

    #nav2 .subNav li {}

    float: none;

    background-color: #8D282D;

    / * opacity: 0.7;

    filter: alpha (opacity = 80); * /

    padding-top: 7px;

    padding-right: 10px;

    padding-bottom: 15px;

    padding-left: 10px;

    left margin: 22px;

    Width: 114px;

    height: 100%;

    margin-bottom: 0;

    }

  • Help with timeline Navigation problem

    Here's my problem: I created a simple Flash slideshow with buttons that play the slides, stop reading and also the following buttons and back head.

    They are all on the layer buttons and they work perfectly.

    I also have another button that takes the read head to a small sequence that is at the end of the original timeline.  The first image of this little sequence has a label which indicates the button.  Still no problem.  This new button does what it is supposed to do.

    My problem came in when I finally decided that I wanted to last image in the sequence to return the read head to one specific image... other than the first frame.  When I added the code: gotoAndStop (2), or gotoAndPlay (2), the playhead is indeed in the second image, but for some reason, it disables the code that controls the other buttons.

    When I remove the code in that last picture, all buttons work fine.  Add it disqualifies the code for the other buttons.

    Can someone help me understand why this happens?  Also, can you offer a suggestion about how to cause the final image to move the playback cursor to a framework designated without undoing other control buttons?

    Thanks in advance for your help,

    Chris

    When your last image code runs any cheek image that includes all your buttons?  If so, you will need to re-run your managers of button for all the buttons that exist is not (even if only temporarily).  and you will need to run these managers when your buttons exist (again).

  • Problem with the Position of the Menu Navigation (Dreamweaver CS5)

    Hello everyone,

    I'm having a problem setting my navigation menu. A major problem, with hours of frustrating, especially as a result of which is the first site I ever developed using dreamweaver.

    I created my banner and menu navigation as a whole image, and I slit upwards to place on my site. I started to follow closely many tutorials, however, there are almost nothing, if at all anything, to guide me in the way to get my navigation menu close enough of my banner, so he can still come off as a single image.

    Here's the site I'm working on myself: www.praxart.com

    I do not know what you guys would like to know specifically about the site itself, but if it's any help, the way the menu navigation/banner is supposed to look is here:

    http://I54.Tinypic.com/2igen95.jpg

    If you want to code HTML and CSS coding, I'll be happy to provide. I am in such utter confusion, however, about how to get this task performed. Any help would be much appreciated. Thank you!

    Hello

    you want to use a 'Spry-MenuBarHorizontal', okay? I don't see evidence for it in your source code. Normally I use to get this (translated from my German Dw):

    Insert > Spry > menu bar (horizontal or vertical) > OK.

    Hans-Günter

  • Problems with the navigation links in EDIT mode in the Business Catalyst Muse sites.

    Has anyone else had problems with the navigation links / EDIT mode in sites Business Catalyst Muse?

    In EDIT mode, I can't use the list drop DOWN the SELECT DIRECTLY to go to another page or a link. The drafting of the text or label works, but to actually go to a /visit link a hard link is broken.

    Screen Shot 2015-08-15 at 3.39.42 PM.png

    Others have this problem as well.

    No work around?

    Thank you!

    I have the same problem! Contact BusinessCatalyst today taught me that it is a known bug and have Adobe Muse to fix! LiveChat ticket No. #159685

    When I launched the Web site in may 2015 everything worked well, but since the update of CC, this problem occurred.

    The tip of solution, I received the BC is to always use the navigation menu bar. This does not work for me because my client wants a menu of polaroid...

  • Navigation menus with drop downs-problem with the home page

    I have my site set up with a navigation menu that includes several items that have submenu items that appear on the overview. Is there a a way to make these pages unclickable, which means that users can choose only one of the submenu items?

    Hello TracyB1974,

    I think that you want the item in the submenu to show, but you don't want it to be clickable.

    If this is the case, you can try following:

    • Go to the plan view
    • Right click on the page you want to be clickable.
    • Select Menu > Include page without hyperlink

    This will create the menu item in a submenu, but she will not be linked to any page.

    Kind regards

    Vivek

  • How paste an accordion MENU navigation on a mobile scrollbar page and make it work properly? Like I can't pin, I keep it at the top of the page with scroll effect 0. It collapse, shows the menu buttons but does not close back up once reached the

    How paste an accordion MENU navigation on a mobile scrollbar page and make it work properly?

    Like I can't pin, I keep it at the top of the page with scroll effect 0.

    It collapse, shows the menu buttons but does not close back once it reaches the anchorpoint.

    Appreciate your help. Thanks.Guess I need to find another solution. Am an artist and don't know anything about coding.

  • Problem with GRID NAVIGATION EFFECTS WITH JQUERY

    Hi all

    Im having a problem with this gallery of images with the navigation (see link below to see the demo running). Try to use the style of "Place in line", I'm having problems to make the function work. I have the images and set up the fine but the actual service/navigation does not work. I downloaded all the relevant files to my computer but nothing happens when I click on the arrows. All 20 images also show instead of just the 2 rows of 3? There should be 2 rows of 3 iamages showing so when you click on the arrows the two lines are represented and so on.

    http://tympanus.NET/Codrops/2011/06/09/grid-navigation-effects/

    This is the code I have-

    < ! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional / / IN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > ""

    " < html xmlns =" http://www.w3.org/1999/xhtml ">

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; Charset = UTF-8 "/ >"

    < title > my < /title > Gallery

    < link href = "stylesheet.css" rel = "stylesheet" type = "text/css" / > "

    < link href = "gridNavigation.css" rel = "stylesheet" type = "text/css" / > "

    < link href = "reset.css" rel = "stylesheet" type = "text/css" / > "

    < style type = "text/css" >

    {body

    background-color: #000000;

    }

    a: link {}

    text-decoration: none;

    color: #f1d379;

    }

    a: visited {}

    text-decoration: none;

    color: #f1d379;

    }

    a: hover {}

    text-decoration: none;

    color: #9d6f1b;

    }

    a: active {}

    text-decoration: none;

    color: #f1d379;

    }

    < / style >

    "< script type =" text/javascript"src="scripts/jquery-1.6.1.min.js "> < / script >

    "< script type =" text/javascript"src="scripts/jquery.easing.1.3.js "> < / script >

    "< script type =" text/javascript"src="scripts/jquery.mousewheel.js "> < / script >

    "< script type =" text/javascript"src="scripts/jquery.gridnav.js "> < / script >

    < script type = "text/javascript" >

    {$(function()}

    $('#tj_container').gridnav ({}

    type: {}

    lines: 2.

    mode                    : 'rows',                               // use def | fade | seqfade | UpDown | sequpdown | showHide | Scatters | lines

    Speed: 1000, / / for fade, updown, sequpdown, seqfade, showhide, disperse, lines

    easing: "easeInOutBack", / / for fade, updown, sequpdown, seqfade, showhide, disperse, lines

    factor: 150, / / seqfade, sequpdown, lines

    reverse: "/ / for sequpdown

    }

    });

    });

    < /script >

    < / head >

    < body >

    < div class = 'container' id = "container" >

    < div id = "navbar" class = "#navbar" >

    < ul >

    < li > < a href = "index.html" > homepage < /a > < /li > ""

    < li > < a href = "about_me.html" > about me < /a > < /li > ""

    < li > < a href = "gallery.html" > Gallery < /a > < /li > ""

    < li > < a href = "contact.html" > Contact < /a > < /li > ""

    < /ul >

    < / div >

    < div class = "tj_nav" >

    < span id = "tj_prev" class = "tj_prev" > </span > previous

    < span id = "tj_next" class = "tj_next" > next </span >

    < / div >

    < div class = "tj_wrapper" >

    < ul class = "tj_gallery" >

    < li > < a href = "#" > < img src = "images/1.jpg" alt = "image01" / > < / has > < /li > "

    < li > < a href = "#" > < img src = "images/2.jpg" alt = "image02" / > < / has > < /li > "

    < li > < a href = "#" > < img src = "images/3.jpg" alt = "image03" / > < / has > < /li > "

    < li > < a href = "#" > < img src = "images/4.jpg" alt = "image04" / > < / has > < /li > "

    < li > < a href = "#" > < img src = "images/5.jpg" alt = "image05" / > < / a > < /li > "

    < li > < a href = "#" > < img src = "images/6.jpg" alt = "image06" / > < / a > < /li > "

    < li > < a href = "#" > < img src = "images/7.jpg" alt = "image07" / > < / a > < /li > "

    < li > < a href = "#" > < img src = "images/8.jpg" alt = "image08" / > < / has > < /li > "

    < li > < a href = "#" > < img src = "images/9.jpg" alt = "image09" / > < / a > < /li > "

    < li > < a href = "#" > < img src = "images/10.jpg" alt = "image10" / > < / has > < /li > "

    < li > < a href = "#" > < img src = "images/11.jpg" alt = "image11" / > < / a > < /li > "

    < li > < a href = "#" > < img src = "images/12.jpg' alt = 'image12' / > < / a > < /li >"

    < li > < a href = "#" > < img src = "images/13.jpg" alt = "image13" / > < / has > < /li > "

    < li > < a href = "#" > < img src = "images/14.jpg" alt = "image14" / > < / a > < /li > "

    < li > < a href = "#" > < img src = "images/15.jpg" alt = "image15" / > < / a > < /li > "

    < li > < a href = "#" > < img src = "images/16.jpg" alt = "image16" / > < / a > < /li > "

    < li > < a href = "#" > < img src = "images/17.jpg" alt = "image17" / > < / a > < /li > "

    < li > < a href = "#" > < img src = "images/18.jpg" alt = "image18" / > < / a > < /li > "

    < li > < a href = "#" > < img src = "images/19.jpg" alt = "image19" / > < / a > < /li > "

    < li > < a href = "#" > < img src = "images/20.jpg" alt = "image20" / > < / a > < /li > "

    < /ul >

    < / div >

    < / div >

    < / body >

    < / html >

    Don't know what example you use, but it looks like you missed two important in your code that surround the main

    :

    If the case of the example of five:

    INSERT HERE THE MAIN STUFF

    I don't know if its my computer or not, but I found the animation a bit flaky.

  • problems with the navigation tool

    why I can't go beyond 500% with the navigation tool. I get a screen effect.

    Hello, you see the pixel grid. You can disable it in view > Show > pixel grid

  • Menu navigation drop-down Menu

    I am new to Dreamweaver CS6 and as I go along in the design of a learning site. Here is the link to see the navigation menu, with the list in the menu which runs through in columns and rows and a black line that appears when the mouse passes over a menu drop-down. I tried to create the same look but couldn't and am stuck. Spry has been used and how to create the list in columns and rows in the menu drop-down? Or was this done using a jQuery template (what jQuery sites)? Your help would be greatly appreciated.

    http://www.perennialsfabrics.com/

    This isn't a Spry menu.  It's a mega Menu reagent system that seems to be part of a framework of Bootstrap.

    In all cases, you can not do with Spry.  Also Spry is now obsolete as Adobe he abandoned last year.

    Try this:

    http://www.designchemical.com/lab/jQuery-mega-drop-down-menu-plugin/examples/

    Download link:

    http://www.designchemical.com/lab/jQuery-mega-drop-down-menu-plugin/download/

    Nancy O.

  • Menu overlapping problem...

    Hi Andy,.

    In our application, we have components that are created dynamically. Everything that we have in the list drop-down and corresponding to the list of names is dynamically...

    We are not able to hide the list of the menu... like this ovelapping drop...


    can u help me with this...


    David...

    Hi David,

    This link uses exactly the same method as the Milonic one:

    >
    All that is necessary is to add an iframe base before the ul dropdown and style it with a size that covers the area of selection, this iframe is visible only through IE5.x and IE6. Simple.

    Tested in IE6, IE7, Firefox, Opera and Safari (PC)
    >

    Thus, in both cases, there is an IFRAME element that lies behind the menu and allows to cover the selection lists.

    The sample page that I sent you already did this, but I still have problems which rejected the menu using onmouseout. I'll take a look at their code to see if we can use something similar. CSSplay.co.uk is always a good source fo all css

    Andy

  • How can I add a program to my list 'open with '?

    On my XP, I right click a file and clicking 'open with '.

    The list of programs does not include Frontpage.

    How can I include Frontpage, I use frequently on my list 'open with '.

    Thank you very much.

    A big thank you to everyone who helped me to solve this problem.

    I followed this path - opens My Documents - selected a file that happened to have the extension .mht. > Click right file > openwith > choose program > Browse > Program Files > Double click Microsoft Office > Double click Office11 > Double click Frontpage.Exe. I now have Microsoft Frontpage on my 'open with' drop-down list.

    I can't tell you how much it is great to have succeeded because of the help that I received from you all.

  • I lost the connection between the icons on the desktop and the program. When I click on an icon, I get the OPEN WITH menu.

    I click right-properties and I get C:\Windows\system32\rundll32.exe Application not found.

    I tried to download fixit and got the OPEN WITH menu.

    It sounds like your .lnk and/or your .exe file associations may have been lost.

    You can try to fix the ".exe" and ".lnk" file associations:
    'Windows XP file Association problems'
      <>http://www.dougknox.com/XP/file_assoc.htm >

    or you can try to do a system restore to a point in time before you had this problem:
    "How to restore Windows XP to a previous state"
      <>http://support.Microsoft.com/kb/306084 >
    If you have a .exe association problem, you may need to run the restore of the system from the command prompt:
    "How to start the System Restore tool by using the option of safe mode with the command prompt in Windows XP"
      <>http://support.Microsoft.com/kb/304449 >

    HTH,
    JW

Maybe you are looking for

  • iPhone 6 will not connect to iTunes

    Hi all! Here's my problem: my iPhone 6 (iOS 10.0.1) does not connect to my iTunes (11.4) on my Macbook Pro (2008) 10.6.8 running. The message I get is: "iTunes could not connect to the iPhone 6 because an invalid response was received from the device

  • MI compu falla cuando the pongo a charged encencida

    MI number are Maria Guadalupe Rosa hace a my compre una laptop lenovo pero me falla cuando pongo one prendida so while loading the apago y conecta carga perfectly pero burning none... fled was tienda donde the want y me dijeron that era con directo m

  • error (2738) WeatherBug Setup requires VB Script. Please activate the VB script. My computer is Windows Vista, I use Explorer 9,

    Weatherbug desktop for years, I had one day that the icon has beenwent, I might not bring up weatherbug.I went to your web site to re-download, but I received thiserror (2738) WeatherBug Setup requires VB Script. Please allow VBwriting scripts.My com

  • HP Envy 4504 does not print black

    Hello I just installed my new HP's Envy 4504 for printing through Google Cloudprinting that I am a user of chromebook, but encounter the following problem. Printing from my chromebook works very well... in color, but not in black and white. The cartr

  • the NVIDIA driver updates do not work on hp 9228

    Hi all Can you please provide assistance as follows... I have a portable hdx 9228 running windows 7 (1) 64-bit s.p. The 9228 came home with 32-BIT VISTA (OEM), however, for windows 7, 64-bit Iupgraded about 2 years ago. After the upgrade, I started t