ListField and table LayoutManager

Hello.

I think that maybe that's my problem.

I make use of this TableLayoutmanager (that I found on this site):

public class TableLayoutManager extends Manager{ public TableLayoutManager(){ super(0); }     public void drawRow(Graphics g, int x, int y, int width, int height){ // Arrange the cell fields within this row manager. layout(width, height); // Place this row manager within its enclosing list. setPosition(x, y); // Apply a translating/clipping transformation to the graphics // context so that this row paints in the right area. g.pushRegion(getExtent()); // Paint this manager's controlled fields. subpaint(g); g.setColor(0x00CACACA); g.drawLine(0, 0, getPreferredWidth(), 0); // Restore the graphics context. g.popContext(); } protected void sublayout(int width, int height) { // TODO Auto-generated method stub int preferredWidth = getPreferredWidth(); int preferredHeight = getPreferredHeight(); Field field = getField(0); layoutChild(field, preferredWidth - 110, preferredHeight); setPositionChild(field, 35, 12); field = getField(1); layoutChild(field, 75, preferredHeight); setPositionChild(field, preferredWidth-75, 11); setExtent(preferredWidth, preferredHeight); } public int getPreferredWidth() { return Graphics.getScreenWidth(); } // The preferred height of a row is the "row height" as defined in the // enclosing list. public int getPreferredHeight() { return getContentHeight(); } }

for this ListField:

public class MenuListField extends ListField implements ListFieldCallback { /* * This code created based on rtm4bb HomeMenuListField.java */ private Font font; TableLayoutManager[] rows; public MenuListField(){ // this number should be the same with rows = new TableRowManager[7] // or list item in item field wont show super(9); setEmptyString("sorry, No Menu", DrawStyle.HCENTER); setCallback(this); // this row height to show the height setRowHeight(36); font = Font.getDefault(); rows = new TableLayoutManager[9]; // create a table row manager rows[0] = new TableLayoutManager(); // set the menu item name rows[0].add(new RichTextField("Computer Literacy", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[0].add(new LabelField("All our Computer Literacy Options", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[0].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[1] = new TableLayoutManager(); // set the menu item name rows[1].add(new RichTextField("Office Assistant", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[1].add(new LabelField("Secretarial Courses", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[1].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[2] = new TableLayoutManager(); // set the menu item name rows[2].add(new RichTextField("Pastel", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[2].add(new LabelField("Pastel Options", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[2].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[3] = new TableLayoutManager(); // set the menu item name rows[3].add(new RichTextField("Technical", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[3].add(new LabelField("Technical Courses", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[3].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[4] = new TableLayoutManager(); // set the menu item name rows[4].add(new RichTextField("Graphic Design", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[4].add(new LabelField("Graphic Design Courses", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[4].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[5] = new TableLayoutManager(); // set the menu item name rows[5].add(new RichTextField("IT", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[5].add(new LabelField("Our IT Options", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[5].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[6] = new TableLayoutManager(); // set the menu item name rows[6].add(new RichTextField("Web Design", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[6].add(new LabelField("Web Design Courses", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[6].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[7] = new TableLayoutManager(); // set the menu item name rows[7].add(new RichTextField("Programming", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[7].add(new LabelField("Our Programming Options", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[7].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[8] = new TableLayoutManager(); // set the menu item name rows[8].add(new RichTextField("Business Admin", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[8].add(new LabelField("Business Oriented Courses", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[8].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[9] = new TableLayoutManager(); // set the menu item name rows[9].add(new RichTextField("Two Year", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[9].add(new LabelField("Two Year Courses", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[9].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); } public void drawListRow(ListField listField, Graphics graphics, int index, int y, int width) { // TODO Auto-generated method stub MenuListField list = (MenuListField) listField; TableLayoutManager rowManager = list.rows[index]; rowManager.drawRow(graphics, 0, y, width, list.getRowHeight()); } public Object get(ListField listField, int index) { // TODO Auto-generated method stub return null; } public int getPreferredWidth(ListField listField) { // TODO Auto-generated method stub return Graphics.getScreenWidth(); } public int indexOfList(ListField listField, String prefix, int start) { // TODO Auto-generated method stub return -1; } protected boolean trackwheelClick(int status, int time) { int index = getSelectedIndex(); // Dialog.inform("Clicked " + Integer.toString(index)); /*if( index == 0 ) { new MenuCategoryController(); } */ switch(index) { case 0: UiApplication.getUiApplication().pushScreen(new ComputerLiteracyScreen()); break; case 1: UiApplication.getUiApplication().pushScreen(new OfficeAssistantScreen()); break; case 2: UiApplication.getUiApplication().pushScreen(new PastelScreen()); break; case 3: UiApplication.getUiApplication().pushScreen(new TechnicalScreen()); break; case 4: UiApplication.getUiApplication().pushScreen(new GraphicDesignScreen()); break; case 5: UiApplication.getUiApplication().pushScreen(new ITScreen()); break; case 6: UiApplication.getUiApplication().pushScreen(new WebDesignScreen()); break; case 7: UiApplication.getUiApplication().pushScreen(new ProgrammingScreen()); break; case 8: UiApplication.getUiApplication().pushScreen(new BusinessAdminScreen()); break; case 9:      UiApplication.getUiApplication().pushScreen(new TwoYearScreen());   break; } return true; } }

And I call it like:

 MenuListField mylist = new MenuListField();

Now my app keeps throwing errors IndexOutOfBounds.

I've implemented the table layout manager properly?

Hannes

In your situation, I think that most of the BlackBerry users expect to see a drill down, where they see a list of courses in a ListField, then click on the course to see more detail for this course in a different window.

Tags: BlackBerry Developers

Similar Questions

  • Materialized view and Table

    Dear friends,

    A quick question...

    If the name of the materialized view and table name is same truncate table data truncates too materialized view?

    Thanks /.

    kumar73 wrote:
    Dear friends,

    A quick question...

    If the name of the materialized view and table name is same truncate table data truncates too materialized view?

    Thanks /.

    If the materialized view is built on the table and the Table is truncated data will continue to reside in the MView as long as it is not refreshed.

    Once you refresh the MView, data must disappear.

    With MView and Table names even, does not affect.

  • Using OBIEE 11 G with display of the narrative report and table

    Hello

    I have a report designed as the below, I used 'narrative view' for details of the customer and "table view" for the details of the order. In the narrative view, I can say = 1 line and it picks up the first customer detail record, but the details of the order shows all lines. How can I control it for details of the command displays only the detail of the associated client record. Also how can I go to the second record and so forth. Help, please. If this is not possible and there is no substitutes, let me know. Thanks for your time and your help.

    Customer number:
    Customer name:
    Customer address:

    Details of the order:
    Line number | Order No. | Order description. Status of orders

    Hmm, try this:

    (1) create a PivotTable.

    (2) put the customer number, customer name and address of the customer in the area of the Sections. Make sure each column begins "in a new line.

    (3) in the lines section, put the line number, order number, order Description and status of the orders. Put your measurement in the section measures.

    (4) in the properties of a pivot table, he paused after each change of customer number.

    Then break your PDF files on a new page for each customer. The details of each customer's order must be only for each customer.

  • BAD RESULTS WITH OUTER JOINS AND TABLES WITH A CHECK CONSTRAINT

    HII All,
    Could any such a me when we encounter this bug? Please help me with a simple example so that I can search for them in my PB.


    Bug:-8447623

    Bug / / Desc: BAD RESULTS WITH OUTER JOINS AND TABLES WITH a CHECK CONSTRAINT


    I ran the outer joins with check queries constraint 11G 11.1.0.7.0 and 10 g 2, but the result is the same. Need to know the scenario where I will face this bug of your experts and people who have already experienced this bug.


    Version: -.
    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for Solaris: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production

    Why do you not use the description of the bug test case in Metalink (we obviously can't post it here because it would violate the copyright of Metalink)? Your test case is not a candidate for the elimination of the join, so he did not have the bug.

    Have you really read the description of the bug in Metalink rather than just looking at the title of the bug? The bug itself is quite clear that a query plan that involves the elimination of the join is a necessary condition. The title of bug nothing will never tell the whole story.

    If you try to work through a few tens of thousands of bugs in 11.1.0.7, of which many are not published, trying to determine whether your application would be affected by the bug? Wouldn't be order of magnitude easier to upgrade the application to 11.1.0.7 in a test environment and test the application to see what, if anything, breaks? Understand that the vast majority of the problems that people experience during an upgrade are not the result of bugs - they are the result of changes in behaviour documented as changes in query plans. And among those who encounter bugs, a relatively large fraction of the new variety. Even if you have completed the Herculean task of verifying each bug on your code base, which would not significantly easier upgrade. In addition, at the time wherever you actually performed this analysis, Oracle reportedly released 3 or 4 new versions.

    And at this stage would be unwise to consider an upgrade to 11.2?

    Justin

  • Is automatic and Table numbering in the Document to multiple sections

    I want to set up automatic figure and table numbering that includes a reference to the current section number. (Figure 2-1 = the first figure in article 2; Table 3-2 = the second table in Section 3). I understand how to do this with styles if I had to work with a collection of documents with defined chapters. How can I do this in a single document with a number of defined in section?

    Is the only way to define the styles in the list for my items?

    I'm afraid you're right. You can include the numbering of the chapters in style with the numbered list, but you cannot include section prefixes. I think that you will have to use the method you suggested.

  • How to set different fonts for numbers in the titles and tables of contents

    Hello

    I noticed some people to use a different font for the numbers in the titles and tables of contents to get an extra magic. Is it possible to automate the use of fonts in paragraph styles?

    Oh and suggestions on which fonts would be a good thing for numbers?

    Thank you!

    Furthermore, you must doany of this fancy stuff if you use an OpenType font that made OSF glyphs (and if you are not you will need to set the font as part of your style). Just head on to the style definition and enable OSF there OpenType features section.

  • Dissappearing glossary and table of contents

    I use Robohelp 7 for the first time (I used before V6), and I have a problem with my glossary and table of contents. I created the two - and they appear when I generate and publish, but I can't understand how do seem to be edited.

    If I click on in the project manager (they are each listed as helpSysName (Default), if that makes a difference) and then select Edit - nothing seems to happen.

    Thank you, thank you, thank you! The default loading environment did the trick.

    I thought it should be included in a pod somewhere, but I don't couldn't find it. Very frustrating. Thanks for saving me from that.

    Gail

  • Merits and demerits of the replication of schema-level and Table

    Hello

    We evaluate the streams for our needs of replication. We reproduce nearly 2000 two-way tables. Most of the tables are in a schema. The main schema has a few tables that are not replicated.

    Replicate us schema level? Or at the level of the table? What are the advantages and disadvantages?

    Replication of level schema included with a handful of exclusionary rules seems simpler.

    In water courses at the level of the tables as well as creating 2000 table rules in the beginning, add a new table to an existing configuration of streams, will require additional steps to stop capture/apply/spread, creating new rules for the new table and restart replication. However, it seems that level replication table offering flexibility in terms of group tables. We wanted to group tables about 10 groups of 20 to 300 tables in each group. Each group will have its own capture, propagate and apply. In this way, we can isolate large groups of those unimportant?

    Who is a better setup in terms of maneuverability, flexibility, parallelism and performance?

    Thank you.

    Hello Stargaze,

    OK, so I understand that the grouping is based on the type of transactions and its importance. In this case the grouping would help you in many ways such as:

    1. If you encounter a problem or a bug with one of the processes of capture/apply then the other groups would work fine. Therefore, you have the opportunity to shoot a game of capture, propagation and applies until solve you the problem.

    2. in case if you perform any load batch where the transaction will affect over 10000 + records then it is possible that you could get stuck at 'SUSPENDED for FLOW CONTROL' on any of the feed items. With different groups would give you more flexibility to solve this problem by activating and deactivating groups.

    For more information on this please check the following:

    Apply process is active, inactive, and just stopped in change application

    3. with the schema level replication even if you have the advantage of being simple and have fewer rules in the set of rules, you must consider the 2 points above before you implement it. You need to test both diagrams and tables with a typical load (simulation of the production) and need to identify potential problems in both. Some more points to consider:

    -apply the game patches 10.2.0.4 or at least 10.2.0.3
    -apply all the patches required streams (Note: 437838.1> on metalink)
    -follow the recommendations as indicated:
         Note: 418755.1 broadcast 10.2.0.x.x of recommendations
         Note: 335516.1 Performance of flow recommendations
    Note: 413353.1 10.2 best practices for streams in RAC environment

    Thank you
    Florent

  • empty space between the header and table

    The use of Pages 5.6.1 seems be stuck with several inches of space between my head, which took half an hour to learn how to create, and the table below.  I've been using Pages for more than a decade and wonder ' what is happening with me and Pages!  Is this the end?

    Your totally full, and a familiar friend Pages ' 09 v4.3 may very well be you waiting in your Applications: iWork ' 09 file. Use what's familiar and better documented. Pages v5.6.1 is the latest in a bag of 2 years of suffering that has imposed the frustration, loss of features, bugs, and lost time to almost everyone who used it.

  • TO RESET THE GRAPH AND TABLE SEQUENCE EVEN STRUCTURE IS NOT EXECUTED.

    Hello everyone, I made this vi which runs automatically at the beginning and I can't use my power butoon to control this vi. Now, I want to clear the table and graph vi even when the structure of sequence is not executed as the start/stop button. And I want also when I run the program both the graph and the table should be cleared. I tried a lot of things, but as I'm new to labview I can't do. Thanks in advance.


  • MS Office report Express VI and table problem

    Hi all

    I have a strange problem with MS Office report VI, which is included with the report generation tool. I created an Excel template that I linked, according to the preference "Custom template for Excel" and all the named ranges. However, two of the named ranges that I entered are 1 d arrays of doubles. Now the problem:

    When I entered the berries to their specific name range (it's only 6 values), instead of simply enter the values in the table in the cells he entries like this:

    A value of 0

    1 value

    2 the value

    ...

    6 value

    He pushes the 'value' to the column next to the beach of name because of 0-6.

    He does it with two tables so it screws to the top of all formulas. Anyone know how to remove the 0-6 and simply enter the values?

    Thank you all

    The Express VI are easy and convenient, but some costs. Since the Express VI can also accept a waveform entry, you have to accept that it will add a channel name.

    With the tool report generation (who are also its limits), it's easy to add only the data you want:

    Ben64

  • BUG: 1 D table sort isn't sorting table of Classes and table Clusters contain Classes

    the function "sort the table 1 d.

    I wanted to sort the array of Clusters [number and class]. But to my surprise, LV is not like him.

    Okay, I need sort table Classes. But maybe once in the future I will. :-)

    'Research in table 1 d' is the use of classes I do not understand why 'sort the table 1 d' does not work.

    This problem is in LabVIEW 8.2 and 8.5 2009

    I think that the search feature of table 1 d can address each element in the table as an agregate whereas sort requires access to the private data in the data from the class and carrying it even further...

    Say all the elements are in the Parent class and a tow children who both have private data that are uniqie each and not present in the class of parents...

    How they manage breaking when there are different fields to sort on?

    Ben

  • Tables and table data

    Hello-

    How is it when I create a node of a table property value and build a table of this node of property value, it gives me an annexed table?

    I tried indexing in this table twice for a single row of values, but when I try to compare the 1 index of this row in the table with the

    first index value from an array of the same size, the equal sign will not indent the table created index from the table. I see that the

    output wire is pink, which means that the value is considered as text... How can I convert that to a number so that I can compare the first value of a line

    in a table of the first value of a picture of a line to determine if they are equal? Array index is fed data points from

    a graph and once this 1st value of the array index is the first index value of the row in the table, I hope to have the index given in the table

    turns green when there is a football game. Thank you.

    Hello

    I'm not absolutely sure I knew you. Displaying a VI or a screenshot could be useful...

    However, attached, you will find a simple VI compare the first value of a table wanted the first value of a table row.

    Note that the table data type is string, not digital. No matter if you put numerical values in the table there are always string. A conversion is necessary to compare the values in array of numeric values.

    The values in the table are displayed as a 2D array in which the first dimension contains the lines (x).

    I hope I could help you with that.

  • How to hide Cluster and table nested layers

    Hello

    How we hide "layers" of clusters and berries. I tried with the range of tool with transparency, but it does not hide the overlay to imbrecated. How can I make everything look flat?

    Thank you

    What does "imbrecated" mean?

    Try to use the classic style for container controls and digital table.  When you use the transparent color on them, they will disappear.

  • screen flickers and the game stops, and table appears all playing the cfs3 game

    Original title: cfs3 crashes to the desktop

    Hi, a friend gave me used fcs3. It installed fine, everything works fine, but after 30 to 60 minutes, the screen flickers and the game stops, and my table is displayed. I get no error message at all and I went topics in microsoft help for cfs3 specific website if overwrite problems cfs3, which there was a huge page full of symptoms and types of accident etc but since I got no error message number refer to I have read the whole search'm thiing and the causes and resolutions , but found nothing there.

    I tried to restart and the program should run for a while then crash and return to the table.

    I tried uninstalling and reinstalling, but I got the same results.

    HP a6110n

    AMD Athlon 64 x 2 Dual Core processor 4400 + 2.30 GHz

    RAM = 4.00 GB

    32-bit operating system

    Note Windows experience 4.9

    80% of my disk space is available.

    Also the power supply 450w

    Map of Envidea 8600

    Whole body there suggestions?

    Thank you, Ed S.

    Hi P.K.

    The information and links have been informative and educational and I'll save that for a later use. However, the graphics card was the problem (I discovered) so I'm upgrading and also I move FSX on my new pc (a pc gamer VELOCITY) and it works perfectly. Thanks again for your contribution.

Maybe you are looking for

  • Keyboarrd on my Satellite C660-15r really unresponsive

    Hello hopiing can anyone helop, it drives me crazy.I'm a pretty good typist but it's all the hll goone since I got my Satellite C660-15r.As you can se, the keyboard eiter ignores letters I typd or highlights twice. Please tell me the easy way theere

  • I would like an answer please

    After reading another post, it has come to my attention that Motorola never (that I can find) is the claim that the Xoom would support an SD card. During my research for this, I discovered that the support of CD and DVD writer also fell from lists of

  • Color LaserJet Pro 200: Scanner unavailable

    Ever sinc update the firmware on my printer, I had two problems.  The first problem is that the power button is now flashing after a prolonged peiord of inactivity.  I cannot print unless I push the power button flashes and it becomes solid. The bigg

  • Pavilion a6200n: Pavilion a6200n video card upgrade

    I have a Pavilion a6200n that I'm fixing to the top for my son. I want to upgrade the video card to something like that "EVGA GeForce 210 Passive 1024 MB DDR3 PCI Express DVI/HDMI/VGA USB2.0 graphic card" I know that I need to upgrade the PSU also, b

  • CND5221T73: Wndows not controllable 10 graphics

    I posted this question in English on the Portiguese forum. So maybe that's why no one answered it o.o Anyway, here it is again. Hello I just bought a HP Notebook CND5221T73 with that came with Windows 8 and a free update of Windows 10 I have installe