Someone please send me an example how to implement the sublayout method

 public void displist(StringTokenizerDemo refdata)
   {

       /*while(refdata.hasMoreTokens())
       {
           refdata.nextToken(); // Consume unwanted input
           String modelName = refdata.nextToken().trim();
           refdata.nextToken();
           refdata.nextToken();
            listField.add(modelName);

       }*/

       while(refdata.hasMoreTokens())
       {
           String temp = refdata.nextToken().trim();
           String pressure = refdata.nextToken().trim();
           Object[] row = {temp, pressure};
           _tableModel.addRow(row);          

       }
       TableView tableView = new TableView(_tableModel);
       tableView.setDataTemplateFocus(BackgroundFactory.createLinearGradientBackground(Color.PURPLE, Color.PINK, Color.YELLOW, Color.RED));
       TableController tableController = new TableController(_tableModel, tableView);
       tableController.setFocusPolicy(TableController.ROW_FOCUS);
       tableView.setController(tableController);

       DataTemplate dataTemplate = new DataTemplate(tableView, NUM_ROWS, NUM_COLUMNS)
       {
           /**
            * @see DataTemplate#getDataFields(int)
            */
           public Field[] getDataFields(int modelRowIndex)
           {

               Object[] data = (Object[]) (_tableModel.getRow(modelRowIndex));
               Field[] fields = { new LabelField((String) data[0]), new LabelField((String) data[1])};
               return fields;
           }
       };

       dataTemplate.useFixedHeight(false);

       // Define regions and row height
       dataTemplate.setRowProperties(0, new TemplateRowProperties(ROW_HEIGHT));
       for(int k = 0; k < NUM_COLUMNS; k++)
       {
           dataTemplate.createRegion(new XYRect(k,0,1,1));
           dataTemplate.setColumnProperties(k, new TemplateColumnProperties(Display.getWidth()/NUM_COLUMNS));
       }

       // Apply the template to the view

       tableView.setDataTemplate(dataTemplate);
       vfm.add(tableView);
       filteredList.addDataSet(0, temperature, "Temperature", BasicFilteredList.COMPARISON_IGNORE_CASE);         

       // Create AutoCompleteFields

       AutoCompleteField autoCompleteField = new AutoCompleteField(filteredList, AutoCompleteField.LIST_STATIC | AutoCompleteField.LIST_DROPDOWN);

       // Add the AutoCompleteFields to the screen           

       //add(new LabelField("Choose a Value"));
       vfm.add(autoCompleteField);

   }

In my application I am stretching from Verticalmanager to my class and display data in tableview.

but the problem is that all the data is displayed with the scroll bar. To get the scroll for the tableview bar

I sends you only (code tableview) if someone meets me, I want to paste all of the code.

Please answer

Please stand to be corrected if I'm wrong, you want to set the height of a manager who is unscrollable, in a Manager, a list field must be added, which is scrollable. First make the screen unscrollable by great call (Manager.No_VERTICAL_SCROLL); Then create a handler, override its methods getPreferredWidth(), getPreferredHeight() and sublayout(), as below:

mainManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL){
            public int getPreferredWidth()
            {
                return super.getPreferredWidth();
            }
            public int getPreferredHeight()
            {
                                // fixed height
                return height;
            }
            protected void sublayout( int maxWidth, int maxHeight )
            {
                super.sublayout(getPreferredWidth(),getPreferredHeight());
                setExtent(getPreferredWidth(),getPreferredHeight());
            }
        };

mainmanager add to your list.

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for

  • RAM for satellite Pro 4280

    HelloMy englich is very, very bad!I have a SP4280 Pro satellite. I'm looking for this laptop RAM operation components. Is there a compatibility list? (Sorry, translate with babelfish :-(( Thank you for the help Roland

  • How do I get the dvd player stills

    How to make a picture of a dvd player?  I tried the break and screenshots, but come with a shot at close range office.  Thank you.

  • Problem with Motocast

    Until today motocast on my Razr Maxx was working properly, but now when I try to access my files on my PC in "my files" app on my phone, it starts the configuration process and said that my email or password has changed! It asks me to login with my p

  • problems to start the windows Defender

    I just installed windows defender and scanned my computer it asked me to restart, I then went to try and open it again and it came with a popup indicating that "this operation has been cancelled due to restrictions in effect on this computer. Contact

  • HP OfficeJet 6500 a Plus E710-n do not recognize ink levels.

    I have some HP 920 ink cartridges refilled at Costco.  Everything works well except the ink level view.  The printer is unable to meet the new levels of ink.  Is it possible to do a "Hard Reset" of the printer to choose charged cartridge levels?  As