Combo box selected index is not working.

Hi guys, I have a problem with changing the combo box selected index.
I load a list of phone types(such as "Home","Office",...) using Remote Object and assign it as a data provider for a combo box.What I need is to select a specific index in the combo but combo.selectedIndex statement doesn't work for the first time, I mean the combo changes its index only if I load the view again.
I checked different examples, solutions but none of them worked for me!! Can anyone here help me to figure out the problem?
Here is my Code:
<mx:Canvas creationComplete="init()"
             xmlns:mx="http://www.adobe.com/2006/mxml">
     <mx:ComboBox id="comboPhone0"
                prompt="Type"
                dataProvider="{phoneTypeList}"
                />
<mx:Script>
     <![CDATA[
[Bindable]
private var phoneTypeList:ArrayCollection;
private function init():void
     loadPhoneType();
private function loadPhoneType():void
     phoneTypeLoaderService.getPhoneType(); //phoneTypeLoaderService is a remote Object to load the phone types
private function handlephoneTypeLoadResult(ev:ResultEvent):void
     phoneTypeList=ev.result as ArrayCollection;
        comboPhone.selectedIndex = getComboSelectedIndex("HOME");
private function getComboSelectedIndex(phoneType:String):int
var index : int= -1;
var result : int= -1;
     for each (var pt:PhoneType in phoneTypeList)
          if (pt.type == phoneType)
                    result = index;
                    break;
          else{
               index++;
          return result;
     ]]>
     </mx:Script>
</mx:Canvas>

hi
I think in getComboSelectedIndex() method index should initialized to zero. If that does not work use after assigning the data from result event.
phoneTypeList.refresh();
Hope this helps
Rush-me

Similar Messages

  • Adobe Acrobat 9: Javascript array populated combo box - Selected answer will not save

    I have a combo box on one of my forms that is populated using a Javascript array.  The combo box is populating just fine, but when an item is selected from that combo box, the selected item does not save when the user saves the document.  Any suggestions as to what the problem is and how it can be corrected?  I am a loss as to where to even begin looking.  Any help is greatly appreciated.
    Thank you.
    Lisa

    You might also want to check the Scripting forum
    http://forums.adobe.com/community/acrobat/acrobat_scripting

  • Select() function is not working properly in solaris 10.

    Hi ,
    We are facing an issue with select() in Solaris 10. we had written a sample program to this issue.
    Program name :- sel.cpp
    int main()
    struct timeval sleeptime;
    sleeptime.tv_sec = 60;
    printf("1\n");
    select(0,NULL,NULL,NULL,&sleeptime);
    printf("2");
    return 0;
    When i run this program in Solaris 9, its printing 1 and after one minute its printing 2.
    When i run this program on Solaris 10, its printing 1 and 2 without waiting for 60 seconds.
    When i tried to print tv_usec, its printing as 0 in solaris 9 and some garbage values in solaris 10.
    I think because of that the above select function is not working properly in solaris 10.
    Why the tv_usec is not taking 0 as default values in Solaris 10?
    We are using our legacy code for past 20 years. So, before going to do any changes we are trying to find why this happenig like this.
    Thanks a lot.
    Regards,
    Srikanth.

    haisrig wrote:
    Hi ,
    We are facing an issue with select() in Solaris 10. we had written a sample program to this issue.
    Program name :- sel.cpp
    int main()
    struct timeval sleeptime;
    sleeptime.tv_sec = 60;
    printf("1\n");
    select(0,NULL,NULL,NULL,&sleeptime);
    printf("2");
    return 0;
    When i run this program in Solaris 9, its printing 1 and after one minute its printing 2.
    When i run this program on Solaris 10, its printing 1 and 2 without waiting for 60 seconds.
    When i tried to print tv_usec, its printing as 0 in solaris 9 and some garbage values in solaris 10.
    I think because of that the above select function is not working properly in solaris 10.
    Why the tv_usec is not taking 0 as default values in Solaris 10?
    We are using our legacy code for past 20 years. So, before going to do any changes we are trying to find why this happenig like this.Hi
    It sounds to me that you've been lucky for 20 years then.
    Local POD variables on the stack that aren't explicitly initialized can contain any value. Here's what I see in your app with dbx
    (dbx) run
    Running: sel
    stopped in main at line 9 in file "sel.cpp"
        9      sleeptime.tv_sec = 60;
    (dbx) print sleeptime
    sleeptime = {
        tv_sec  = -4198732
        tv_usec = 0
    }That's on a Solaris 10 SPARC machine. If I try it on a Solaris 10 x86 box then I get
    (dbx) print sleeptime
    sleeptime = {
    tv_sec = -830490588
    tv_usec = 134510556
    and I see the behaviour that you describe.
    Paul

  • I use the Icalendar at home, at work, and on my Iphone.  I don't want to have to "sign in" every time I need my calendar.  How do I stay signed in?  I have checked the "keep signed in" box, but it does not work.

    I use the Icalendar at home, at work, and on my Iphone.  I don't want to have to "sign in" every time I need my calendar.  How do I stay signed in?  I have checked the "keep signed in" box, but it does not work.

    Welcome to the Apple community.
    Staying signed in at iCloud.com is not a problem for me. Try resetting your browser or emptying its cache.

  • Hello, the 'Save As' dialog box used to allow the backspace button to go up one level in the directory when the focus is in the folder contents box but it does not work any more, please help.

    Hello, the 'Save As' dialog box used to allow the backspace button to go up one level in the directory when the focus is in the folder contents box but it does not work any more, please help. BTW the same 'Save As' dialog in other applications still allow the backspace button to go up one level in the directory.

    cor-el,
    I kept forgetting and procrastinating about following your instructions, since I have internet access only for limited amounts of time and usually I am busy with important tasks when I am.
    Out of the blue, the problem corrected itself (the Save As box started to open full screen, then shrunk down to a normal size and the edges can now be dragged to a custom size).
    Even the copy and paste problem in the filenaming area seems to have been less troublesome lately even though there have been no updates to Firefox in a few weeks.
    Even though I marked the solution as not helpful, the problem has in fact been resolved. I will save the solution instructions in case the issue returns.

  • Select query is not working in BDC Program

    Hi,
    I am working in BDC for update valuation class for T-code mm01.Actually In this BDC i am using two recoding based on material type.
    i am using two internal table : I_DATA and ITAB
    Use I_DATA to hold excle data in which material No, plant , valuation type , valuation No. and ITAB for material No, material type Only.
    So, i am fetching material Type ( MARA-MTART ) through select query. But Select query is not working. and also i did check MARA table according that  Material Number then  material no. exit in Mara Table.
    Note : at run time  I_DATA have 1 row but ITAB have 0 row ....
    DATA: BEGIN OF I_DATA OCCURS 0,
    MATNR TYPE MARA-MATNR,
    WERKS TYPE MARC-WERKS,
    BWTAR TYPE RMMG1-BWTAR,
    VERPR TYPE BMMH1-VERPR,
    BKLAS TYPE MBEW-BKLAS,
    STATUS TYPE C,
    END OF I_DATA.
    DATA : BEGIN OF ITAB OCCURS 0,
    MATNR LIKE MARA-MATNR,
    MTART LIKE MARA-MTART,
    END OF ITAB.
    Loop at I_DATA.
    select matnr mtart from mara into table itab where matnr = I_DATA-matnr.
    endloop.
    Guide me..........

    If you use your
    Loop at I_DATA.
      select matnr mtart from mara into table itab
        where matnr = I_DATA-matnr.
    endloop.
    At end of loop, itab will only contain the result of the last select, so use a
    Loop at I_DATA.
      select matnr mtart from mara APPENDING table itab
        where matnr = I_DATA-matnr.
    endloop.
    better
    if I_DATA[] is not initial.
      select matnr mtart from mara into table itab
        FOR ALL ENTRIES IN i_data where matnr = i_data-matnr.
    endif.
    Some Remarks
    - If actually required (where does I_DATA come from, is it an external format, you need the internal value to use in SELECT statement), check via SE11 the correct [conversion exit|http://help.sap.com/saphelp_nw04/helpdata/en/35/26b217afab52b9e10000009b38f974/content.htm] associated with domain MATNR (Is it truly ALPHA, and not something like MATN1, so [CONVERSION_EXIT_MATN1_INPUT|http://www.sdn.sap.com/irj/scn/advancedsearch?query=conversion_exit_matn1_input])
    - You could try to use BAPI like [BAPI_MATERIAL_SAVEDATA|http://www.sdn.sap.com/irj/scn/advancedsearch?query=bapi_material_savedata] and not BDC
    Regards,
    Raymond

  • Extension in Select-Options is not working

    Hi,
    The extension of select-options is not working for the following statement........
    SELECTION-SCREEN: BEGIN OF BLOCK sel WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_tp_no FOR e070-trkorr.
    SELECTION-SCREEN: END OF BLOCK sel.
    Please Help.......
    Thanks,
    Sheel

    SELECTION-SCREEN: BEGIN OF BLOCK sel WITH FRAME TITLE text-001.
    SELECTION-SCREEN: END OF BLOCK sel.
    Remove the colan ':' from ur code after SELECTION-SCREEN
    write it as
    SELECTION-SCREEN BEGIN OF BLOCK sel WITH FRAME TITLE text-001.
    SELECTION-SCREEN END OF BLOCK sel.

  • Select button will not work

    My 2gb nano's select button will suddenly not work. The rest of the clickwheel and buttons work find, but not the center select button.
    I restored it to original settings. Then after it restarts, you have to select a language. The select button would still not work, but then I slid the "hold" button back and forth and the select button worked to allow me to chose a language. But at the next screen of options (Music/Photos/Extras, etc.) the select button will again not work. Sliding the hold button back and forth doesn't work. I cannot do a menu+select reset because I can't get the select button to respond.
    I have made sure that I have the most updated softward for the nano.
    Any suggestions?

    My select button has not worked for a loong time.. It will occasionally work if I press for long enough or hard enough.. but not very often. This seems to be a common enough problem so there should be a way to fix it..I hope..

  • Why select query is not working?

    CREATE OR REPLACE TYPE prod_type AS OBJECT (
    pid INT,
    pprice NUMBER,
    MEMBER PROCEDURE display(pid IN NUMBER));
    create table prod of prod_type (pid primary key);
    CREATE OR REPLACE TYPE deal_type UNDER prod_type (
    ctr NUMBER,
    OVERRIDING MEMBER PROCEDURE display (pid IN NUMBER),
    insert into prod values(deal_type(101, 4, 1));
    insert into prod values(deal_type(102, 5, 0));
    ------below given select query is NOT WORKING ---------
    select ctr from prod p where p.pid=101;
    Thanks,
    -Nid

    ------below given select query is NOT WORKINGWondering how you inserted data ...
    SQL> CREATE OR REPLACE TYPE prod_type AS OBJECT (
      2  pid INT,
      3  pprice NUMBER,
      4  MEMBER PROCEDURE display(pid IN NUMBER));
      5  /
    Type created.
    SQL>
    SQL> create table prod of prod_type (pid primary key);
    Table created.
    SQL>
    SQL> CREATE OR REPLACE TYPE deal_type UNDER prod_type (
      2  ctr NUMBER,
      3  OVERRIDING MEMBER PROCEDURE display (pid IN NUMBER),
      4  );
      5  /
    Warning: Type created with compilation errors.
    SQL> sho err
    Errors for TYPE DEAL_TYPE:
    LINE/COL ERROR
    4/1      PLS-00103: Encountered the symbol ")" when expecting one of the
             following:
             , not pragma <an identifier>
             <a double-quoted delimited-identifier> final instantiable
             current order overriding static member constructor map
    SQL> CREATE OR REPLACE TYPE deal_type UNDER prod_type (
      2  ctr NUMBER,
      3  OVERRIDING MEMBER PROCEDURE display (pid IN NUMBER));
      4  /
    Warning: Type created with compilation errors.
    SQL> sho err
    Errors for TYPE DEAL_TYPE:
    LINE/COL ERROR
    1/1      PLS-00590: attempting to create a subtype UNDER a FINAL type
    SQL>You made an attempt to create a subtype UNDER a FINAL type - that the reason why can not work ...
    Avoid deriving a subtype from this FINAL type.
    HTH

  • Select list pagination not working for big tables

    Hi,
    i am trying to view a table with large amount of data using tabular form. the pagination using select list is not working in this page. i have selected select list kind of pagination but it is showing "row range 1-15 16-30(with set pagination)' type of pagination. when i lowered the amount of data in the table the pagination type will automatically change to select list pagination. could you please tell me why this happens and any possible work around if any.
    Thanks,
    Jo

    Hi Jo,
    I don't know what you call a large amount of records, but the effect you describe might be intentional by apex.
    The select list pagination would generate a selection tag with (number of records in table/15) options in your page HTML.
    Although there isn't a hard limit to the number of options a select list can have there certainly is a limit to what your browser/pc can render.
    Think about it
    Let's say you table contains a million rows. this would result to a select list with 66666 options. Which your browser won't handle :)
    I very possible the apex team resolved this by simply reverting to row range pagination when the number of select options would grow to large.
    Geert

  • SELECT DISTINCT does not work - Another Problem!

    Dear All
    Previous Post
    I just posted a thread, which has been answered by an expert. It's here:
    SELECT DISTINCT does not work. Why?
    My original problem was that the Query returned duplicate records, and SELECT DISTINCT did not work.
    The solution was to change this select:
    T0.[U_SupInv]      AS 'Link'
    ... to this:
    CAST(T0.[U_SupInv] as nvarchar(100))      AS 'Link'
    The amended Query worked.
    New Problem
    I just discovered that resolving the problem created a new one.
    The field U_SupInv (Link) is in fact a UDF.
    I created it so that all Suppliers' Invoices could be Scanned to pdf files, and these pdf could be linked
    to the respective AP Invoice.
    Originally, when I clicked 'Link' in my Query results, the pdf scan pops up.
    When the Query is amended by adding CAST, the link becomes dead.
    Help
    Could anyone tell me how I can make SELECT DISTINCT work, as well keeping the LINKS live?
    The main purpose of my Query is to help users view the pdf scans by clicking on the links.
    Thanks
    Leon Lai
    Here's my Original Query
    SELECT
    T0.[UpdateDate] AS 'Update Dt',
    T0.[TaxDate] AS 'Doc Dt',
    CASE T5.[TransType]
         WHEN '18' THEN 'PU ' + CONVERT(VARCHAR(6), T0.[DocNum])
         WHEN '19' THEN 'PC ' + CONVERT(VARCHAR(6), T0.[DocNum])
    END 'SAP Ref.',
    T1.[ImportLog]     AS 'Ship #',
    T0.[CardCode] + '' AS 'Supplier #',
    T0.[CardName]      AS 'Supplier Name',
    T0.[DocTotal]      AS 'Rs',
    T1.[BlockNum]      AS 'Reqn #',
    T0.[DocNum]        AS 'Doc No',
    T0.[U_SupInv]      AS 'Link'
    FROM klship.[dbo].[OPCH] T0
    INNER JOIN klship.[dbo].[PCH1] T1 ON T0.[DocEntry] = T1.[DocEntry]
    INNER JOIN klship.[dbo].[OJDT] T5 ON T0.[TransID] = T5.[TransID]
    WHERE
    (T0.[UpdateDate] >= '[%2]' AND
    T0.[UpdateDate]  <= '[%3]' AND
    T0.[U_SupInv] IS NULL)
    OR
    (T0.[UpdateDate] >= '[%4]' AND
    T0.[UpdateDate]  <= '[%5]' AND
    T0.[U_SupInv] IS NOT NULL)
    FOR BROWSE

    Dear István Korös,
    Thanks a lot for your answer.
    I will test your suggestion tomorrow, as it's night and I am returning home now.
    However, I do not think it will suit my requirements for the foll reasons:
    - I worked hard to get rid of the need to enter anything in the @Scan2 field.
    - This UDF was created solely as a text of instruction for my staff.
       Unfortunately I had to fill in something to make the Query work.
    - The problem is that if the user forgets to click the drop-down arrow and leaves @Scan2
       blank, the query does not work.
    - With the help of another expert, I succeeded in ignoring @Scan2 altogether.
    - I posted only a simplified version of my Query on the forum, without the codes relating to eliminating the
      need to enter something in @Scan2, so you may not be aware of my requirement.
    - I hope you understand my reluctance. But I will try your suggestion nevertheless.
    My Suggestion
    I think using PCH1.VISORDER may be the solution.
    If we select only those rows where visorder = 0, then
       - there will be no duplication
       - I need not use SELECT DISTINCT
       - All my LINKS to pdf files will be live because I need not use CAST
       - I may retain that part of my Query which permits ignoring @Scan2 altogether.
    - A Dream!-
    The problem is that I don't know how and where  to place that VISORDER.
    If you think I may be right, could you help me along that line?
    Best Regards
    Leon Lai

  • Multi-select LOV does not work in forms

    the multi select LOV does not work in the form.
    the LOV works individually but in the form it does not work. it does not allow multiple selection from the list.
    is there a workaround for this or is this a bug ...?
    any ideas ...?
    thanx a lot.
    null

    Right, we cannot store more than one value in a single column in a table :), we were getting a lot of requests to support multiple select LOVs but requirements were contradictory if not mutually exclusive.
    The only sense it makes is when used together with user-defined object types (nested tables for example) but the current [application building]infrastructure we have does not support this. However, we are looking into this and this feature maybe implemented in a future release.

  • Double click select all does not work in web site's search area after going back.

    After updating from Firefox ESR v24.8.1 to v31.20 double click select all does not work in a search area after going back or searching again with the same input. It happens before clicking search icon and searching for something else double click select all does not work except it works for one word that's all.
    This issue is with all new Firefox ESR and None ESR I have tried. Also the issue is on all web sites like www.softpedia.com for example.

    Bugzilla has a different login system, unfortunately.

  • "Select Color Range" not working. "Warning: No pixels were selected" returned when attempting to use. Using Photoshop CS6 on a Mac running OS X Yosemite

    "Select Color Range" not working. "Warning: No pixels were selected" returned when attempting to use. Using Photoshop CS6 on a Mac running OS X Yosemite

    Here are three screenshots in succession from trying to perform the color selection:
    Dropbox - Screenshot 2015-02-12 14.57.40.png
    Dropbox - Screenshot 2015-02-12 15.00.14(2).png
    Dropbox - Screenshot 2015-02-12 15.01.00.png

  • CS3 asked serial number suddenly and the box-set serial number not work.

    CS3 asked serial number suddenly, and the box-set serial number not work.

    Elton Adobe which web browser are you utilizing?  Are you signed into http://www.adobe.com/ when you attempt to contact our support team directly at Contact Customer Care.
    I would recommend utilizing a different web browser and contacting our support team directly as suggested by KGlad in message #6.

Maybe you are looking for

  • How  to change default window size?

    I'm using MX 6.0 on Mac... For some reason I can't figure out how to change the default window size in the work windows. Every time I open a new file to work on it opens to a smaller size than the actual page is. When opening pages dozens of times a

  • Adding inputhelp to a particular column in tableview

    Hi experts,   I need to display a particlular column by providing inputhelp in tableview.My requirement is to save the data entered in the tableview to the database. but in particlular coulmn v should select data from the inpuhelp.please help me out.

  • How_to_STOP_an_Update_in_progress?

    The question explains itself. I opened the "about Firefox" page and clicked on the "CHECK" for updates link and the program started downloading the new version without my permission. I only wantyed to CHECK the availability of a new version NOT AUTOM

  • Stuck on white screen

    Ever since I made a one-to-one replacement,my ipod touch 4g has been appearing a apple logo and it stays for a very long time.Now its even more worst,the apple logo jsut keep appearing and the white screen comes out.Please do help.

  • Help with universe with multiple related tables/loops

    Post Author: bradwist CA Forum: Semantic Layer and Data Connectivity Hi. I am relatively new to Business Objects and have been putting together some universes for our use. Most things I can accomplish well enough. However, I've run into an issue that