ComboBox and TextInput

I have to add a change event listener... 
I did add one something like this.... 
Private function Change(event:Event):void{
      inputtxt.txt+=event.currentTarget.selectedIndex;
      vs.selectedChild=vsRef;
<mx:TextInput id="inputtxt"/>
<mx:Button id="searchBtn" label="Search" change="Change(event)"/>
***This does nothing for me though***
OR
[Bindable] public var Emp:String;
[Bindable] public var ary:Array = ["Emp name", "Emp number", "Emp id"];
This is my combobox array now I have a text box next it, so that the user can enter name, number or id...
What should be in my change function?, I have:
private function change():void{
          if  (cb.selectedIndex==0)
               Emp=cb.selectedItem
          else if (cbEmp.selectedIndex==1)
               Emp=????
          else
               Emp=????
<mx:ComboBox id="cb" dataProvider="{ary}"/>
and how do I store what user has enter....
which one is the right approach and how will they work... I'm just a little confused....
Thanks...

can you show me how to incorporate valueCommit with TextInput, combobox and search and I do have to search based on what the used enter...
So if I have
<mx:Script>
<![CDATA[
[Bindable] public var Emp:String;
[Bindable] public var ary:Array = ["Emp name", "Emp number", "Emp id"];
]]>
</mx:Script>
<mx:ComboBox id="cb" dataProvider="{ary}"/>
<mx:TextInput id="inputtxt"/>
<mx:Button id="searchBtn" label="Search"/>
<mx:ViewStack id="vs">
<src:Ref id="vsRef"/>
</mx:ViewStack>
Now what I want to do is when the user enter either Employee Name or Number or ID in the textInput box next to the combobox filter based on what is selected in combobox (name, number or id) I have to bring up the viewstack which shows the datagrid with data based on what the user has input...
Can anyone help me with how do I incoprporate valueCommit or cb.selectedItem....
I'll really appreciate that.
Thanks...

Similar Messages

  • [svn:fx-trunk] 11737: ComboBox and DropDownList bug fixes

    Revision: 11737
    Author:   [email protected]
    Date:     2009-11-12 13:25:33 -0800 (Thu, 12 Nov 2009)
    Log Message:
    ComboBox and DropDownList bug fixes
    SDK-23635 - Implement type-ahead in DropDownList
    Added code in DropDownListBase keyDownHandler to listen for letters and change the selection if there is a match. At some point, we should modify findKey and findString (I'll file an ECR for that). For now, I've just overridden findKey and cobbled together the logic from List.findKey and List.findString. In ComboBox, we override findKey to do nothing since ComboBox has its own logic that relies on textInput changes.
    SDK-23859 - DropDownList does not reset caretIndex when selection is cleared
    Fixed this in two places. In ComboBox.keyDownHandlerHelper, we update the caret index when ESC is pressed. In DropDownListBase.dropDownController_closeHandler, we update the caret index if the commit has been canceled (ie. ESC was pressed).
    SDK-24175 - ComboBox does not select an item with ENTER when openOnInput = false
    When the ComboBox was closed and the arrow keys were pressed, the selectedIndex was changed. When ENTER was pressed, it was committing actualProposedSelectedIndex, not selectedIndex. The fix is to override the selectedIndex setter to keep actualProposedSelectedIndex in sync if selectedIndex was changed. Usually it is kept in sync when the dropDown is opened.
    SDK-24174 - ComboBox does not scroll correctly when openOnInput = false
    When typing in a match, the caretIndex was changed, but not the selectedIndex (because matching when it is closed doesn't commit the value until you press ENTER or lose focus). When closed, the navigation keys were changing the selectedIndex relative to the previous selectedIndex. I updated this to change relative to caretIndex instead. In most cases, caretIndex and selectedIndex are equivalent while the dropDown is closed.
    Other changes:
    - Replaced some calls to dropDownController.isOpen with isDropDownOpen.
    - Added protection RTE protection to ComboBox.changeHighlightedSelection
    QE notes: None
    Doc notes: None
    Bugs: SDK-23635, SDK-23859, SDK-24175, SDK-24174
    Reviewer: Deepa
    Tests run: ComboBox, DropDownList
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-23635
        http://bugs.adobe.com/jira/browse/SDK-23859
        http://bugs.adobe.com/jira/browse/SDK-24175
        http://bugs.adobe.com/jira/browse/SDK-24174
        http://bugs.adobe.com/jira/browse/SDK-23635
        http://bugs.adobe.com/jira/browse/SDK-23859
        http://bugs.adobe.com/jira/browse/SDK-24175
        http://bugs.adobe.com/jira/browse/SDK-24174
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ComboBox.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DropDownListBase.as

    This bug figures out also when creating a custom spark ComboBox, then trying to programatically update the userProposedSelectedIndex property. The proposed selected index is selected, but does not apply the same skin as when mouse is on rollover or item is selected due to up and down keys.
    The issue seems like updating the status of the item renderer to rollover or selected to get the same skin applied.
    Please could you attach DropDow nList.as that you edited ?
    Thank you so much.

  • Castom ComboBox and lose binding

    Hello. I'm trying to write my own ComboBox and I ran into a problem.
    public class TestComboBox : ComboBox
    public static readonly DependencyProperty SelectedCarProperty = DependencyProperty.Register("SelectedCar", typeof(string), typeof(TestComboBox), new FrameworkPropertyMetadata(null, OnSelectedCarPropertyChanged));
    public TestComboBox()
    this.Cars = new ObservableCollection<string>() { "Select Car", "BMW", "Mersedes", "Audi" };
    this.ItemsSource = this.Cars;
    this.SelectedItem = this.Cars[0];
    public string SelectedCar
    get { return (string)GetValue(SelectedCarProperty); }
    set { this.SetValue(SelectedCarProperty, value); }
    public IList<string> Cars { get; private set; }
    protected override void OnSelectionChanged(SelectionChangedEventArgs e)
    base.OnSelectionChanged(e);
    this.SelectedCar = (string)SelectedItem;
    private static void OnSelectedCarPropertyChanged(DependencyObject source, DependencyPropertyChangedEventArgs e)
    var car = (string)e.NewValue;
    var editor = (TestComboBox)source;
    editor.SelectedItem = car;
    When I try to install the default value, I lose the binding. If I commented this code, everything works fine.
    this.SelectedItem = this.Cars[0];
    How can I set the default value without losing binding to the VM
    P.S
    TestApp

    I use this code.
    <propgrid:PropertyGrid Margin="0,0,11,7">
    <propgrid:PropertyGrid.Items>
    <propgrid:PropertyGridCategoryItem DisplayName="Main">
    <propgrid:PropertyGridPropertyItem Value="{Binding Car, Mode=TwoWay}"
    DisplayName="Car">
    <propgrid:PropertyGridPropertyItem.ValueTemplate>
    <DataTemplate>
    <wpfApplication1:TestComboBox SelectedCar="{Binding Value, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type propgrid:IPropertyDataAccessor}}}" />
    </DataTemplate>
    </propgrid:PropertyGridPropertyItem.ValueTemplate>
    </propgrid:PropertyGridPropertyItem>
    </propgrid:PropertyGridCategoryItem>
    </propgrid:PropertyGrid.Items>
    </propgrid:PropertyGrid>
    I found a solution my problem Ijust replacedthe code
    this.SelectedItem = this.Cars[0];
    with this
    this.Loaded += (sender, args) =>
    if (this.SelectedItem == null)
    this.SelectedItem = this.Cars[0];
    And now everything works fine

  • How do i split a line in a csv file and populate a combobox and a textbox with the parts

    What I'm trying to do is split the line and fill a combobox and with the selecteditem and the textbox with the value of the combobox selecteditem which is the second part of the line split.
    Thanks in advance for the help or suggestions.

    Then you should create a class to represent the items in the ComboBox:
    Public Class MyItem
    Public Property PartA As String
    Public Property PartB As String
    End Class
    ...and add instances of this class to the ComboBox:
    Try
    Dim mydocpath1 As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
    Dim mylines() As String = File.ReadAllLines(mydocpath1 + "\TextFile1.txt")
    For Each line In mylines
    Dim parts() As String = line.Split(","c)
    Dim item As MyItem = New MyItem With {.PartA = parts(0), .PartB = parts(1)}
    cmb1.Items.Add(item)
    Next line
    cmb1.SelectedItem = cmb1.Items(1) 'select second item
    Catch ex As Exception
    MsgBox(ex.Message)
    End Try
    Then you set the DisplayMemberPath of the ComboBox to the name of one property and bind the Text property of the TextBlock to the other one:
    <ComboBox Name="cmb1" DisplayMemberPath="PartA" />
    <TextBlock Text="{Binding ElementName=cmb1, Path=SelectedItem.PartB}" />
    That should solve your issue.
    Once again, please remember to mark helpful posts as answer to close your threads and remember that a new thread deserves a new question.

  • Combobox and checkbox in jexcelapi

    Hay Gays,
    with Writing Spreadsheets i want to cells which contain combobox and other cells which contain checkbox ,i need help with that i tried alot of things ?

    You simply write your own TableCellRenderer that returns a different Component instance for each row.
    It could do this by having three TableCellRenderers installed in it and it simply delegates the call to getTableCellRendererComponent to the appropriate renderer:
    public class CompositeTablecellRenderer implements TableCellRenderer
      private TableCellRenderer[] cellRenderers;
      public CompositeTablecellRenderer()
        // create your nested renderers here
      public Component getTableCellRendererComponent(...)
        TableCellRenderer renderer = cellRenderers[row % cellRenderers.length]; // For example!
        return renderer.getTableCellRendererComponent(...);
    }It's up to your application to determine which renderer to use for which row. Cell editors create another level of complexity but it's still achievable (I wrote one that mapped Class to TableCellRenderer so it could determine the renderer based on the value's class at runtime - it sort of works but subclasses prove tricky).
    Hope this helps.

  • Combobox and button renderer

    Hi all,
    I read the documentation about JTables but couldn't figure out how to solve my problem. I want to render combobox and button in the same JTable cell like in Netbeans. How can I do this? Any suggestions?

    Anyone with ideas?

  • ComboBox and DataTable

    Hey All,
    I have found a lot of posts on here about adding values to a combo box using the valid values collection. I am trying to assign a datatable to the Combobox in my case. I add my datatable in the xml and assign a query to it. Then I assign that to the databind property of the combobox and when the form loads it only displays the 1st record in the query.
    Any ideas what I am doing wrong?
    I basically just want to display the list of item groups in my combo box without manually adding these to the valid values collection.
    Curtis

    Hi Curtis.
    If it can help you this is some methods used in my programs:
    1) ValidValues in xml file
    <item uid="cType" type="113" left="100" tab_order="0"
             width="150" top="10" height="14" visible="1" enabled="1" from_pane="0" to_pane="0" disp_desc="1"
             right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0"
             AffectsFormMode="1">
      <AutoManagedAttribute />
      <specific AffectsFormMode="1" TabOrder="0">
       <ValidValues>
        <action type="add">
         <ValidValue value="A" description="AAA" />
         <ValidValue value="E" description="EEE" />
         <ValidValue value="B" description="BB" />
         <ValidValue value="D" description="DD" />
        </action>
       </ValidValues>
      <databind databound="1" table="@TABLE_A" alias="U_TYPE" />
    </specific>
    </item>
    2) Add ValidValues to combobox.
    Private Sub CreateForm()
        Dim oForm As SAPbouiCOM.Form
        Dim oComboBox As SAPbouiCOM.ComboBox
        Set oForm = SBO_Application.Forms.Add("MYFORM")
        oForm.DataSources.UserDataSources.Add "DS", dt_SHORT_TEXT, 20
        Set oComboBox = oForm.Items.Add("cCombo1", it_COMBO_BOX).Specific
        oComboBox.DataBind.SetBound True, "", "DS"
        oComboBox.ValidValues.Add "A", "Value A"
        oComboBox.ValidValues.Add "B", "Value B"
        oComboBox.ValidValues.Add "C", "Value C"
    End Sub
    3) Add Linked Table for field.
    See this thread [User defined Valid values in SBO|User defined Valid values in SBO;
    4) Recordset
    See this thread [Fill values in combobox from database table|Fill values in combobox from database table;
    5) LoadSeries Method (look SDK Help)
    Other ways  I don't know.
    Best regards
    Sierdna S.

  • [svn:fx-trunk] 7952: PARB changes for RichEditableText, TextArea and TextInput

    Revision: 7952
    Author:   [email protected]
    Date:     2009-06-18 02:57:23 -0700 (Thu, 18 Jun 2009)
    Log Message:
    PARB changes for RichEditableText, TextArea and TextInput
    RichEditableText, TextArea

  • ComboBox and JList working to gether?

    Hey
    Is it possible to get ComboBox and JList to work together?
    Eksampel.
    In the ComboBox there are 3 options to pick. Football, Hockey and Baseball. When one of these are picked all the names of the players
    from for example football is shown in a JList.
    Is this possbile? If yes how? can you give example or link to toturial?

    do you know a tutorial on this?Did you read the API for either JComboBox or JList????????
    Both contain links to the Swing tutorial.
    And why is it so difficult to post a Swing related question in the Swing forum???????

  • [svn:fx-trunk] 10889: Add FTETextTests which check that a Label and NumericStepper configured to use FTEText have a textField and textInput , respectively, of type UIFTETextField and MXFTETextInput.

    Revision: 10889
    Author:   [email protected]
    Date:     2009-10-06 09:29:53 -0700 (Tue, 06 Oct 2009)
    Log Message:
    Add FTETextTests which check that a Label and NumericStepper configured to use FTEText have a textField and textInput, respectively, of type UIFTETextField and MXFTETextInput.  The components are configured via style properties rather than by theme which would require another version/compile of the BasicTests.swf.
    QE notes:
    Doc notes:
    Bugs:
    Reviewer: Alex
    Tests run: basictests
    Is noteworthy for integration: no
    Modified Paths:
        flex/sdk/trunk/frameworks/tests/basicTests/BasicTests-config.xml
        flex/sdk/trunk/frameworks/tests/basicTests/BasicTests.mxml
    Added Paths:
        flex/sdk/trunk/frameworks/tests/basicTests/halo/scripts/FTETextTestScript.mxml
        flex/sdk/trunk/frameworks/tests/basicTests/halo/views/FTETextTests.mxml

    I'm also having this problem. I'm using Flash Builder 4.6, AIR 3.4 and I've made a DLL (e.g. ExtensionDll.dll) which needs to call functions in another DLL (e.g. DllUsedByExtensionDll.dll) . I've made sure my ANE is working with the ExtensionDll.dll already, so there are no issues with my actionscript code or my ANE packaging or my DLL compilation. However, once I start calling functions from the other DLL, it starts throwing me Error #3500. Even if I call this function (e.g. abc()) in ExtensionDll.dll, but I never actually use the function from actionscript, and I call another function (e.g. def()) from actionscript, the Error #3500 still appears, so it does not seem to depened on the whether the code is used or not.
    It's similar to this problem.
    http://stackoverflow.com/questions/9823504/how-to-use-external-dll-in-air-native-extension
    Does anyone have a solution or at least a way to debug this?

  • Comboboxes and textboxes geting mixed up

    My application seems to mix the combobox with the textinput controls. While I have connected the combobox to a dataprovider, the textinput control shows the dataprovider's value. This happens for all the applications that I try to run from my Flex Builder (even the ones which ran perfectly a few days ago). Can someone suggest what the problem is and also a fix?

    Thanks for taking a look.
    I thought so too and went on a search hunt to see where the code could go wrong. But then i tried the previous versions that were working great and I had put away until today, and they are now giving me the same problem.
    It seems odd that without changing any piece of code in the previous versions, they too have started misbehaving now. It leads me to think that maybe the code might not be the issue and something else might be the problem.
    I dont know what and more importantly i dont know how to go about solving this.
    Thanks for your help so far and I look forward to hearing more from you.
    Ps: Working to get the code such that it can be decipherable. Will post it as soon as I do that. Until then please let me know if something strikes you.

  • Performance problems with combobox and datasource

    We have a perfomance problem, when we are connecting a datatable object or something like this to a datasource property of a combobox. Below you find the source code. The SQL-Statement reads about 40000 rows and the result (all 40000) should be listed in the combobox. There is duration about 30 second before this process has finished. Any suggestions?
    Dim ds As New DataSet
    strSQL = "Select * from am.city"
    conn = New Oracle.DataAccess.Client.OracleConnection(Configuration.ConfigurationSettings.AppSettings("conORA"))
    comm = New Oracle.DataAccess.Client.OracleCommand(strSQL)
    da = New Oracle.DataAccess.Client.OracleDataAdapter(strSQL, conn)
    conn.Open()
    da.Fill(ds)
    conn.Close()
    Dim dt As New DataTable
    dt = ds.Tables(0)
    ComboBox1.DataSource = dt
    ComboBox1.ValueMember = dv.Table.Columns("id").ColumnName
    ComboBox1.DisplayMember = dv.Table.Columns("city").ColumnName

    But how long does it take to fill the DataTable?
    I can fill a 40000 row datatable in under 4 seconds.
    DataBinding a combo box to that many rows is pretty expensive, and not normally recommended.
    David
    Dim strConnection As String = "Data Source=oracle;User ID=scott;Password=tiger;"
    Dim conn As OracleConnection = New OracleConnection(strConnection)
    conn.Open()
    Dim cmd As New OracleCommand("select * from (select * from all_objects union all select * from all_objects) where rownum <= 40000", conn)
    Dim ds As New DataSet()
    Dim da As New OracleDataAdapter(cmd)
    Dim begin As Date = Now
    da.Fill(ds)
    Console.WriteLine(ds.Tables(0).Rows.Count & " rows loaded in " & Now.Subtract(begin).TotalSeconds & " seconds")
    outputs
    40000 rows loaded in 3.734375 seconds

  • How to solve the flash Builder 4.6 scroll view and textinput  display problem?

    I have a dynamic form application which worked well on flash builder 4.5, having display problems in flash builder 4.6 now. What I did is adding
    TextInput objects  to a scroll view and set the texts for them dynamically. Everything is fine after the screen loaded. But if I scroll down, sometimes the texts will be placed in wrong positions. I attached the screen copy of the wrong display. Does anybody know how to solve this problem? Thanks.

    Check out the two threads below (if you have not already). I have not tried it but aeonus describes an approach that made me think of something that might work ... It is a workaround but, what if you have a text field (txtA) with the skin that does not allow soft keyboard selection, but does scroll correctly, and on the onClick event of that text field, you dynamically cover it with another text field (txtB) that does allow soft keyboard selection, (but does not scroll properly) and trigger the keyboard. After you get the entry from the user, set the value of txtA and destroy txtB ... leaving you (theoretically) with properly scrolling text fields. If you have a lot of those in your app, you might want to write a component that implements that behavior.
    "Create a dynamic textfield, and on click, invoke create a StageText instance at the same location as the textfield (by setting the StageText.viewPort property)
    Finally, set StageText.softKeyboardType to "numeric" and call StageText.assignFocus();"
    http://forums.adobe.com/thread/915019?tstart=0
    http://forums.adobe.com/thread/911214?tstart=0

  • Af:query how to control the query combobox and change it's label text

    My colleague designed a well working af:query search page with several selectable predefined queries. Now it's up to me to control this combobox from outside the component with big colored buttons for user convenience. If the user clicks on one of the big buttons, the assigned item of the combobox is selected and then the query is submitted.
    I though about doing this with javascript, but the difficulty is, that I have no idea and didn't find a way to reference the id of the combobox? The combobox is a 'built in' component in he af:query component and there is no way to give it an id in the properties.
    The second problem is that I didn't find a way to change the label text of the combobox. It seems to be hard coded?
    Thanks in advance for your suggestion!

    Hi,
    the text should be coming from a message bundle and some other look and feel related elements should be settable through skinning in CSS
    http://www.oracle.com/technology/products/adf/adffaces/11/doc/skin-selectors.html
    search for af|query
    Regarding the JavaScript access, use firebug JS debugger. The af query class is AdfRichQuery.js
    http://www.oracle.com/technology/products/adf/adffaces/11/doc/multiproject/adf-richclient-api/js_docs_out/AdfRichQuery.html
    Note however that you should be able to do in Java what you are aimning for in JavaScript. However the usecase you want to implement is not fully clear to me - to be honest
    Frank

  • ComboBox and button symbol interaction

    (Sorry-- I had this posted in ActionScript as well -- not
    really an AS issue...)
    I thought it would be easier for folks if they didn't have to
    create this from scratch:
    Here is the
    Sample
    SWF
    and the
    Souce
    FLA
    Greetings --
    I traced back a bug that I was having to its most basic level
    and was surprised that it happens with only a ComboBox component
    and a button symbol... I traced it back so far that it got rid of
    all of my ActionScript and was left with only these two interface
    elements:
    Set-up: Create a new Flash document, ActionScript 2 / Flash
    8. Drag in a combobox component and add a label. Create a new
    button symbol and define up, over, down and hit states and drag
    this in as well...
    When you try test this movie, you get strange behavior...
    Give the button a few clicks to see that it is working properly.
    Then, click on the combobox to open it and then go back to the
    button. The button will work the first time tried, but will not
    work properly with subsequent attempts. It seems that the states of
    the button are getting confused after the combobox is used?
    (help!?)
    Could there be a work-around to this? Thank you in advance
    for you assistance with this issue...!

    I have Flash Player 9 (9,0,115,0) on my Mac, and am getting
    the same behavior on Windows XP...
    Perhaps try not moving the mouse between subsequent clicks
    will make it more apparent... I select something from the combobox.
    Then, the first click on the button works properly... but when you
    release the button (and don't move the mouse) it returns to the "up
    state" (not "over state"). Additional clicks don't respond with a
    "down state"... it just flashes the "over state" momentarily.
    It's causing me troubles because my interface asks users to
    first select from a combobox to navigate and then they can click to
    subsequent items with a button: next, next, next... to page through
    the selection. But this strange interaction is hanging up the next
    button on the second click (it never gets the down state).
    Thanks for checking it out... I sure would appreciate any
    thoughts on the matter...

Maybe you are looking for

  • How to avoid item suppression in multiple item PM strategy plan

    Dear gurus, we have ONE plan, which have two items.  First item is linked to a task list which has 1M package, Second Item is linked to a task list which has 1M,1Y pack. I have scheduled the task and i am not receiving a work order for the first item

  • IPOD Touch won't turn on

    I just ran into this issue and the fix is relatively simple.  I took my Touch back to the Apple Store, they plugged it into a wall outlet and explained the USB cord as well as the car charger doen't have enough power to charge a dead touch. m I went

  • 2LIS_02_SCL: goods receipt and invoice document number

    Hi, the BI Content documentation for the [Purchasing Data (Schedule Line Level) (2LIS_02_SCL)|http://help.sap.com/saphelp_nw04/helpdata/en/8d/bc383fe58d5900e10000000a114084/frameset.htm] DataSource reads: The DataSource also provides information abou

  • Is it ok to put Photoshop files (.PSD) on the iPod, and into iPhoto?

    is it ok to put Photoshop files (.PSD) on the iPod, and into iPhoto? please advise

  • Css position:fixed works on mozilla 21/IE10 but not in chrome ?

    Hello guys,      I want to stick in position  a rectangle or photo while scrolling browser. I am using    sym.$("Rectangle3").css({"position":"fixed"}); This works fine in Mozilla and IE10 but not in chrome (Version 27.0.1453.116 m) Anyone to help pl