Index value of parameter problem on ComboBox

I'm running into a problem with the definition of the index on a drop-down list box. I'll try to give as much detail as possible. From what I can tell, it must work and do, but only for a single item. If anyone can suggest another group to publish on, let me know. I can't find a solution anywhere.

I have the following code to display a combobox control. The figures are from a configuration XML file. The combobox itself works very well and in fact shows all the data from the XML configuration file.

< mx:HBox >
< mx:Label text = 'Status' width = "55" / >
< mx:ComboBox id = "uxstatus" dataProvider = "{_xmlVulnStatus}" = 'status' labelField / >
< / mx:HBox >

The part of the XML config file that is used to populate the combobox control.

< mainconfig >
< vulnstatus >
< status > Open < / status >
< status > current < / status >
< status > Closed < / status >
< / vulnstatus >
< / mainconfig >

Now, when a user selects an item in a separate DataGrid, on change, I have run the following function. The function reads the data, analysis and compares the value of "status" of the info of datagrid with the options of 'status' in the configuration XML file. When it matches, it sets the combobox's index number so that it shows the right data. My problem is the function below.

public void parseMSVulnStatus(evt:Event):void {}
var xmlMSV:XML = XML (msdetailed.selectedItem); the host of dataProvider item
trace ("status Vuln MS =" + xmlMSV.status);
for (var MSVi:Number = 0; MSVi < _xmlVulnStatus.length (); MSVi++) {//loop over the in the dataProvider}
var sDataValueCurMSV:String is _xmlVulnStatus [MSVi] .valueOf ();. get the current value of the item.data
If (sDataValueCurMSV == xmlMSV.status) {//compare desired value current value of the item.data
mx.controls.Alert.show ("match found - status Vuln MS =" + xmlMSV.status + "and MSVi ="+ MSVi ");
msstatus.selectedIndex = MSVi; the value of the seletedIndex from the drop-down list box
}
else {msstatus.selectedIndex = - 1}
}
If (msdetailed.selectedItem.falsepos == 'Y') {msfalsepos.selected = true ;}
}

The problem. If the value of the data grid is 'Closed', it shows the index as being '2' and sets the index of the combobox in a proper way and shows 'closed '. The alert box is displayed (for testing) to display the values.

If the value of the data grid is "Open" or "Ongoing", it shows the appropriate index as being equal to 0 or 1, respectively and shows the alert box. However, it seems that the drop-down list, the value - 1. I checked that data are set correctly in the database (which is what fills the datagrid control).

Any ideas on that? According to my alert box, it seems that the data are properly seen and he knows how to set the index of the combobox... it simply not happen (unless it is 'closed').

Thanks in advance.

Chris

It seems you need to add a break to your loop when he finds a positive match. This would explain why it works for the last item in your xml file, but fails for others.

msstatus.selectedIndex = MSVi; the value of the seletedIndex from the drop-down list box
break;

Vygo

Tags: Flex

Similar Questions

  • Index value of combobox layout

    I have a combobox that I'm filling some XML.

    The XML code is as follows

    <?xml version="1.0" encoding="UTF-8"?>
    <eventTypes>
      <eventType>
        <eventTypeID>1</eventTypeID>
        <eventTypeDescription>Event</eventTypeDescription>
      </eventType>
      <eventType>
        <eventTypeID>2</eventTypeID>
        <eventTypeDescription>Seminar</eventTypeDescription>
      </eventType>
      <eventType>
        <eventTypeID>3</eventTypeID>
        <eventTypeDescription>Social Occasion</eventTypeDescription>
      </eventType>
    </eventTypes>

    I am populating the comobobox using an array collection based on this XML.

    What I want to be able to do is set the index for each item in the combobox equal to the eventTypeID node in the XML.

    Is it possible to do this? If so how.

    Currently my MXML for the combobox is like this

    <mx:ComboBox id="calendarEventTypeID" dataProvider="{eventsTypeDataProvider}"
         editable="false" labelField="eventTypeDescription"/>

    Thanks for any help.

    comboBox.selectedItem eventTypeID , you can send to the server to record in db.

    Are you able to see the drop-down list box? I think he must have data & label property on objects you are adding to the comboBox dataProvider. In the data , you can set value eventTypeID & label will be visible to the user.

  • Implicit coercion of a value of type fl.controls:ComboBox to a type unrelated to XMLList

    Hi, new to Flash and working at school and don't understand the error in yellow below.  Here are excerpts from two function code involved.  Thank you, Joe

    Error:

    Implicit coercion of a value of type fl.controls:ComboBox to a type unrelated to XMLList.

    Code:

    private var _feed_list:ComboBox;

    private void done_loading(e:Event) {}

    var feed_xml:XML = new XML (e.target.data);

    var feed_items:XMLList = feed_xml.*;

    Populate (_feed_list);

    var match: Boolean = false;

    for (var i = 0; i < _feeds_dp.length; i ++) {}

    If (_feeds_dp.getItemAt (i) .link == feed_xml.@link) {}

    match = true;

    }

    }

    private void fill {(xml:XMLList)}

    var int count = 1;

    for each {var point: XML (in xml.item)}

    var t:String = item.title == "? Item.Link:Item.title;

    _feeds_entries_dp. AddItem({)

    label: t +', ' + item.date,.

    Link:item. Link,

    Preview:item. Preview,

    Description: Item. Description,

    Date: Item.date,

    Time:item. Time,

    Author:item. Creator,

    Media:item. Media

    });

    _feed_entry_list.labelField = "label";

    _feed_entry_list. DataProvider = _feeds_entries_dp;

    }

    }

    The error message indicates the problem clearly enough.  _feed_list is defined as a ComboBox in your first line of code.  You who pass as an argument in your line to populate (_feed_list) of code.  However, the populate function expects a XMLList object to pass, not a ComboBox control.

    You're probably really saying to use...

    Populate (feed_items);

    Since it is the only one not found XMLList

  • Get the current index value of the table control

    I have a table control 1 d on a panel that contains a value of temperature curve that I send to a temperature controller. The values in the table are not unique, because for example 40.5 degrees in the table could represent 40.5 degrees on the cycles of cooling or heating. I could have severat heating/cooling cycles programmed into the table. I would like a way to read the array index of the currently displayed item in the array in the up/down control of index on the left of the table control. I could then run curves partial temperature easily by neutrophilia a starting point on the curve in the table control.

    I don't see a property that I can use to get this index value. Anyone have any ideas?

    Thank you

    J

    Use the property 'index values. It will be the first item of the output of a 1-d array.

  • How to find the bpel instance in 11 g based on the index values

    We have 10 GB BPEL processes where we define the 4 index values for all instances. Whenever the support request comes, ask us the values of index and based on what we're looking for the process instance.

    We have now migrated bpel 10g and 11g process. How to find the bpel instance in 11 g based on the index values?

    You can go there. http://soasphere.blogspot.com/2011/04/how-to-Serch-composites-for-index.html. Do a join on the cube_instance and ci_indexes tables.

  • While (list ($index; $value) = each ($array)) {echo "Wtf?" ;}

    Hello comrades!

    I'm new to PHP and now I'm stuck at list(); and each(); functions.

    Can someone explain to me the meaning of:

    list ($index; $value) = each ($array) ?

    I understand that the meaning of the variables in the present code:

    $array [index] = 'value ';

    But what is the meaning of the equation in the parenthesis of the cycle while ?

    Thank you people!

    DissidentPJ

    ya that's how to use it. I had to search what each() done haha coz I do not use it

  • Assiging the values of parameter in CASE

    Hi all
    I'm writing the Expression BOX in the following way.

    CASE WHEN entered. Field1 < = Input.Field2 then
    Input.Field1 = Input.Filed2
    ON THE OTHER
    Input.Field2
    END

    During the validation of Expression it throws the error. Could you tell me please me is possible to write the expression to assign values of parameter input/output field.
    If so, please explain. If this isn't the case, suggest me work around.
    Thank you very much
    See you soon!
    -MAK

    He likes to change...

    CASE WHEN input.Field1 <= Input.Field2 then
    Input.Field1
    ELSE
    Input.Field2
    END
    

    If you created this in the output of expression variable say 'out_1' and then
    so if the entry. Field1<= input.field2="" then="" value="" of="" out_1="" will="" be="" input.field1="" else="">

    See you soon
    Katia

  • Start little problem-ORA-07446: sdnfy: incorrect value "for parameter

    what I am doing wrong?

    SQL > startup nomount pfile=/oracle/product/9.2.0.6/dbs/initncersp.ora;
    ORA-00444: background process 'PMON' failed during startup
    ORA-07446: sdnfy: incorrect value "for the parameter.

    -rw - r - r - 1 oracle dba 466 Jan 21 11:11 initncersp.ora
    Oracle: tulppwradb02:ncersp > pwd
    /Oracle/product/9.2.0.6/DBS

    *************
    Oracle: tulppwradb02:ncersp > vi initncersp.ora
    "initncersp.ora" 127 lines, 3788 characters
    ##############################################################################
    # Copyright (c) 1991, 2001, 2002 by Oracle Corporation
    ##############################################################################

    ###########################################
    # Archive
    ###########################################
    Log_archive_dest = ' / archive_nmarket/ncersp.
    log_archive_format='arch.ncersp.%s_%t.log'
    log_archive_start = true

    ###########################################
    IO and cache memory #.
    ###########################################
    DB_BLOCK_SIZE = 8192
    db_cache_size = 25165824
    db_file_multiblock_read_count = 16
    DB_FILES = 400

    ###########################################
    # The library Cache and sliders
    ###########################################
    open_cursors = 500

    ###########################################
    # Identification of the database
    ###########################################
    db_domain =""
    db_name = ncersp
    # Global Naming - apply as a dblink has same name as the db, that it connects
    global_names = TRUE

    ###########################################
    # Diagnostic and statistical
    ###########################################
    background_dump_dest = / oracle/admin/ncersp/bdump
    core_dump_dest = / oracle/admin/ncersp/cdump
    user_dump_dest = / oracle/admin/ncersp/udump
    TIMED_STATISTICS = TRUE

    ###########################################
    # Configuration file
    ###########################################
    control_files = ("/ db01/oradata/ncersp/ncerspcontrol01.ctl","/db01/oradata/ncersp/ncerspcontrol02.ctl", "/ db01/oradata/ncer")
    SP/ncerspcontrol03. CTL")

    ###########################################
    # Identification of the instance
    ###########################################
    instance_name = ncersp

    ###########################################
    # Work queue
    ###########################################
    JOB_QUEUE_PROCESSES = 0 #zero for maintenance


    ###########################################
    # Optimizer
    ###########################################
    hash_join_enabled = TRUE
    #query_rewrite_enabled = TRUE
    #query_rewrite_integrity = "trusted."
    #star_transformation_enabled = FALSE

    ###########################################
    # Pools
    ###########################################
    JAVA_POOL_SIZE = 51200
    LARGE_POOL_SIZE = 8388608
    shared_pool_size = 55343360

    ###########################################
    # Process and Sessions
    ###########################################
    process = 100

    ###########################################
    Recovery and # redo Log
    ###########################################
    fast_start_mttr_target = 300

    ###########################################
    # Security and audit
    ###########################################
    Remote_login_passwordfile = 'EXCLUSIVE '.
    AUDIT_TRAIL = DB

    ###########################################
    # Sort, hash joins, index Bitmap
    ###########################################
    pga_aggregate_target = 25165824
    sort_area_size = 1024000

    #######################################################
    # Need Varification for under parameters of primary s/n
    #######################################################
    ###########################################
    # Various
    ###########################################
    aq_tm_processes = 1
    compatible = 9.2.0.0.0
    log_buffer = 32768
    log_checkpoint_interval = 10000
    log_checkpoints_to_alert = TRUE
    max_dump_file_size = '10240'
    OS_ROLES = FALSE
    remote_os_roles = FALSE
    os_authent_prefix = "

    ###########################################
    # System managed Undo and Rollback Segments
    ###########################################
    UNDO_MANAGEMENT = AUTO
    UNDO_RETENTION = 10800
    undo_tablespace = UNDOTBS1
    #utl_file_dir ='* '



    ###########################################
    # OLD SETTINGS DB
    ###########################################
    #db_block_buffers = 550
    #resource_limit = true
    #parallel_max_servers = 5 # SMALL
    #global_names = TRUE
    #job_queue_interval = 60

    There may be additional or better clues in file alert_SID.log

  • function (value = &gt; parameter) problem...

    I created the example function:
    < em > < color = "#808080" > create or replace function ttt (number of p) return number
    is
    Start
    return p + 1;
    end;
    < / police > < /em >
    < p >
    < color = "#000000" > and I wonder why
    < / make >
    < em > < color = "#999999" > start
    dbms_output.put_line (ttt (p = & gt; 2));
    end; < / make >
    < /em >
    works, but

    < color = "#999999" > < em > select ttt (p = & gt; 2) twice; < /em >
    < / make >
    doesn't work.

    Can someone explain to me?

    Pawel
    < /p >

    Hello

    See this link [http://decipherinfosys.wordpress.com/2008/03/04/using-named-notations-in-functions-in-oracle-11g/] I think it could be useful.

    Kind regards

  • Data parameter problem

    Hello

    I am facing a problem with the parameter Data;

    I can't able to query the data for different dates in the range, but I am able to query the data for the same date in the range.

    Select the statement-

    Select RCT.GL_DATE in the RCT RA_CUST_TRX_LINE_GL_DIST_ALL

    where TO_CHAR (TRUNC (RCT.GL_DATE), 'DD-MON-YY')

    between TO_CHAR (TRUNC (TO_DATE(:P_GL_DATE_LOW)), 'DD-MON-YY')

    AND TO_CHAR (TRUNC (TO_DATE(:P_GL_DATE_HIGH)), 'DD-MON-YY');

    I am able to get the data for the date range - 05-JAN-2015/05-JAN-2015, 07-JAN-2015/07-JAN-2015 and so on...

    I'm not able to get the data for the date range - 05-JAN-2015/07-JAN-2015, 07-JAN-2015/09-JAN-2015 and so on...

    Can someone help me on this issue.

    Thanks in advance!

    Dilip Manon

    As John pointed out, use the date data type to compare dates:

    Select RCT.GL_DATE in the RCT RA_CUST_TRX_LINE_GL_DIST_ALL

    where RCT.GL_DATE

    (between TO_DATE(:P_GL_DATE_LOW)), 'DD-MON-YYYY')

    (AND TO_DATE(:P_GL_DATE_HIGH)), 'DD-MON-YYYY');

    Using TO_CHAR to compare dates, not only do you risk to make mistake and forget certain values, but also in this case stop you an index on GL_DATE may be used.

  • SelectOneChoice show the correct value with switching problem

    Hello

    I use JDeveloper 11.1.1.5.0 and I have a non-trivial application of SelectOneChoice.

    Here's my usecase:

    I have to show LOV to set the State according to the connected person.

    So, I implemented attribute LOVs view that each filtered for in the light of the type of person (owner or non-owner).

    I created switcher LOV for attribute as java method in module impl invoked by EL expression adf.source.getApplicationModule () .getTaskStateLOVSwitcher (adf.object, CreatedByIdFk);

    to get connected user binded query parameter id.

    public static String getTaskStateLOVSwitcher (ViewRowImpl, String createdById, time stamp dateInsert vri) {}
    ViewObject vo = vri.getApplicationModule () .findViewObject ("TaskViewParTaskTypeIdEx1");
    String userId = getBindValue (vo, "BindProcessedByUserId") m:System.NET.SocketAddress.ToString ();
    Output string;
    If (createdById.trim () .equals (userId)) {}
    output = "LOV_TaskStateIdFkOwner";
    } else
    output = "LOV_TaskStateIdFkNotOwner";
    return output;
    }

    I've used this many fragments of jsff perspective.

    There are fragments where it works fine (but I still don't understand why the switch method is called 3 times)

    And there are fragments where it fails. When there are two lines with different LOV to show SelectOneChoice shows an incorrect value.

    I can see the newspaper that LOV switcher method is called 6 or more times and first 3 times it works with values previously selected line and next time, it runs with the current line.

    He result is SelectOneChoice sets the value of the line previously selected in the first round and goes the LOV index.

    I found in the < getViewPort > ADFc log < ControllerState > message: no port view found ID...

    Is the source of the problem and what is the solution?

    Thank you.

    After eliminating all the differences between 'good' and 'bad' fragments I found a problem in the fragments of masters who defined a real line of iterator.

    Define RangeSize = 10 (not 25) table completely setting to change this behavior in common sense.

  • URL parameter problem

    Hello

    I'm new to the development of blackberry applications. I try to access a Web service, I can access using the http connection. When passing a parameter in the URL includes only one word then it works fine and answers correctly, but when I pass the same variable with a different value that contains several words separated by space, then it generates an error. I tried to pass the same URL in the browser, but the browser gives me good performance.

    I believe strongly that there is a problem when the parameter is sent. Please help me

    Thanks in advance

    If you only want to add parameters using percent encoding:

    http://en.Wikipedia.org/wiki/percent-encoding

  • Cannot access the value of parameter task flow when type java.lang.string

    Hi all

    I use Jdev 11.1.1.6.0 version.

    Here's the scenario. I enclose the workspace.

    A taskflow (testScope1TF) simply have 2 obligatory parameters corresponding type is String and ArrayList.

    This stubborn taskflow placed as a region in a pop up (p1) in a fragment (testScope2Fragment.jsff).

    Have a command to link to testScope2Fragment.jsff and from there, I'll put the value of the parameter.

    Pop until I can access the value of the ArrayList, but for string, it is show null. However all these setting set the same bean. What is the reason for the string parameter showing null?

    Can anyone help to understand this strange behavior.

    Here is the link to sample workspace

    https://drive.Google.com/file/d/0b-8Suq_hutEhNE01blZFUnlQdzQ/view?USP=sharing

    To run the example - ScopeTestPage.jspx run-> click on commandLink 1 -> press the commandButton control pop up 1.

    In output integrated wls console like below.

    ------------------------------------------------------------------------

    Table list size: 2

    String value parameter: null

    Here's the code-testScope2Fragment.jsff.

    <? XML version = "1.0" encoding = "UTF - 8"? >

    " < = xmlns:jsp jsp:root ' http://Java.Sun.com/JSP/page "version ="2.1" "

    ' xmlns:af = ' http://xmlns.Oracle.com/ADF/faces/rich "" "

              xmlns:f=" http://Java.Sun.com/JSF/core ">

    < af:panelStretchLayout id = "PSL1" >

    < f: facet name = "center" >

    < af:panelGroupLayout layout = "scroll".

                               xmlns:af=" http://xmlns.Oracle.com/ADF/faces/rich "" "

    ID = "pgl1" >

    < af:commandLink text = ' commandLink 1 ' id = 'cl1' partialSubmit = 'true '.

    actionListener="#{viewScope.TestScope2Bean.tesctScope2Method}"/ >

    < af:popup id = binding = "#{"p1"viewScope.TestScope2Bean.viewScopePopUp}" >

    < af:dialog id = "d1".

    title = "Pop of the scope on the view upwards the Value: #{viewScope.TestScope2Bean.testScopeView String}" >

    < af:region value = "#{bindings.testScope1TF1.regionModel}" id = "r1" / > "

    < / af:dialog >

    < / af:popup >

    < / af:panelGroupLayout >

    <!-id = "af_one_column_stretched"->

    < / f: facet >

    < / af:panelStretchLayout >

    < / jsp:root >

    public class TestScope2Bean {}

    String testScopeView = null;

    ArrayList < String > testScopeViewList = new ArrayList < String > ();

    Private RichPopup viewScopePopUp;

    public TestScope2Bean() {}

    Super();

    }

    public void tesctScope2Method (ActionEvent actionEvent) {}

    Add the code in the event here...

    this.setTestScopeView (In ViewScope Test");

    testScopeViewList.add ("sjdjshdsj");

    testScopeViewList.add ("cdsfdsfsf");

    RichPopup.PopupHints applyHoldspopUpHints = new RichPopup.PopupHints ();

    this.getViewScopePopUp () .show (applyHoldspopUpHints);

    }

    {} public void setTestScopeView (String testScopeView)

    this.testScopeView = testScopeView;

    }

    public String getTestScopeView() {}

    Return testScopeView;

    }

    {} public void setViewScopePopUp (RichPopup viewScopePopUp)

    this.viewScopePopUp = viewScopePopUp;

    }

    public RichPopup getViewScopePopUp() {}

    Return viewScopePopUp;

    }

    {} public void setTestScopeViewList (ArrayList < String > testScopeViewList)

    this.testScopeViewList = testScopeViewList;

    }

    public ArrayList < String > getTestScopeViewList() {}

    Return testScopeViewList;

    }

    }

    Thanks in advance.

    I took as look at your code. The problem is that you use a popup in the region and regions have a bit different (refer to http://www.oracle.com/technetwork/developer-tools/adf/learnmore/67-queryform-in-popup-253861.pdf) in the regions. Must be addressed the refreshment of the ifNeeded region to make your sample (see image below):

    Timo

  • Adding values of parameter to a DataByQuerySpecRequest

    Hello

    I'm sending a DataByQuerySpecRequest to my provider for the property.  I need to send additional information

    with the request, so I tried to add some parameters to the propertySpec.parameters.  The request that the

    parameters when it was sent, but when my data provider has been called, the propertySpec.parameters was 'null '.

    I thought that this doesn't have to be good, so I took the example of chassisui and adds the Util.as parameter values:

    public static void createSimpleConstraintQuerySpec)

    ObjectType, properties: Array): {QuerySpec}

    var resourceSpec:ResourceSpec = new ResourceSpec();

    resourceSpec.constraint = new Constraint():

    resourceSpec.constraint.targetType = objectType

    var propSpec:PropertySpec = new PropertySpec();

    propSpec.propertyNames = properties;

    propSpec.parameters = new Array ("abc"); <-my addition

    resourceSpec.propertySpecs = [propSpec];

    ...

    Here, the result is the same. In my DataProvider of chassis-Service, I see the propertySpec that was sent, but the settings are

    always null.

    Are there restrictions to do this?  When I make requests of property I have no problem added settings for them.

    Thanks for the info

    Cathy

    The doc PropertySpec API is not very clear about this.  The parameters field must be an array of objects ParameterSpec .

    For example:

    var paramSpec:ParameterSpec = new ParameterSpec();

    paramSpec.propertyName = "key";

    paramSpec.parameter = filter;

    var propertySpec:PropertySpec = new PropertySpec();

    propertySpec.propertyNames = portProperties;

    propertySpec.parameters = [paramSpec];

    propertySpec.type = DVPORT_ENTITY_TYPE;

  • How to remove the %20 of the value of parameter of a vertical sprymenubar link?

    I have a menu bar vertical, but I want to put a link from the menu to a new page where I sent an acros of parameter value.

    Displays the URL:

    http://localhost/Category.php?Category=Digital%20Piano
    

    I want that it displays the following text:

    http://localhost/Category.php?Category=Digital-Piano
    

    That's what the menu looks like

    <ul id="MenuBar2" class="MenuBarVertical">
            <li><a class="MenuBarItemSubmenu" href="Category.php?Category=Digital Piano">Digital Pianos</a>
              <ul>
                <li><a href="#">All digital pianos</a></li>
    
    

    I tried to use str_replace, but that has not worked

    Also I want to make echo the url without the "-" on the home page

    Like this..? PHP echo $_GET ['category'];? > where it displays digital piano rather than Digital-Piano

    I guess I have to encode the category = Digital Piano, but I have no idea where to start

    Hi, Ben thank you for your reply I've actually solved the problem

    Let me show you:

    Demand

     
  • ">Digital Pianos
  • The results page:

    $varCategory_getResults = "-1";
    if (isset($_GET['Category'])) {
      $varCategory_getResults = str_replace('-', ' ',$_GET['Category']);
    

    This replaces the - with a space and will search the DB

    Thanks again for your help and go through it's hard to read and try to help me with my question

    RIA

Maybe you are looking for