IllegalStateException when Date by selecting the second time by using the date picker.

I didn't think you could add a DatePicker to a field, and the only way to use the component is to use the method. doModal(). So I created a button which FieldChangeListener calls the method. It works the first time I click on the button and select a date, but the second time I get IllegalStateException.

datePickerButton = new ButtonField("Date", ButtonField.CONSUME_CLICK | ButtonField.FIELD_RIGHT);
datePickerButton.setChangeListener(new FieldChangeListener() {
    public void fieldChanged(Field field, int context) {
        UiApplication.getUiApplication().invokeLater(new Runnable()
        {
            public void run()
            {
                datePicker.doModal();
                datePickerButton.setLabel(SimpleDateFormat.getInstance(DateFormat.DATE_SHORT).format(datePicker.getDateTime()));
            }
        });

    }
});

Thread [Ritis_Maps (181) id = 295359488] (Suspended (exception IllegalStateException))
SpinBoxDateTimePickerView (field) (Manager, int) .setManager line: 5399
DateTimePickerDialog$ ConfirmManager (Manager) .insertInternal (field, int) line: 2203
DateTimePickerDialog$ ConfirmManager (Manager) .add (Field) line: 545
DateTimePickerDialog$ ConfirmManager. Line (field, ButtonField, ButtonField): 307
DateTimePickerDialog. (DateTimePicker, XYRect, long) line: 94
DateTimePickerController.getDateTimePickerScreen (XYRect) online: 332
DateTimePickerController.doModal (int, XYRect) line: 340
DateTimePickerController (DateTimePicker) .doModal () line: 255
AdvancedIncidentListOptions$ 5.run (line): 193
Line .dispatchInvokeLater (Runnable, object, int) UImain (Application): 1456
UImain (Application) (Message) .doProcessNextMessage line: 2088
UImain (Application) (Message) .processNextMessage line: 1530
UImain (Application) () .enterEventDispatcher line: 1371
UImain.main (String []) line: 24

Maybe the datePicker does not clean themselves properly and you must create a new instance each time. I guess that since there doModal there are a few static fields/methods within the class to reiinitialized on each call.

Tags: BlackBerry Developers

Similar Questions

  • We get a SIGBUS error when you press NavigationPane a second time.

    Hello!

    Im working on an application of news at the moment. The news are displayed in a list. When a ListItem is triggered, the navigation pane is pushed to the next page, like this:

    ListView {
                            property variant newsListViewOrientation: orientation;
                            id: newsListView
                            dataModel: xmlDataModel
                            scrollIndicatorMode: ScrollIndicatorMode.ProportionalBar
    
                            onTriggered: {
                                newsListView.clearSelection()
                                newsListView.select(indexPath, !newsListView.isSelected(indexPath));
                                var selectedItem = dataModel.data(indexPath);
    
                                var page = newsDetailPage.createObject();
                                page.title = selectedItem.title;
                                page.info = selectedItem.info;
                                page.date = selectedItem.date;
                                page.imagePath = selectedItem.img;
                                newsNavPane.push(page);
                            }
    
                            onSelectionChanged: {
                                var selectedItem = dataModel.data(indexPath);
                                console.log("selected Index: "+indexPath+" | selectedItem: "+selectedItem.title);
                            }
    
                            layout: StackListLayout {
    
                            }
    }
    

    The first time when you trigger the ListView, it works very well and pushed to the next Page. If you skip the navigation pane and try to push it again, the application goes down, and I get the following error on the console:

    Process 496513394 (SanofiTemp) terminated SIGBUS code=1 fltno=5 ip=7899eaf2(/base/usr/lib/qt4/lib/libQtXml.so.4.8.5@_ZN8QDomNodeC2EP15QDomNodePrivate+0x15) mapaddr=0000eaf2. ref=00000005
    

    Some more information:

    ListView is part of a tab, which belongs to a TabbedPane. The TabbedPane has another tab, with an another NavigationPane (the other NavigationPane works fine btw). And another thing: my NavigationPane has this game:

    onPopTransitionEnded: {
                    page.destroy();
                }
    

    No idea what means this error and how to solve?

    Thanks in advance!

    I found the error comes to me immediately. For those who already have this problem:

    The problem has been the onSelectionChanged method:

    
                            onSelectionChanged: {
                                var selectedItem = dataModel.data(indexPath);
                                console.log("selected Index: "+indexPath+" | selectedItem: "+selectedItem.title);
                            }
    

    This code was interrupted somehow push again navigation pane. If anyone knows why, feel free to explain it

  • IllegalStateException when adding label to the screen from timertask

    Hello

    I have a thread that gets the text for a labelfield. I just want to add the labelfield on-screen when the thread is finished.

    I have a timertask that checks when the thread is finished and when the thread is finished, he tries to add the label to the form.

    This is the code, but when I try to add the label I get illegalstateexception-

    GTC GetContent = new GetContent();
    t = new Thread (gtc);
    t.Start ();
                
    Timer = new Timer();
    timer.scheduleAtFixedRate (new TimerTask() {}
    public void run() {}
    {if (! t.IsAlive ())}
    Timer.Cancel ();
    Test string = t.getTextLabel ();
    addLabel (new LabelField (test));
    }
    }
    Invalidate();
    }
    (}, 1000, 1000);

    }
            
    Private Sub addLabel (LabelField l) {}
    Add (l);
    }

    If she runs in an external thread to wrap it in an invokelater (or the synchronization on the eventlock).

    You can check the exceptions by surrounding the code with a try/catch.

  • PS3 connected to Windows 7 on laptop with usb ethernet and converter cable. Technician COMPUTER put in place, but the second time I used it it gave me the DNS 80710102 error

    I don't know that it's a quick fix that I'm used to the Macs. Someone please advise

    Hello

    Did recent changes to the computer?

    Follow these steps.

    1 - Open a browser and enter the router's IP address in the navigation bar. For most routers, the default IP address is (192.168.1.1).

    2 - Enter the user name and password to access the router. Press 'OK' and the console application will be displayed in the browser window.

    Tab 3 - Click the "Password". The UPnP settings are located in the same window as the password of the router settings.

    4. Select 'Disable' titled "UPnP" area and click on the Save"" button. Close the console of the router. Start the Playstation machine and connect to the Internet.

    For more information.

    http://community.EU.PlayStation.com/T5/PlayStation-Network-General/unofficial-DNS-error-fix-80710102/TD-p/7903885

    I hope this helps.

  • Why do I need to select the next button twice to move forward in my quiz

    I have a number of true/false and multiple choice questions in this project.  The user still has 2 attempts to get the correct answer with your comments.  When they are done with the question they are asked to select the button "next".  Selecting the next button does not advance the slide of the first time well.  You must always select a second time.  I played with adjust active and inactive times on the timeline, but that doesn't seem to have anything to do with it.  Remove the 'next' button is not an option at this stage because it is mentioned in the audio commentary for each answer to each question. Any ideas?

    If you insert a slide of questionnaire based on the model of default slides, normal stacking order is that the next button is below the Clear key. Maybe you had already removed the Clear button? Try to use Arrange to change the stacking order.

    You do not click the next button twice, you must click the button submit once, then press on Y or click the slide. If the suspension point is far from the end of the slide, it will take a while, if actions are left to "continue". Change the point to pause to be near the end of the slide.

  • RegEx fails when it should pass the test, what gives?

    I have a question why Flex treats the next two regex differently object. in the first, I define a regular expression as a string and then pass that object. the second time I use a string literal and specify to ignore the case 'i' and flex treats as own. What gives?

    How can I tell flex to use the 'i' in the string the regular expression "searchPhrase", or is this not possible.

    ====


    var searchPhrase:String = "so";
    var expression: String = "/" + searchPhrase + ' / i ';
    trace (
    expression) ;// ' / so / I.

    var regEx: RegExp = new RegEx (expression);

    trace (regEx.soucre);// "/ so / I ')

    var testString:String = "So";

    trace (regEx.test (testString)); / / false;

    regEx = new RegExp ("Yes", "i");

    trace (regEx.source); 'so
    trace (regEx.test (testString)); / / true;

    Hi Jed,

    You get a different result is because you do not use the regular expression correctly when you place the expression as a string. http://livedocs.Adobe.com/Flex/2/langref/RegExp.html As you will see, the Builder gets two arguments: RegExp (re: String, flags: String) where the first parameter is the expression and the second is the flag. When you do this:

    var searchPhrase:String = "so";
    var expression:String = "/" + searchPhrase + "/i";
    trace (expression);// "/so/i"
    var regEx:RegExp = new RegEx(expression);
    

    Then in fact you do this: var regEx: RegExp = new RegEx("/so/i"); Which is not what you want because ' / so / I ", in its whole, is considered the expression and you do not specify a flag (the second parameter is missing in the constructor). The correct format would be: var regEx: RegExp = new RegEx ("Yes", "i"); or var regEx: RegExp = / so / i;

    I hope you understand now,

    Kind regards

    Barna Biro

  • I use a horizontal menu of the widgets library. All right, except that I would have any of the drop-down list list stay open after selecting the top item... and remain open after the selection of a menu under item - so that the viewer knows where they are

    I use a horizontal menu of the widgets library. All right, except that I wish I had the all menu drop-down list stay open when you have selected the top element. And when you have selected a menu SUP item - so that the viewer knows where they are in the navigation. Who is? Thank you!

    Hello

    There is no native function to Muse to achieve this goal. However, if you host your site on Business Catalyst, you can take advantage of the functionality of breadcrumbs. He won't let the open drop-down list stay, but it will show customers on what page they are and that he can see that they have followed to reach the page. For more information, please visit the following link http://helpx.adobe.com/business-catalyst/partner/add-breadcrumbs.html

    Kind regards

    Aish

  • Select the values from the list

    All,
    I need help for this task.
    I have a Select list element with display value (names emp) real values(emp ID) /LOV now I want to complete the following text items (Dept, location, wages etc.) based "names of emp" I took from the list select... any help? Thanks in advance.

    Hello

    The simple way is:

    1. change select list property settings: action, highlighted Page changed: "Send Page".
    2. write a process on submit, type pl/sql, then fill the (Dept, location, salary, etc) with the select query where condition check for emp_id =: Select_list name.
    set the condition for the process while it is called when a user selects the name of the employee.

    THX
    MK

  • The color selector is to select the background color instead of the foreground color.

    You know how when you are painting, you can hold ALT and it will choose a color of the cloth? Well, for some reason, mine still picks up the color, but it assigns background color instead of the foreground color. And when I actually select the eyedropper color tool, it will only select the background color but when I hold the Alt key, you select the foreground color. Basically, he is knocked down to where it is supposed to select. Do you know how it folding? He drives me crazy. Thank you.

    In the Color Palette (window > color) click on the foreground swatch. A "ring" will appear around it.

  • -> Client_OLE2.create_obj ('Excel.Application') when he called by form of Oracle for the second time to desnt work


    Here is the code that is written in "WHEN-BUTTON-PRESSED" trigger of a button in the form of Oracle

    Questions:

    1. for the first time in the excel sheet data loaded into record block.

    2. If I once again to open the screen and try to import another excel file the record block appers to be empty and no error thrown

    Comment:

    1. second time when I try to download the excel sheet, the code ends in "Client_OLE2.create_obj('Excel.Application')" and not further progress (on track by putting the message in the code)

    Code:

    DECLARE
    application Client_OLE2. Obj_Type;
    Client_OLE2 workbooks. Obj_Type;
    workbook Client_OLE2. Obj_Type;
    Client_OLE2 spreadsheets. Obj_Type;
    worksheet Client_OLE2. Obj_Type;
    worksheet2 Client_OLE2. Obj_Type;
    cell Client_OLE2. OBJ_TYPE;
    Client_OLE2 args. OBJ_TYPE;
    cell_value varchar2 (100);
    num_wrkshts NUMBER;
    wksht_name VARCHAR2 (250);
    EOD Boolean: = false;
    j integer: = 1;
    v_fName VARCHAR2 (250);
    BEGIN
    -Get the name of the file to open
    -v_fName: = "D:\MyDevelopment\Forms\Samples\WebUtil\Read_Excel\planets3.xls";
    v_fName: = WebUtil_File.File_Open_Dialog)
    directory_name = > "C:\". »
    -, file_name = > Get_Form_Property (:System.Current_form, Form_Name) |'. XLS
    , File_Filter = > null
    , Title = > 'Select customer filename to open.'
    );

    IF (v_fName IS NOT NULL) THEN

    -The following sets a communication with the excel worksheet
    -- --------------------------------------------------------------
    -Open the OLE application
    application: = Client_OLE2.create_obj ('Excel.Application');
    -Keep the hidden application
    Client_OLE2.set_property (application, 'Visible ','false ');

    workbooks: = Client_OLE2. Get_Obj_Property (application "Filing cabinets");
    args: = Client_OLE2. CREATE_ARGLIST;

    -Open the selected file
    -- ----------------------
    Client_OLE2.add_arg (args, v_fName);
    workbook: = Client_OLE2. GET_OBJ_PROPERTY (Workbooks, 'Open', args);
    Client_OLE2.destroy_arglist (args);

    worksheets: = Client_OLE2. GET_OBJ_PROPERTY (workbook, 'Worksheets');

    -Get the number of spreadsheets
    -- ------------------------
    num_wrkshts: = Client_OLE2. GET_NUM_PROPERTY (worksheets, 'Count');
    worksheet: = Client_OLE2. GET_OBJ_PROPERTY (application, 'activesheet');

    -Go to the first record
    go_block ('planets');
    premier_enregistrement;

    loop
    If: system.record_status <>'NEW' then
    create_record;
    end if;

    When the exit NEM;

    for 1.3 k loop - 3 frames / record
    args: = Client_OLE2.create_arglist;
    Client_OLE2.add_arg (args, j);
    Client_OLE2.add_arg (args, k);
    cell: = Client_OLE2.get_obj_property (spreadsheet calculation, 'Cells', args);
    Client_OLE2.destroy_arglist (args);
    cell_value: = Client_OLE2.get_char_property (cell, 'Value');

    If upper (cell_value) = "NEM" then
    Nem: = true;
    Message ('end of data');
    "exit";
    end if;

    -Could be done in this way also-->

    / * If k = 1 then
    : dept.deptno: = cell_value;
    end if;

    If k = 2 then
    : dept.dname: = cell_value;
    end if;

    If k = 3 then
    : dept.loc: = cell_value;
    end if;
    */

    -Less code in this way - >
    Copy (cell_value, name_in ('system.cursor_item'));
    next_item;

    end loop; -for

    j: = j + 1;
    end loop;-main loop

    -Release the handles object Client_OLE2
    IF (cell IS NOT NULL) THEN
    Client_OLE2.release_obj (cell);
    END IF;
    IF (spreadsheet IS NOT NULL) THEN
    Client_OLE2.release_obj (Worksheet);
    END IF;
    IF (spreadsheets IS NOT NULL) THEN
    Client_OLE2.release_obj (Worksheets);
    END IF;
    IF (worksheet2 IS NOT NULL) THEN
    Client_OLE2.release_obj (worksheet2);
    END IF;
    IF (workbook IS NOT NULL) THEN
    Client_OLE2.release_obj (Workbook);
    END IF;
    IF (workbooks IS NOT NULL) THEN
    Client_OLE2.release_obj (Workbooks);
    END IF;
    Client_OLE2. Invoke (application, 'Quit');
    Client_OLE2.release_obj (application);
    ON THE OTHER
    Message ("no file selected.'");
    message(' ');
    RAISE Form_Trigger_Failure;
    END IF;
    END;

    Any advice will be appreciated...

    Thank you!!!

    Hello

    personally, I release the cell object as soon as the value is written in a variable and not in a procedure that closes the file. Note that there are many cells read (so you should relase each cell individually).

    The publication of the application is such:

    Procedure CloseApplication is

    Begin

    CLIENT_ole2.release_obj (Workbook);

    CLIENT_ole2.release_obj (Workbooks);

    CLIENT_ole2. Invoke (application, 'Quit');

    CLIENT_ole2.release_obj (application);

    End CloseApplication;

    Greetings,

    SIM

  • lov works not very well when it is run the second time

    Hello

    I have a lov VO with the following query:

    Select distinct attribute1, org_id po_headers_all where org_id =: 1

    When I run the vo in LOV AM
    vo.setWhereClauseParams (null);
    vo.setWhereClauseParams(0,iOrgId);
    vo.executeQuery ();

    LOV region:

    Attribute1 is messageStyledText with the real licence to search
    Org_id is the value of the form

    Lov maps:
    LovMap1 for basepage lov: true research permit
    Selective wrong search criteria

    LovMap2 for the Org Id
    Make a single value of the form OrgIdFV
    fact OrgIdFV as part of criteria.

    When I run the page, it works very well with a % and tab once. Second time if I delete the value a lov in entry and write a % and a tab once again, this Type of column not valid error

    Help, please.

    Thank you
    POOJA

    POOJA,

    This will not work unless you write the VOImpl executeQuery method. that is to replace the standard executeQuery method.

  • In version 13.0 is selected the option "when Firefox starts to show my windows and tabs from last time", but I always get default page of Firefox.

    Even thought is selected the option ' when Firefox starts to show my windows and tabs from last time "I always have the default page of Firefox.

    Hi Goldie_,

    I guess you don't watch this page when you closed Firefox last time. Also that you are not in private, correct navigation mode? Looks like it is maybe a problem with Firefox being able to save your file pref.js. You should try the steps listed in the preferences section that won't save trouble. Try and let me know how it goes.

    Hope this helps!

  • "I update firefox from 7 to 8 and now when I run firefox every time it opens the page 'do start with firefox', in options I select the option ' display a blank page" How can I solve this problem?

    I update firefox from version 7 to version 8, now when I run firefox every time it itself open the Web "to start with firefox", in firefox options I select the "show a blank page" but his does not work. I use firefox on windows XP - SP2.

    Try to restart Firefox, the time of a page (s) after the beginning of a new version should disappear. In fact this last time with 8.0 they did not come to the top for me.

    If it works then raise Subject: config and insert the url of the page into the filter. Right-click on anything that appears and use "Reset".

  • Changes of date and time when you go to the line

    On the date and time to start on the computer is fine.

    When I go to the line for a unknown reason date and time moves forward 12 hours. This happens not always as some time it will be presented one, two or three days without change.

    Very frustrating because it affects the majority of the applications where the date and time are referenced.

    I'm missing something in the settings of date and time.

    [Moved from the forum comments]

    Hello

    -What operating system is installed on the computer?

    If you have installed Windows 7, you can run this Microsoft Fixit and check if that helps.

    Difficulty of broken desktop shortcuts and common system maintenance tasks: http://support.microsoft.com/mats/system_maintenance_for_windows/?wa=wsignin1.0

    Additional information.

    Set the clock: http://windows.microsoft.com/en-in/windows7/set-the-clock

    Thank you.

  • cannot get the keyboard to select windows xp when I have only four seconds to select is stuck on windows xp professional and cannot get the keyboard to use arrows to select

    cannot get the keyboard works when reebooting said cd I need driver sata when reebooting he gives four seconds to schrol up to windows xp but the line is highlighted on a windows xp profesional bellows and can't seem to choose windows xp on its own keyboard wont respond but lights from F1 or f2 f3 until f12 choose please help

    A few old machines will not recognize a USB keyboard/mouse until after Windows starts.  Look at the back of your computer and see if you have a PS/2 (round) connector for a keyboard and a mouse.  If you do, then you will need to use a keyboard with a round PS/2 connector or a USB-to-PS/2 adapter and plug the PS/2 connector on the back of your computer so that it recognizes the keyboard until Windows starts on your keyboard.

    The SATA driver applies to your hard drive.  A CD of start-up/installation of Windows XP does not recognize a SATA hard drive.  If you install Windows, you will need to hit F6 at the right time and insert a floppy with the SATA driver on this subject.

    HTH,
    JW

Maybe you are looking for

  • Assist in the creation of a unit

    I have a measure of engine emissions, which has a unit of g/kw-h.  Can I set the dimension of this works well with calculations of quantity in function?  So, if I multiply him by kW, I get g?

  • Compaq presario cq56: compaq presario cq56 power on password

    Hi Sir, I have a laptop compaq presario cq56, who have a problem, it power on or administrator password. I tried 3 times shown 'off system' and key: 87814070 Please help me in this problem...

  • 0x8002801C error code

    How to fix eror code 0x8002801C error with an entry to the OLE registry in C/windows/sytem32/stdole2.tlb

  • Huawei Mobile Connect Modem 3 G installation problem

    Hi, I use Windows Vista Home Premium SP2 on a laptop Dell Inspiron 1520, with all the updates on the system and updated regularly. Last week, I bought a unit of USB stick from a vendor (Meteor, Ireland) to connect to the internet using this stick. I

  • jQuery to update the background color select list

    I have this element in a tabular presentation.< select name = "f15" id = "f30" autocomplete = "off" >< option value = "" selected = "selected" > < / option > "ROSE < option value = "PINK" > < / option >< option value = "SILVER" > SILVER < / option ><