List of re-filling of question

I have a list with a custom CellRenderer class. I added a checkbox to the cell, as described in the developer's guide, and as can be found on this forum. From a selection that the user do I need to re - fill the list with other content. If, however, for example a checkbox has been selected by the user in the initial list, after the re-filling of the list one of the boxes for the newly populated list is also checked. How to avoid that?

I have the following code in which I declare a container of variables to hold the list and to load the data:

...
public class ListsPanelContainer extends Container
{
    private var _conChecklists:ChecklistContainer = new ChecklistContainer();
    private var _checklistData:ChecklistDataLoader = new ChecklistDataLoader();
    ...
    public function ListsPanelContainer()
    {
        initializeUI();
        ...
    }

    private function initializeUI() : void
    {
        addChild(_conChecklists);

        _checklistData.addEventListener(MyConstants.CHECKLISTS_LOADED, checklistDataLoadedHandler);
        ...
    }

    ...

    private function checklistDataLoadedHandler (event:Event) : void
    {
        _conChecklists.setData(_checklistData.currentData);
    }
    ...
}

And it's the ChecklistContainer class definition:

...
public class ChecklistContainer extends Container
{
    private var _checklistData:ChecklistDataLoader = new ChecklistDataLoader();
    private var _lstChecklists:List;

    public function ChecklistContainer()
    {
        initializeUI();
    }

    private function initializeUI() : void
    {
        if (!_lstChecklists)
        {
            _lstChecklists = new List();

            with (_lstChecklists)
            {
                x = 0;
                y = MyConstants.HEADER_HEIGHT;
                setSize(MyConstants.LIST_PANEL_WIDTH, MyConstants.CHECKLISTS_LIST_HEIGHT);
                rowHeight = 70;
                setSkin(ChecklistCellRenderer);
                selectionMode = ListSelectionMode.SINGLE;
                allowDeselect = true;
                addEventListener(ListEvent.ITEM_CLICKED, listItemClickedHandler);
            }

            addChild(_lstChecklists);
        }
    }

    public function setData (data:Array) : void
    {
        _lstChecklists.dataProvider = new DataProvider(data);
    }
    ...
}

And it's the ChecklistDataLoader class definition:

...
public class ChecklistDataLoader extends EventDispatcher
{
    public var currentData:Array;

    private var _arrChecklistNames:Array = new Array("First", "Second", "Third", "Fourth"); 

    public function load () : void
    {
        // Categories; to be read from database
        var _arrChecklists:Array = [];
        var _checklist:Checklist;

        _checklist = new Checklist();
        _checklist.name = _arrChecklistNames[0];
        _checklist.category = "test";

        _arrChecklists.push({label: _checklist.name, data: _checklist});

        _checklist = new Checklist();
        _checklist.name = _arrChecklistNames[1];
        _checklist.category = "test";

        _arrChecklists.push({label: _checklist.name, data: _checklist});

        currentData = _arrChecklists;

        dispatchEvent(new Event(MyConstants.CHECKLISTS_LOADED));
    }
}

It is not the complete code, because in another class is called the load() function, but I think that's enough.

And it's the custom cellrenderer class:

...
public class ChecklistCellRenderer extends CellRenderer
{
    protected var _cbCheckbox:CheckBox = new CheckBox();
    protected var _sprRowBackground:Sprite = new Sprite();
    ...

    public function ChecklistCellRenderer ()
    {
        super();
    }

    override protected function init () : void
    {
        with (_cbCheckbox)
        {
            addEventListener(MouseEvent.CLICK, onCheckboxClicked);
            addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
        }

        addChild(_sprRowBackground);
        addChild(_cbCheckbox);

        super.init();
    }

    override protected function drawLabel () : void
    {
        super.drawLabel();

        if (this.label)
        {
            // place checkbox
            _cbCheckbox.setPosition(5, 5);

            // shift x-coordinate of label to make room for checkbox
            this.label.x = 36;
            this.label.y = 4;
            ...
        }
    }

    override public function set data (value:Object) : void
    {
        super.data = value;

        label.text = value.highway;
    }

    private function drawState () : void
    {
        _sprRowBackground.graphics.clear();

        // color the rows alternatively white / light grey
        if ((index % 2) == 0)
        {
            _sprRowBackground.graphics.beginFill(MyConstants.LIGHTGREY);
        }
        else
        {
            _sprRowBackground.graphics.beginFill(MyConstants.WHITE);
        }

        _sprRowBackground.graphics.drawRect(0, 0, this.width, this.height);
        _sprRowBackground.graphics.endFill();
    }

    override public function set index (value:int) : void
    {
        super.index = value;

        drawState();
    }
    ...
}

Thanks in advance for your help.

Hello Eugene,

I would force selection false checkbox (if it is the default value that you expect) in a set data() in your ChecklistCellRenderer.

Tags: BlackBerry Developers

Similar Questions

  • end shuttle bean list - do not fill

    Hello
    I'm on RUP6 with the bean Shuttle which lists times leader and alphanumeric.
    I don't want the end list be pre-filled.
    Guide DEV stipulates that
    «Note: If you do not want to pre-populate the list end when the page is initially rendered, you can leave the choice list view definition, lookup view Instance, drop-down list display attribute, attribute value list box and drop-down list Description attribute empty.» OA Framework takes care to preserve the values of the user selected in the list on the right when the page refreshes"

    But if I followed the above and leave them empty I get this error

    oracle.apps.fnd.framework.OAException: oracle.jbo.InvalidDefNameException: Houston-25004: name of the definition for the type of the view definition is invalid

    Any idea?

    Thank you
    Anatoliy

    Anatoliy,

    I went through your file Xml, I did the same and go below Xml and its works well.

    
    
      
    
    
      
    
    
    

    Edit the XML and check it out.

    Kind regards
    GYAN

  • Change the style of the drop-down list for the fill-in-the-white questions

    As the title says, I just want to know how to change the style, or at least font size in the drop-down lists to fill-in-the-blank questions. By default have a tiny font that is difficult to read, and a blocky interface. I can do to fix that?

    Hello

    I'm sorry, but this is not possible at the moment. If you fill a feature request (as I already did) to find out a better way to format these drop-down lists?

    Lilybiri

  • CW3D chart fill color question

    Hello

    When I use CW3DGraphLib_CWPlot3DSetFillColor on a lot that I created in the IUR, everything is OK apart that the value of blue is actually red and vice versa with the red color value.

    When I add a new path using CW3DGraphLib_CWPlots3DAdd and then change color with CW3DGraphLib_CWPlot3DSetFillColor the color displayed is not the same when I put the same color value to the plot that I created in the IUR.

    Worse still, it is not possible to set the color in white or black. RED, GREEN and BLUE have the same value, the result is always gray.

    What I did wrong?

    Please find attached a test program that demonstrates this behavior.

    Bertrand

    Hi Bertrand,.

    I found the other setting, you need to change to get the fill colors to look right.  When you create a new path, the new path takes the properties of the PlotTemplate object.  In this case, the default PlotTemplate object has the property ColorMapStyle the value "1 - cwShaded" by default.  If you change this "0 - cwNone ', the behavior will be the same as your other parcel of land.  Please let me know if you have any questions!

    NickB

    National Instruments

  • How to use the drop-down list box to fill in a text box

    I'm a beginner when it comes to Java Script.  I have seen a lot of different discussions, look at a lot of articles "helping" Acrobat 9 and Java Script, but only to be left confused and dazed.  I hope someone can tell me how to write a script that fills a text box that sits on my form with the value of exports of the selection in the combo box...

    Thank you

    If you want that the read-only text box, simply set with the following custom calculate script:

    Set this field to the value of the drop-down list box

    Event.Value = getField("combo1").value;

    but replace "combo1' with the actual name of the combo box field.

    If you want something else, post again with more information.

  • Boot disk is automatically fill, big questions!

    Hello, I have an Air of Macbook 13 inches in mid-2011. Recently, I get the error message saying that my boot drive is full. This has happened on and outside for the last week and a half, where the storage is filled automatically. I really should have anywhere from 42 to 47 GB of free storage left on my computer, but when I noticed that storage fills up and behind my computer, I check storage declining considerably. For now, my computer works normally and the storage space is normal, but I know it will happen again in the next day.

    I downloaded the OmniDiskSweeper, and this did not help. I have DiskDiag that I use whenever I open my computer, and it removes generally above 1 GB memory cache daily. I do not have TimeMachine activated, nor do I have Mail enabled for my email account (I prefer to use the browser). My iPhone can only sync manually with my laptop when it's plugged in and I don't have iCloud turned to back up my things. I crossed FirstAid on disk utility; and I tried to search for files that could potentially have spared themselves even more.

    I am so confused as to have an application that can better locate files problem and solve the problem? Where should I go from here? Especially since my problem is recurring and don't happen every time I start the computer, but very often happening recently?

    Sometimes, you need to run OmniDiskSweeper as root to find information about files that you don't normally see. Use these instructions:

    http://www.MacObserver.com/TMO/article/how_to_recover_missing_hard_drive_space

    DO NOT MAKE ANY CHANGES WHILE ODS IS UNDERWAY!

    Ciao.

  • After formatting and reinstalling firefox exception lists are already filled.

    I've just formatted my laptop and reinstalled windows and Firefox. After importing my old favorites, I installed Adblock Plus and pulled up to my old block list. Then I updated Windows and then install small stuff like 7zip, Symantec,... and the next thing I know is that Firefox slowing down and when I checked, lists of the exception for pop ups, image loading and Add-ons have been completely full - and I didn't know everything of the first hundred of sites listed.
    How can this be? I went only to pages like youtube, yahoo and google, and only after the installation of symantec...
    Help is greatly appreciated!
    Thanks in advance!

    Pasanius

    Some security software can be added to that list Spybot S & D is known to add a list of vaccination, but other security software can do the same.

    http://KB.mozillazine.org/Firefox_hangs#Internet_security_software

  • How to capture when visa resource dropdown list control is filled

    Hi all

    I use a resource name of Visa controls on my front.  This control can sometimes take a few seconds to fill in when a user first clicks on the drop-down arrow.  I would firstly the cursor occupied for the duration that this control is looking for resources, but can't seem to find an event to determine when it's finished.

    What I do currently uses a structure of the event and supported on this control mouse event set up to define the busy cursor when the user first clicks it.  Now I need a way to trigger an event to unplugged the slider when it's done.

    It's really just a cosmetic problem, but any suggestions would be great.

    It seems that you can use the filter event "Mouse Down" on the VISA control to set the busy cursor and the regular event "Mouse Down" to release.  Works in LV 2011.

  • If I have several fields and if I select a field in a drop-down list it will fill the other fields

    If I have several fields and if I select a field in a drop box is it possible to auto poplulate the other fields.

    Thank you

    Brain

    Please post your question on InfoPath 2010 at the following link

    http://social.technet.Microsoft.com/forums/en-us/sharepoint2010customization/thread/e70c23a9-1b68-4EF9-9FB4-923997043e56/

  • Hello! Pre-filled form questions

    Hello!

    I'm very new to using Adobe and I try to do a pre-filled form interactive adobe. I have the boxes communicate/calculate the each other.

    For example, I have a Fahrenheit box which offers a Celsius area that computes the response at the entrance in the Fahrenheit box. The problem I have is when Fahrenheit is not applicable in certain uses of the shape, the Celsius box always responds to-17, 80 ° which is equal to 0 ° F, which is in the form is the answer because nothing has been typed. I need the box does not calculate when is not a response to enter.

    Can someone let me know the best solution for my problem?

    Thank you!

    First of all, stop thinking about it. What is the numerical value of a string NULL or mull?

    Many programs treat as zero. And that's exactly what JavaScript if left to itself.

    Fortunately, most computer languages and scripting languages have instructions conditional and properties, statements or methods that make the difference between a null and zero string. This type of coding will require that a custom JavaScript coding.

    I guess that you do not want to delete any results.

    For the Celsius box (text field), you must create a custom JavaScript that uses the conditional "if" statement to test whether the Fahrenheit entry field is an empty string and not zero.

    / default null result Celsius sring.

    Event.Value = "";

    get the object field for Fahrenheit on the ground;

    var oFahrenheit = this.getField ("Fahrenheit");

    test if string field value is zero;

    If (oFahrenheit.valueAsString! = "")

    {

    conversion of calculation only if the value of Fahrenheit not null;

    Event.Value = (oFahrenheit.value - 32) * 5 / 9;

    } / / end of non-null value;

  • Drop-down lists of the fill of the text fields on a different page from the drop-down list.

    Hi all

    I have a form with multiple pages. The first page contains a number of drop-down lists. These lists, drop-down list when the option is chosen, must complete a field text on another page. I can get the drop down menu to populate the text field when it is on the same page, but as soon as I move the text field to another page, the script does not work. Can anyone offer a solution? I used javascript on the changes to the scripts.

    Every time reference you the other object... so I guess in the code located on the DDlist.

    Paul

  • List component: problem filling with actionscript

    As described in: ext = Flash_MX_2004 http://livedocs.adobe.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?cont & file = 00002489.html per no screen name

    Using code to add or remove items to list works very well with files with little code. Add any other code (not related), it is not populate the list correctly.

    Makes me maaaaaaad.

    I tried various export on the first frame / load classes in the framework: options.



    Thanks, GWD.

    I did a bit of code remove, but you convinced me to do a lot more in detail and I get at least a populated list now. The 'offending' code seems to be defining the functions of prototype for arrays (if attached) that appear to be independent. (Don't think that there is something wrong with this code in itself). Perhaps these change the array class which interfere with the loading of the class list or something. Oddly enough, I still have a defined string prototype function that does not seem to cause problems.

    Nasty little problem, because it arises only in the update when I thought I could got the lists already works.

    Thank you

  • fill out question of XML attributes

    I've got an XML file like this:

    As you can see, I have two packages.  I was able to get Labview to read in an array of child node two, but now how do I read in the attribute as an array or a collection of record for each 'proto' and then get the data only.  For example, I would like to retrieve data from the #2 package and it should produce a "EF: AA:FB:0. "C: 0d", how can I do this?  I know how to retrieve a single xml file, but get to the part of the attribute is a bit difficult here.  Thank you

    Oh!  This one is new for LV9.  I'm sorry.  Here is a variation using .NET (next you tell me are you on Mac).

  • Listed under hosts basic UI Question VM on vCenter

    What I want when I connect to vCenter is to see which virtual machines are running under each host. Almost as if the host would be a record and a virtual machine running on it would be a child object under it. I can't seem to find the setting for this and it would be useful to vmotion much easier for us.

    Is attached a picture of how it looks now.

    Yes, it's because of the configuration of the Cluster.

    André

  • Fill the list with Instances

    Hi all

    Is it possible to fill the results in a drop-down list with the name of the entity instances.

    for example, I instantiated instances 4 x by the name of the child as part of the entity of children.
    HARRY
    BARRY
    SALLY
    LARRY
    Then on a separate screen, I want a drop-down list to be filled with the name of the child.

    for example
    Maybe, I have a question:
    what is your favourite child (which is a drop down showing 4 instance names (HARRY,BARRY,SALLY,LARRY)
    I'm on v10.1


    See you soon

    Hello

    There is a way to make this out-of-the-box, but all depends on your data model.

    I assume here that you have 2 entities, the person and the child. The child has an attribute called 'name of the child. "

    Creates a one-to-one between the person and the child relationship, that he calls "the child preferred person '...

    Then, create an individual question screen. Add a control to the "relationship of entry" to the screen in question. For the 'legend', write something like "Please choose your favorite child." For the "attribute" display, choose the name of the child.

    This will display the question exactly as you want - it will ask the user to select from a list of all children.
    Of course, if the person can have many favorite children, create a relationship one - several. However, this will display the names of the children as the boxes, because the user is now allowed to select more than one.

    If the relationship is just together, you can then use this relationship to access the name of the favourite on the level of the individual child (using InstanceValueIf), or you can run the rules that apply only to the favorite child.

    It's just a suggestion that Ive just tested in 10.3, I did 10.1 at hand at the moment but don't remember which is new to the brand (others, please correct me if I'm wrong). Give it a go, see if it works and get back to me, if it's not. If this does not work on 10.1 you should certainly consider the upgrade to 10.3 for a host of other reasons too. Otherwise, it is achievable with a custom control.

    See you soon,.
    Ben

    Ben Rogers
    Senior Consultant - Monad Solutions
    http://www.monadsolutions.com

Maybe you are looking for