call of sublayout

I'm Manager of custom field that has 5 icons arranged horizonally. I see 4 at a time. When the user navigates from one icon to another I need to rearrange icons.

In navigationMovement I put emphasis on the appropriate icon, then call then invalid. However sublayout is not called when overturn, no idea how could invoke the sublayout and reorganize the icons or any approach better to rearrange the icons based on the navigation of the user?

I used updateLayout() to force sublayout to call.

Tags: BlackBerry Developers

Similar Questions

  • Add a field to a manager internal vertical field (vertical field managers are nested) on a screen, will eventually call the sublayout of the screen. Can someone explain the mechanism of notification concerned?

    Hi-

    I have a screen with vertical field managers nested (that is the top of the screen on the display stack) when I add a field for the internal more vertical domain manager, I see that is called the method sublayout of the screen. I understand that we add a field to the vertical field manager and the screen currently, the State of the screen becomes so he made a layout, followed by the painting.

    But I want to know how the screen (or the user interface engine) will know that a field is added to one of its managers of content vertical field (is there a notification for this mechanism). I mean when I add a field to the Interior more vertical field Manager how will be the vertical field Manager that knows a level up to this topic, and finally how the screen also know this about and new provision itself. (The sequence of method calls etc... Will be useful)

    Again this is not breaking anything in my application and everything works as expected, but it will be useful if I can understand the underlying reasons for the above.

    This is my first Forum announcement ever, bear with my presentation (suggestions are welcome).

    Concerning

    Ravi

    each field can call getManager to check if it is added to another Manager. If a field is added to a manager that this Manager notifies its topmanager, it notifies its topmanager etc. until the highest level is reached.

  • Method for the VerticalFieldManager sublayout problem

    Hello

    I need help.

    I have a value for money (VerticalFieldManager) that contains several different fields. My goal is to add a small margin of 10px between all areas. The reason is that the fields are very close together and it doesn't look very good.

    Here is my sublayout of value for money.

    public void sublayout(int w, int h) {
       super.sublayout(w, h);
       Field field;
       //get total number of fields within this manager
       int numberOfFields = getFieldCount();
       for (int i = 0;i < numberOfFields;i++) {
          field = getField(i); //get the field
          int y = 0;
          layoutChild(field, w, field.getHeight()+10); //lay out the field
          setPositionChild(field,0,y); //set the position for the field
          y += field.getHeight()+10;
       }
       super.setExtent(w,h);
    }
    

    The result of this seems ok, but when you scroll down it behaves as expected, so somewhere must be my mistake.

    I know there is the 6.0 API setMargin method, but I need something that will also help for the old OS and I have no idea how to do it.

    Thank you all for the help.

    Jiri

    For the task that you have a default VerticalFieldManager with on the battlefields setMargin is quite sufficient. Although setMargin is only documented in 6.0, we work like this forever - at least 4.2.1 probably even earlier.

    As to why it does not work the way you want it to work: your sublayout must set at least the virtual measure correctly. Now he acts as if USE_ALL_WIDTH | USE_ALL_HEIGHT | NO_VERTICAL_SCROLL | NO_HORIZONTAL_SCROLL all are in force.  The first two are "affected" by setExtent (w, h) instead of accumulated height and maximum width; the last two--using only not setVirtualExtent, which defines the size of managers as opposed to visible size (setExtent) scrolling.

    Play with sublayout without calling super.sublayout is a tedious task; If you want to see some better examples (but not perfect), take a look at the source code of advances of buttons, fields and managers (especially NegativeMarginVerticalFieldManager).

    To jprofitt: getPreferredWidth / getPreferredHeight are totally unnecessary on managers. Framework blackBerry completely ignores these; some fields use their own default dimensions (ButtonField being the most notable example), but it's just as much as those who will go.

    Edit: just noticed something else that is totally wrong with your code: using field.getHeight () before laying on the field! Until the field was laid out, its getWidth and getHeight have both return 0. Yet once again, take a look at what NegativeMarginVerticalFieldManager use as parameters for layoutChild.

  • Each call cause VerticalFieldManager.add (child) to "available" to already added childs method call.

    Is it possible:
    -ban VerticalFieldManager child call "sublayout" at the beginning;
    -Add multiple items;
    -push the VerticalFieldManager to call "sublayout" of all children.

    Here are two possibilities:

    1. Call UiEngine.suspendPainting (true) before adding the items, then call UiEngine.suspendPainting (false) (and perhaps invalidate()) later. Note that UiApplication implements UiEngine. I'm not sure that it works; It can only block calls to object, but it can also block calls to sublayout.
    2. Remove the VerticalFieldManager of his manager (or screen) before adding items. It may be that a Manager will not call sublayout if they belong to a screen.

    If none of these work, you can create a subclass VerticalFieldManager, add an indicator variable that indicates whether sublayout should move forward and then override sublayout in order to respect the flag. You can force a sublayout at the end by calling invalidate().

  • Yet another question about the update with the shutters tab

    I am quite new to this, but I've been scouring the boards and try many different things, and I decided to ask for advice.

    There are other threads similar to my problem such as:

    http://supportforums.BlackBerry.com/T5/Java-development/SetFocus-issue-with-tabbed-screen-page/m-p/6...

    http://supportforums.BlackBerry.com/T5/Java-development/how-to-delete-a-Manager-or-a-field-that-is-c...

    I have a set up tabbed pane based on the example and everything works fine until I have delete a line from a VerticalFieldManager. It is by default the focus on the first item on the screen, and I get this. My problem is trying to substitute or replacement behavior.

    My screen implements the FocusChangeListener for the buttons on the tab (custom LabelFields).

    I tried many different variations - I tried to manage the update completely manual and ended with a bit of a mess. I tried to capture the event navigationUnclick() and coding of the focusChanged() method to manually switch the update, but it seems that the focusChanged() method is called before the focusChanged(), which doesn't help me.

    As I said I am pretty new to this so I could do something very stupid, but I don't really understand the focus handling implementation. A kick in the right direction would be appreciated.

    Thank you.

    You can have a NullField in your managers before all other areas - in this way, even if you delete the rest, the NullField might keep the focus.

    If this does not help, try the substitution of sublayout for your managers, call super.sublayout and then explicitly setFocus to your NullField (the deletion of any field causes a display Manager to rearrange).

  • Personalized 9800 slider TextBoxfield problem

    Hello

    The custom cursor in textboxfield is not properly get updated. When you enter any text instead of display the cursor at the end of a character, it appears after one or two space character to the last character and when you tap on the evolution of the orientation textboxfield then cursor comes to the appropriate position. That is to say at the end of the last character.

    Even when I delete textboxfield characters, it does not move smoothly. It fluctuates as movement before shows and back, space between the cursor and the last character of the text.

    This behavior I've seen that in the BB Torch 9800 (both device and Simulator). Where as the same code works in other devices such as 9700,9000,9550,8520, all are with OS v5.0.

    Here is my Code of TextBoxField:

    public class TextBoxField extends VerticalFieldManager
    {
        //Define some variables to be used
        //in the class
        private int managerWidth;
        private int managerHeight;
        private EditField editField;
        private String iText;
        private Graphics g1;
        private int myBorderColor;
        private int fillColor;
        private int width;
        private int height;
    
        //Pass in the fixed height and width for our object
        public TextBoxField(int width, int height)//, long style )
        {
            //This call to super will help keep the object in place
            super(Manager.NO_VERTICAL_SCROLL | Manager.USE_ALL_WIDTH);// | Manager.FIELD_HCENTER);
    
            this.width = width;
            this.height = height;
            managerWidth = Display.getWidth() - width;
            managerHeight = height;
    
            //vfm will allow scrolling within the object
            VerticalFieldManager vfm = new VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.FIELD_VCENTER);
    
            editField = new EditField("", "", EditField.DEFAULT_MAXCHARS, EditField.FOCUSABLE)// | EditField.JUMP_FOCUS_AT_END)
            {
                 public void paint(Graphics g) {
                     //This invalidation will help keep the border clean
                     //while scrolling
                     getManager().invalidate();
                     g.setColor(0xBCBEC0);
                     super.paint(g);
                 }
                 protected void onFocus(int direction) {
                    myBorderColor = 0x469539;
                    TextBoxField.this.invalidate();
                 }
    
                 protected void onUnfocus() {
                    myBorderColor = 0x808285;//0x999999;
                    TextBoxField.this.invalidate();
                }
            };
    
            vfm.add(editField);
            add(vfm);
       }
    
       public void paint(Graphics g)
       {
            managerWidth = Display.getWidth() - 50;
    
            if (managerWidth == 0) {
                managerWidth = width;
    
            }
            if (managerHeight == 0) {
                managerHeight = height;
            }
    
            //Draw a rectangle around out TextBoxField
            //For Border Color
            //int prevColor = g.getColor();
            int prevColor = g.getColor();
            g.setColor(myBorderColor);
            g.drawRoundRect(0, 0, managerWidth, getHeight(), 10, 10);
            g.setColor(prevColor);
    
            //Fills the Rectangle with  color
            g.setColor(Color.WHITE);
            g.fillRect(2, 2, managerWidth-4, getHeight()-4);
    
            super.paint(g);
    
        }
    
        //If this call to sublayout was made by the system then
        //both parameters would be passed with a value of 0.
        //This check and adjustment keeps the fixed properties
        //maintained.
        public void sublayout(int width, int height)
        {
            managerWidth = Display.getWidth() - 50;
           // managerHeight = height;
            if (managerWidth == 0) {
    
                managerWidth = width;
    
            }
            if (managerHeight == 0) {
                managerHeight = height;
            }
            //managerWidth = Display.getWidth() - 50;
            //Force the extent of our manager.
            //This will force the height of the object
            //where the above super.sublayout() call will
            //set the width.
    
            super.sublayout(managerWidth, managerHeight);
            setExtent(managerWidth,managerHeight);
    
        }
    
        //The following two methods allows users of the
        //TextBofField read and set its contents.
        public String getText() {
            return editField.getText();
        }
    
        public void setText(String text) {
            editField.setText(text);
        }
        public void setFont(Font font)
        {
            editField.setFont(font);
        }
    
        public void setFieldChangeListener(FieldChangeListener fl){
            editField.setChangeListener(fl);
        }
    
        public Field getField(){
            return editField;
        }
    
    }
    

    Please help me solve this problem.

    Thank you

    amsiddh.

    Of course, you use the old TextBoxField example, which has a number of problems, the worst being:

            editField = new EditField("", "", EditField.DEFAULT_MAXCHARS, EditField.FOCUSABLE)// | EditField.JUMP_FOCUS_AT_END)
            {
                 public void paint(Graphics g) {
                     //This invalidation will help keep the border clean
                     //while scrolling
                     getManager().invalidate();
                     g.setColor(0xBCBEC0);
                     super.paint(g);
                 }
    

    The highlighted code is causing the flicker.  It just happened is not to affect the older phones too, but it's a wrong code anyway.

    I strongly suggest to read the following article, that you can use as a better starting point:

    TextBoxField revisited

    This article was created to solve the problems with the old. Make sure you read the comments - they have a few ideas on the extension of the feature.

  • Listener orientation

    I'm trying to understand how to write a listener orientation.  The documentation of the api do not have a very concrete example on how to do it.  Basically what I need to do, is change some field images according to what we in orientation.  What is the best way to create a listener for it.

    Thank you.

    It is not a listener to screen orientation changes.  The sample in the current 4.7.0 beta developer's guide is incorrect.  The sublayout method is called when an orientation change occurs, however, there are also other triggers for this method.

    What you can do is to override this method and use the Display.getOrientation () method to check the orientation.  You'll need to follow the previous orientation in your application.  You can also call super.sublayout to trigger the behavior of default layout for the Manager.

    I sent this update to our team of documentation for correction.

  • Fields are disappearing while scrolling

    Hi comrades.

    I need help with this problem. I did some research but I did not yet find an answer for this.

    What is happening is that some fields disappear depending on how the screen scrolls.

    The same screen, with the same fields but different content, seems perfect when not scrollable, so the problem seems to be related with the scrolling.

    Fields Flash for scrolling or something like that. They just look ok in a certain position of the roll and don't have in others.

    I use custom managers, the substitution of sublayout and other things. What can go wrong? Any ideas?

    THX

    Concerning

    Dan

    What class extend you in your custom Manager? Once, I extended a VerticalFieldManager and lived the problem similar to what you describe. Because I never called super.sublayout in any case, I've decided to expand Manager - bingo! -the problem has disappeared.

  • SetExten does not work...

    Hi all..

    I have a problem I'm trying to paint a bit of vertical field Manager a colored background but Pentecost... rounded corners I see in the forum wha t I can use setExtent to draw the bettwen spaccing the sublayout and the border... but don't works!

    No matter what?

    I use and always have the same result...

         contenedormenu = new VerticalFieldManager(FIELD_HCENTER  ){
                public void paint(Graphics graphics)
                {
                    graphics.setBackgroundColor(0xeb870e);
                    graphics.clear();
                    super.paint(graphics);
                }
                protected void sublayout( int maxWidth, int maxHeight )
                {
                    int width = Display.getWidth()-40;
                    int height = Display.getHeight();
                    setExtent(width, height);
                super.sublayout( width, height);
                }
            };
    

    Firstly - you call super.sublayout too late (or setExtent too early).  In fact, if you call super.sublayout () with the values you want, you will not have to use all the setExtent() -'s made it by sublayout of the optimization of resources.  This fact, of course, is the reason for your problem - super.sublayout for measure on its own, the substitution of what you did before.

    Second - parameters of your sublayout (maxWidth and maxHeight) are indeed the dimensions of maximum rectangle, that you can use.  So to pay tribute to them and add

    width = Math.min(width, maxWidth - 40); // I guess you need that -40
    

    and

    height = Math.min(height, maxHeight);
    

    before you call your super.sublayout ().

    Third - Are you sure that you calculate the right width and height?  If you want 20 pixels 'fill' on each side, including the top and bottom, is it not logical to subtract 40 from height as well?

    Fourth - even if you go through all of this, this value for money manager will position everywhere where it feels good (if that is the only field, it will be positioned at (0, 0) - upper left corner).  You can override this decision using setPosition (20, 20) (that's if I guessed correctly that you want 20 pixels of spacing between your manager and borders).  setPosition() can be called only during sublayout (layout for fields non - Manager).

    Fifth - it's just a slight optimization and improved the readability of the code.  Rather than replace the paint, we can just change paintBackground:

    public void paintBackground(Graphics graphics) {
        graphics.setBackgroundColor(0xeb870e);
        graphics.clear();
    }
    

    I know that Field.paintBackground () is undocumented, but you can find traces of this documentation in Screen.paintBackground () - seriously!

  • How do you prevent updateLayout during screen change.

    I don't know if I thought that, but I think I read somewhere once that it is possible to 'lock' the layout as you work in it.

    For example, I now call you deleteAll() in a Manager custom that I created, just to add a few new custom fields and add even some abandoned fields.

    The problem is that when I call deleteAll() for this, a call to sublayout and custom fields are not there and then he complained abuot that. * Bleep *, I know that they are not there and I don't want to put a giant if around them in the method sublayout, just to see if they are childs of the Manager or not.

    Is there something else I can do? as:

    stopUpdatingLayout();

    reArrangeEverything();

    nowYouCanUpdateLayoutAgain();

    THX

    RGS,

    Dan

    I have an idea: do the first level or even screen Manager custom with the following substitution of sublayout:

    protected void sublayout(int width, int height) {
      boolean layoutDisabled = false;
      synchronized (this) {
        layoutDisabled = this._layoutDisabled;
      }
      if (layoutDisabled) {
        setExtent(width, height); // makes sense for MainScreen, FullScreen etc.
      } else {
        super.sublayout(width, height);
      }
    }
    

    Protect the place where you do all your deleteAll() / add manipulations like this:

    myMainScreen.layoutDisable(true); // a synchronized method setting _layoutDisabled (see above)
    UiApplication.getUiApplication().suspendPainting(true);
    //...
    // Adding / deleting fields goes here
    //...
    UiApplication.getUiApplication().suspendPainting(false);
    myMainScreen.layoutDisable(false);
    UiApplication.getUiApplication().relayout(); // force the re-layout after we enabled it
    

    Just some pseudo-code - hope you can see what I mean...

  • Paint problem custom listfield - nullfield

    I created a listfield custom by extending the field manaagers, I use the nullfield for the effect of the update, but it does not work properly. I use two differnet layout for line manager who has no images and the other that contains images. The focus problem occurs only for lines that have pictures. I enclose the code below.

    The images appear correctly once I have the focus and remove on the line.

     //CONSTRUCTOR FOR BITMAPFIELD
        public CustomRow(String _headline, String _metadata, BitmapField bmF)
        {
            bitmapField = new BitmapField();
            bitmapField = bmF;
            _headText = new RichTextField(_headline,RichTextField.NON_FOCUSABLE);
            _metaData = new RichTextField(_metadata,RichTextField.NON_FOCUSABLE);
    
            _headText.setPadding(10, 10, 5, 10);
            _metaData.setPadding(0, 10, 10, 10);
    
            _focus = new NullField(NullField.FOCUSABLE);
            _focus.setFocusListener(this);
    
            bmpRowTextMang = new VerticalFieldManager(){
                public void sublayout(int width, int height)
                {
                    super.sublayout(Width * 3/4, height);
                    setExtent(Width * 3/4, height);
                }
            };
    
            bmpRowBmpMan = new VerticalFieldManager(){
                public void sublayout(int width, int height)
                {
                    super.sublayout(Width/4, height);
                    setExtent(Width/4, height);
                }
            };
    
            bmpRowTextMang.add(_headText);
            bmpRowTextMang.add(_metaData);
            bitmapField.setPadding(10, 10, 0, 5);
            bmpRowBmpMan.add(bitmapField);
            bmpRowMan =  new VerticalFieldManager(){
    
                public void sublayout(int width, int height)
                {
                    setPositionChild(getField(0), 0, 0);
                    layoutChild(getField(0), width, height);
    
                        setPositionChild(getField(1), 0, 0);
                    layoutChild(getField(1), width, height);
    
                    setPositionChild(getField(2),getField(1).getWidth() , 0);
                    layoutChild(getField(2), width, height);
    
                    int height1 = _headText.getHeight() + _metaData.getHeight();
    
                    if(height1<80)
                    {
                        height1 = 80;
                    }
                    setExtent(width, height1);
                }
    
                protected void paint(Graphics graphics)
                {
                    setHeightRow = this.getHeight();
                    graphics.drawLine(10, setHeightRow-1, Display.getWidth()-10, setHeightRow-1);
                    super.paint(graphics);
                }
    
                public int getPreferredHeight()
                {
                    return this.getHeight();
                }
            };
    
            bmpRowMan.add(_focus);
            bmpRowMan.add(bmpRowTextMang);
            bmpRowMan.add(bmpRowBmpMan);
            this.add(bmpRowMan);
        }
        public void focusChanged(Field field, int eventType) {
            // TODO Auto-generated method stub
            this.getManager().invalidate();
        }
        protected void paintBackground(Graphics g) {
              int prevBg = g.getBackgroundColor();
              if (_focus.isFocus()) {
                g.setBackgroundColor(Color.LIGHTBLUE);
              } else {
                g.setBackgroundColor(Color.WHITE);
              }
              g.clear();
              g.setBackgroundColor(prevBg);
            }
    
    }
    

    DEVICE BLACKBERRY BOLD 9780

    One thing to try is to substitute drawFocus do nothing:

    protected void drawFocus(Graphics g, boolean on) {
    }
    

    But the main problem must be somewhere in your sublayout substitutions. First of all, I am always wary with the help of a manager not abstract, never by calling its sublayout (such as super.sublayout). If you want to do this, substitute rather Manager. If your

    bmpRowMan =  new VerticalFieldManager(){
    

    should become

    bmpRowMan =  new Manager(){
    

    Another problem (this is not obvious and is repeated a lot of different people here) is using setExtent after the super.sublayout of a built-in Manager. Simply put - don't! If you change the width and height parameters before you go super.sublayout and want the Manager to have these exact width and height, set it with USE_ALL_WIDTH and USE_ALL_HEIGHT and filing the setExtent altogether! You pouvez use setExtent after super.sublayout, but you really need to know why you do this. An example is the code for this article in the knowledge base, but it feels more like a hack, you don't need:

    Implementation of a standard style scroll bar

    Good luck!

  • Get the widths of landscape and portrait

    Hi all

    Is it possible to get the width of the landscape of a screen (or just the screen) while the device is in portrait orientation and without rotation/tilt physically the device? and vice versa?

    The only way that I can think of is to force the screen in, say, portrait landscape (via Ui.getUiEngineInstance () .setAcceptableDirections (Display.DIRECTION_LANDSCAPE)), out of Display.getWidth () and then force back in orientation. I don't know if it will even work or is the the best/most simple method.

    Any help?

    Thank you

    The safest way to get the current width/height is to override the sublayout() method appropriate to the screen, Manager, etc. and update the required values (e.g. update of width of the button). that is when orientation changes, a sublayout is triggered, where you update buttons as. Inside of the paint just function use the measurement buttons to draw the dimensions for the size of the newer buttons based on the available width. Database available on the values provided by the call to sublayout instead of Display.getxxxxx values.

  • Popup screen problems

    I've tried using the search tool and google my whole day, but I can't seem to find the answer to these two problems.

    1. I'm positioning my pop-up screen in the middle of the screen. But as you can see in the image below it is nowhere near the Center.

    2. I'm trying to focus my two buttons in the middle of the popup screen with a verticalfieldmanager, but somehow it is fondant a position according to the width, I don't know what.

    Here is the code:

    private final static int _Width = 200;private final static int _Height = 200;private final static int _X = (Display.getWidth() - _Width) >> 1;private final static int _Y = (Display.getHeight() - _Height) >> 1;public class NetworkSettingScreen extends PopupScreen{
    
    public NetworkSettingScreen(){   super( new VerticalFieldManager());   LabelField lf = new LabelField("Network Settings", DrawStyle.HCENTER);    SeparatorField sf = new SeparatorField();         CheckboxField cbf1 = new CheckboxField(" WiFi", true);    CheckboxField cbf2 = new CheckboxField(" GPRS/Edge/3G", true);
    
      VerticalFieldManager vfm = new VerticalFieldManager(HorizontalFieldManager.FIELD_HCENTER);    ButtonField bf1 = new ButtonField("Save", DrawStyle.HCENTER); ButtonField bf2 = new ButtonField("Cancel", DrawStyle.HCENTER);   vfm.add(bf1); vfm.add(bf2);
    
      //add UI components to Pop-up screen  add(lf);  add(sf);  add(cbf1);    add(cbf2);    add(vfm);}
    
    public void sublayout(int width, int height){   super.sublayout(width, height);   setExtent(_Width, _Height);           setPosition(_X, _Y);}}//end of class
    

    http://i55.Photobucket.com/albums/G152/chengbang69/screenshot.jpg

    any help would be appreciated

    Hey chengbang69,

    I modified your code to obtain the expected results,

    final class NetworkSettingScreen extends PopupScreen
    {
        private final static int _Width = 200;
        private final static int _Height = 200;
        private final static int _X = (Display.getWidth() - _Width) >> 1;
        private final static int _Y = (Display.getHeight() - _Height) >> 1;
    
    public NetworkSettingScreen()
    {
        super( new VerticalFieldManager());
        LabelField lf = new LabelField("Network Settings", LabelField.FIELD_HCENTER);
        SeparatorField sf = new SeparatorField();
        CheckboxField cbf1 = new CheckboxField(" WiFi", true);
        CheckboxField cbf2 = new CheckboxField(" GPRS/Edge/3G", true);
    
        VerticalFieldManager vfm = new VerticalFieldManager(VerticalFieldManager.FIELD_HCENTER);
        ButtonField bf1 = new ButtonField("Save", ButtonField.FIELD_HCENTER);
        ButtonField bf2 = new ButtonField("Cancel", ButtonField.FIELD_HCENTER);
        vfm.add(bf1);
        vfm.add(bf2);
    
        //add UI components to Pop-up screen
        add(lf);
        add(sf);
        add(cbf1);
        add(cbf2);
        add(vfm);
    }
    public int getPreferredWidth() {
        return _Width;
    }
    public int getPreferredHeight() {
        return _Height;
    }
    
    public void sublayout(int width, int height)
    {
        super.sublayout(getPreferredWidth(), Integer.MAX_VALUE);
        setExtent(getPreferredWidth(), getPreferredHeight());
        setPosition(_X, _Y);
    }
    }//end of class
    

    The reason why you need to replace getPreferredHeight() and getPreferredWidth() is due to all subcalls and sublayouts which actually occur when you call super.sublayout. It will then use the 'default' screen page or getPreferredWidth/height.

    Just a friendly recommendation, adjusting the size of a screen to a static value is effective only if you also check the size of the font, currently if the user has a font above average size, a part of the text will not be seen, so, technically, the most effective way is to have the JAVA virtual machine to manage the resizing/flaking itself This can be done by simply using the same code that I posted above, however remove the substitution on sublayout, the width will be slightly larger that you set but at least you won't encounter unknowns.

    Hope this helps,

    Concerning

    André

  • How to assign the field width based on the screen wdth

    I have my ownfield, I'm adding to the screen, or the Manager

    I want to give the height and the width of field based on the width of Manager screen, when I try I got errors.

    the code I used is

    Field ff;
            int j=(Display.getWidth()>360?4:3);
            int compwid=Display.getWidth()/j;
            int compht=40;
            int posx=0,posy=0;
            int no=this.getFieldCount();
    
            for(int i=0;i
    

    When I do cela in the display main () sublayout, I get the error as "the field is not a child of this Manager.

    Similarly when I add to the Manager sublayout, I get as field must call setExtent and setPostion for available.

    Where I'm going wrong?

    You can help with that.

    Concerning

    Rakesh Shankar.P

    Hi guys, I was able to get this working, pblm is that I called super.sublayout () just before the Codes I have describd in the previous post.

    Concerning

    Rakesh Shankar.P

  • keep the question sublayout call...

    Hello

    Recently too much question about Torch 9800 peripheral,

    I create a screen with a couple of FieldManager.

    Let me say:

    One is Top, one is average. and we're down.

    Top and bottom can not scroll, a middle ground is scrollable,

    The medium contains two fields, the top is FieldManger, the following is ListField, once the user, click on an element of ListField, this field will be add to the high page one.and then refresh ListField show indicate an added with different colors.

    the question is, once the item is added to the top, it will call sublayout to screen rearrange, everything works fine on the Simulator and machine torch not peripheral. Once I loaded device to torch, it will make a sublayout loop, if I scroll the FieldManager to hide, then loop stops.

    is there any kind of person give me some hint? How to draw that? I worked all day and no idea right now.

    Thanks in advance.

    When you say it will loop, is a recursive call, sublayout where a treatment which is sublayout of calls and so on.  Or is this just keep is called?

    I suspect that it maintains just get called.  In this case, you have to d through the entire treatment do you and are looking for something that could make a field think we should throw himself again.  Looks like that in the middle of the page layout you do something, like a font of domain change, which causes the transformation to program another provision.

Maybe you are looking for