Dettach Field Manager for reuse with other managers

Is it possible to use a field (same instance of a field) with many managers (not at the same time). Let me explain further.

I spread a field class that retrieve multiple images from the internet using httpconnections. What I want is to use the same field in different eras with different managers like this:

    HorizontalFieldManager Manager1 = new HorizontalFieldManager();
    HorizontalFieldManager Manager2 = new HorizontalFieldManager();
    VerticalFieldManager Manager3 = new VerticalFieldManager();

    myField webField = myField("http://www.myurl.com/contents"); //--> This brings lots of information

    private void showInManager1(){
        Manager1.add(webField);
    }

    private void showInManager2(){
        Manager2.add(webField);
    }

    private void showInManager3(){
        Manager3.add(webField);
    }

    myapp(){
        showInManager1(); //--> if I do this here no problem.
        showInManager2(); //--> As the "global" myField is already "attached" to the Manager1 an exception is thrown.
        showInManager3(); //--> Same here
    }

As well as the code above what I want is to reuse the same domain instead of creating a new instance every time like this:

 HorizontalFieldManager Manager1 = new HorizontalFieldManager();
    HorizontalFieldManager Manager2 = new HorizontalFieldManager();
    VerticalFieldManager Manager3 = new VerticalFieldManager();

    myField webField = myField("http://www.myurl.com/contents"); //--> This brings lots of information

    private void showInManager1(){
        Manager1.add(webField);
    }

    private void showInManager2(){
        Manager2.add(webField);
    }

    private void showInManager3(){
        Manager3.add(webField);
    }

    private void dettachFromManager(myField theField){
        thefield.dettach() //--> This doesnt exist, this is what I want to do.
    }

    myapp(){
        showInManager1();
        dettachFromManager(webField);
        showInManager2();
        dettachFromManager(webField);
        showInManager3();
    }

I hope it's clear enough to explain what I want to do. Any help or comment is appreciated.

Iron

Thanks for your information. Anyway what I was looking for was a way for the field of dettach or remove itself from the existing Manager. I don't know why I can't last night (maybe I was asleep).

Here's how I found works for me. I just added the function below to my extent of myField:

 public void dettach(){
        try{
            Manager _manager;
            _manager = this.getManager();
            _manager.delete(this);
        }catch(Exception ex){
            System.out.println("     ERROR->" + String.valueOf(ex));
        }
    }

And called it right when I need it. Easy.

Thanks, I hope this can help others.

Tags: BlackBerry Developers

Similar Questions

  • Stock image Library for sharing with other members of the team

    How do I share pictures Adobe Stock I recorded in a Stock library with other members of the team (under a login team shared, although separate user accounts)? And I don't mean through other Adobe applications; I want just to save a group of possible images in a folder for the rest of my team to be able to view/choose. Who is?

    Connection on www.adobe.com and you will see a link to the libraries. From there, you can share for collaboration, send a link to your meals, etc,

  • How to set up Wireless Manager for use with the SIM (NB100-12i)?

    I just bought the NB100-12i which comes with a SIM card slot. The system is WIndows XP SP2.
    SIM card is recognized (at least it says screen diagnostic wireless managers etc.). But I can't get a connection. After entering my PIN there is nothing happens. The sender can not be activated.
    I have an Orange SIM card with data option and the SIM card works in my phone. How can I use in my brand new Toshiba NB100-12i?

    Well, seems that the thread has responded ;)
    Thanks for sharing this with us!

  • IPCC with other managers to call seller

    Can anyone provide information on the covering of the IPCC with the other providers (legacy) CallManager? Is there a list of suppliers that the IPCC is compatible with? What components are required for the integration/interfaces?

    IPCC is also purely based IP... IPCC can run on phones without IP (RJ45 ports)? How? -purely novice I know...

    The suite is called the IPCC when it integrates with Cisco CallManager, otherwise it is ICM. ICM's former product Geotel, which was acquired by Cisco in the end of the 1990s, it has been around for awhile and it integrates with many such as Nortel Symposium, Nortel Meridian, Concerto CLSA formerly spectrum Rockwell, Aspect, Avaya Defnity, Alcatel, Ericson, Siemens etc.

    In order to integrate these sellers next to the CIM server you PG (periphial offer) for this provider.

    Order this doc:

    http://www.Cisco.com/application/PDF/en/us/guest/products/ps1001/c1225/ccmigration_09186a008041ef29.PDF

    and this link for the integration docs:

    http://www.Cisco.com/en/us/products/SW/custcosw/ps1001/prod_technical_reference_list.html

    Chris

  • How to download files from a library of clouds to my computer (for collaborating with others with older versions of Adobe programs)?

    I don't know how to do this... Any suggestions?

    Beste regards,

    Rob

    Hello

    Please see collaborate on files and libraries of creative cloud account and Collaboration FAQ

    Hope that helps!

    Kind regards

    Sheena

  • Does invalidate a field without a lock of the event, invalidate the field Manager?

    It is probably of a self-inflicted gunshot wound.

    Does invalidate a field without the lock of the event, invalidate the field Manager?

    In other words, if I cancel one or several fields individually, I see any changes made to the zone manager?

    Thank you.

    No, disabling the field does not affect the Manager. You must be confusing with disabling the Manager (repaint all managed fields) or make updateLayout field (including redispositions the display Assembly).

  • Accidentally, I put my Macbook not in the stream with other devices

    It is a real irritable and I hope that someone can help you. I've had my Macbook Pro for about 4 years now but had never used icloud.  When I decided to start doing so yesterday I went in iCloud in settings and seen something like: "Do not allow for synchronization with other devices" and accidentally ticked.  Everything already worked well without using iCloud, but now nothing can be synchronized with the Macbook.  Is there something I can do?  I see that the boot Volume has been changed yesterday who must account for this.

    Questions of clarification - were you when you saw synchronizes them only not in System Preferences/iCloud? If this isn't the case here, where were you? If you go into System Preferences/iCloud can you check the boxes to synchronize?

  • How to set horizontal scrolling to horizontal field Manager when fields are added using a loop for?

    The following code snippet contains a horizontal field Manager to which are added five buttons.

    1. I can't the value of horizontal scrolling to horizontal management Manager because of who I am not able to access the keys 4 and 5.

    2. usually, we put horizontal scrolling in the following way:

    container = new HorizontalFieldManager(USE_ALL_WIDTH|HORIZONTAL_SCROLL|HORIZONTAL_SCROLLBAR);
    

    3. so I also tried setting of horizontal scrolling in the following way

       container = new HorizontalFieldManager(Manager.HORIZONTAL_SCROLL|Manager.HORIZONTAL_SCROLLBAR)
                {
    
                    protected void sublayout(int maxWidth, int maxHeight) {
    
                        Field field = null;
                        int x = 0;
                        int y = 0;
                        int maxFieldHeight = 0;
                        int maxFieldWidth = 0;
                        for (int i = 0; i < getFieldCount(); i++)
                        {
                            field = getField(i);
                            layoutChild(field, maxWidth, maxHeight);
                            setPositionChild(field, x/*width-field.getWidth()*/,y);
    
                            x+=field.getWidth();
    
                            maxFieldWidth = maxFieldWidth + field.getWidth();
                            System.out.println("field width"+field.getWidth());
                            System.out.println(" max field width"+maxFieldWidth);
    
                            if(i==0)
                            {
                                maxFieldHeight = field.getHeight(); // height set of the first button since all components have the same height
                            }
                        }
                        System.out.println("final max field width"+maxFieldWidth);
    
                        setExtent(maxFieldWidth, maxFieldHeight);
    
                    }
                };
    

    but it's not working.

    4 I found this property: (position) horizontalFieldManager.setHorizontalScroll; that contains the parameterioo where the post is supposed to be the new horizontal scroll position. I tried passing the coordinate x of horizontal field Manager, but it does not work. I should pass as a parameter position?

    HorizontalFieldManager container = new HorizontalFieldManager()
    {
        protected void sublayout(int maxWidth, int maxHeight)
        {
            Field field = null;
            int x = 0;
            int y = 0;
            int maxFieldHeight = 0;
            for (int i = 0; i < getFieldCount(); i++)
            {
                field = getField(i);
                layoutChild(field, maxWidth, maxHeight);
                setPositionChild(field, x,y);
                x+=field.getWidth();
                if(i==0)
                {
                    maxFieldHeight = field.getHeight(); // height set of the first button since all components have the same height
                }
            }
    
            setExtent(Display.getWidth(), maxFieldHeight);
    
        }
    };
    
    ButtonField button1 = new ButtonField("Button1");
    ButtonField button2 = new ButtonField("Button2");
    ButtonField button3 = new ButtonField("Button3");
    ButtonField button4 = new ButtonField("Button4");
    ButtonField button5 = new ButtonField("Button5");
    
    container.add(button1);
    container.add(button2);
    container.add(button3);
    container.add(button4);
    container.add(button5);
    
    add(container);
    

    Need your valuable comments and suggestions. Please help me.

    I think that there is a bug in the sublayout (your HorizontalFieldManager 0 mode.  Given that the code did what I think WHAT HFM will do anyway, I recommend that you try to do this with a standard HFM, using this style:

    Manager.HORIZONTAL_SCROLL | Manager.HORIZONTAL_SCROLLBAR

    Let us know how you go.

    When I have more time I'll explain the bug, but if you want to investigate something, be aware that the maximum size that you can use in setExtent are the values that are passed to sublayout.  Compare the width as you try to define in setExtent whose width is increased.

  • problem with the vertical field Manager

    Hello

    My application has a screen. On this, I add a Senior Manager vertical field. I add new labelfields dynamically to this vertical field Manager.  When I give the text in the constuctor of the etiquette field, each of them is the fine display. But when I tried to draw the text to the painting, it does not appear.

    Here is my code...

    vfm = new VerticalFieldManager(VERTICAL_SCROLL | FOCUSABLE);
            for (int i = 0; i < 4; i++) {
                index = i;
                LabelField labelField = new LabelField() {
                    protected void paint(Graphics graphics) {
                        // TODO Auto-generated method stub
    //                  super.paint(graphics);
                        graphics.setColor(Color.BLACK);
                        graphics.drawText(displayString[index], 0, 0);
                    }
                };
                vfm.add(labelField);
            }
            add(vfm);
    

    Please help me find a solution.

    First of all, stop saying that it is VerticalFieldManager who has done something bad for you. It has nothing to do with it.

    You use the index in your LabelField painting method. Use paint value is the current value of the index at the time of the painting. Painting happens way after you have created all your LabelFields, when the index stopped to change and has the last value of the loop variable (in your case, it's 3).

    This, as well as LabelFields width zero (that you seem to have supported) so are the problems of your original code. Store the value of i in your LabelField somehow if you insist on using the table values. If only check out you them once and do not change them, consider creating your LabelFields with the text from this displayString table.

    Even better: as you do not use the LabelField paint, why not create a custom field received a text and paint your smileys and all? Of course, you have to implement available as well, but it's useful even when your smileys will take a different width than the corresponding symbols.

    To summarize: your current approach is bad. Take a step back, work on the design, and then implement.

  • style of Manager for the field Horizont

    Hello

    A simple but stubborn problem. I want to have a horizontal Manager with both Field.Use_All_Width and Field.Field_HCenter style bits.  I create the Manager in the medium folowing:

    HorizontalFieldManager hfm = new HorizontalFieldManager(Field.FIELD_HCENTER |Field.USE_ALL_WIDTH))
    

    but only styles is considered, depending on whether one is first. The clues why?

    If you set the USE_ALL_WIDTH style bit, the FIELD_HCENTER style is meaningless - how can center you a field that uses the entire width? Maybe you want to center the fields that are added to hfm. If so, this is not the way to do it.

    The style on a field bits are (usually) used by the container Manager to decide how to develop the land. That doesn't change when the field is to be a manager himself. To change the logic of the layout, you must set the style bits of the fields that are added to the Manager.

    Two other points. First of all, HorizontalFieldManager is sensitive to the vertical alignment styles but does not take account of horizontal alignment styles the fields he manages (the converse is true of VerticalFieldManagers). Second, it does not matter what order list you the styles.

    Field.FIELD_HCENTER | Field.USE_ALL_WIDTH == Field.USE_ALL_WIDTH | Field.FIELD_HCENTER

  • Looking for example of the Manager to OBTAIN with the PL/SQL source type

    Hello

    I currently have a Manager GET job with a running QUERY source type in ADR 3.0.  The call returns the number of records (hundreds, or even thousands of 10) in JSON and allows the user to navigate through the results.

    The call accepts several parameters that I convey just in the place where the clause of the query in the Manager.  Data is retrieved by the beach date (s).

    To prevent queries runaway with ranges for a long time, I've implemented a logic in the sql statement to limit the applicant.  The applicant requested an error thrown instead.  There are other limits that I'm imposing on other entries I need to provide useful errors for example.

    I would like to change the call GET use PL/SQL type instead of the type of REQUEST so that I can do validation on entries and send useful return error messages if necessary, however I can't find examples online.

    Are there any examples (or alternatives) would be greatly appreciated.

    Thank you

    Anthony

    Hello

    You can use the Pipelined functions to generate your recordset plsql and then just use a select statement of the function in the pipeline in the service definition.

  • Can someone help me? I am trying to download iMovie which normally should be free with other Apple applications, but for full reason he always says that I have to pay for it. And I Shen a brand-new iPhone updated to IOS 9 5s. Can someone give me advice on

    Can someone help me? I am trying to download iMovie which normally should be free with other Apple applications, but for full reason he always says that I have to pay for it. And I Shen a brand-new iPhone updated to IOS 9 5s. Can someone give me advice on what to do?

    iMovie and iLife and iworks Apps are free with the purchase of a new device.

    Since Apple is no longer selling the iPhone 5 s, she cannot be considered more for free apps.

    However, just to be safe, disconnect you from the iTunes and App Stores-> Apple ID in the settings on the new iPhone 5 s, then reset the iPhone in now the home and power buttons together for 10 to 15 seconds. Let the iPhone reboot and then sign in with your Apple ID in iTunes and the App Store and try to get the Apps again.

  • Need help with this Vertical field Manager? It scrolls to the low n!

    I created a vertical field Manager

    public class BGManager extends VerticalFieldManager{
        public BGManager() {
            super(VerticalFieldManager.USE_ALL_WIDTH|USE_ALL_HEIGHT);
        }
        public void paint(Graphics graphics)
        {
            graphics.setBackgroundColor(Color.BLACK);
            graphics.clear();
            super.paint(graphics);
        }
    
    }
    

    I added to my screen, then I added fields in addition to this.

    It works fine, but the Manager starts to scroll down when the focus is on the last field and I'm trying to scroll down.

    He does not stop to the last topic.

    How can I fix?

    Take a look at this thread. It addresses exactly your problem with solution:

    http://supportforums.BlackBerry.com/T5/Java-development/VerticalFieldManager-with-fixed-size-scroll-...

  • Why the document properties fields are disabled for me with Adobe Acrobat DC?

    I have just recently Adobe Acrobat for DC and at the same time were analysis a large number of documents in PDF format.  But it seems no matter how to create a PDF file, I can't change the properties.  I'm mainly interested in adding a title, subject, and keywords to my documents and possibly custom properties but I can't type in all areas.  I'm choosing File > properties and Description or Custom tab.  I use Windows 7 and I don't have this problem with other software products or when I scanned to a jpg image file.  Could I have a security setting set up somewhere that keeps the properties to be changed?

    Thank you

    Rachel

    You posted your question in the forum of Acrobat Reader, so the question is: what applications do you use, exactly?

    Is Adobe Acrobat (Pro/Standard) DC or DC of Adobe Acrobat Reader? If it's the latter, no, you cannot use it to change the properties of a PDF file, because it's just a reader, not an editor.

  • Configuration guide for ESXi 5 (Vmnetwork, management and vMotion) with NIC 2 network

    Hello

    I have 4 NIC in Server Blade 7 (ESXI 5), would like to dedecate 2 NIC for (Vmnetwork, management and vMotion) & NIC (iSCSI traffic) 2 with equallogic SAN.

    I equallogic guide to configure ESXI with it, but how do I configure (Vmnetwork, management and vMotion) with NIC 2, my priority is excellent speed for my virtual machine, and then nothing else.

    Then just go for classic switch.

    The configuration is a lot depend on existing infra, the trunk, the physical switch for redundant network & balance, 100 or network 1GbE, no.. virtual machines and etc. If there is a new configuration, I suggest you trunk 2 x available vmnic (the vm network) to balance the load and better performance.

Maybe you are looking for

  • Intel 3945ABG performance is very slow

    My Toshiba A100 has a wifi Intel 3945ABG in there. I've got current Intel 10.1.1.3 drivers wifi for this installed also. However, maximum flow, I think get using this wifi interface is a little more than 2 Mbps. My router is a Netgear DG834G. My othe

  • window dvd maker?

  • Is malware Namebench (a DNS solution)?

    Dear Apple community, I found an old Google project called Namebench to https://code.google.com/p/namebench/ . I downloaded and ran it on my Macbook Pro. I'm afraid that it is malware. If anyone can check this? I have no evidence he did anything unto

  • Default spacing in wordpad and word (updated)?

    There has been several messages on this forum and a lot of other other sites with the same question. How have we NOT default line spacing in wordpad to 1 1/2 and the extra lines at the end? All the answers I have seen are 4 years or older, and all ar

  • VPN Tunnel access to several subnets ASA 5505

    Greetings, We spent a little time trying to configure our ASA 5505 in order to TUNNEL into several different subnets.  Subnets include 192.168.1.0 / 192.168.2.0 / 192.168.10.0 Someone is about to review this setup running and indicate where we have g