Professional Web Applications Themes

How do I programatically select.... - Macromedia Flex General Discussion

What I have is the following. A list box with dates in it. A list box with selected Dates in it.. The first box is populated from a Webservice.result set. (An array I believe) The second box is populated with dates selected from first box (Another array as Dataprovider in this case) When I select a date from the Second box, all I know is the INDEX of that selection. I then apply that index against the array that populated it to get the PHYSICAL date value. Now the question. How do I compare the PHYSICAL date value selected from ...

  1. #1

    Default How do I programatically select....

    What I have is the following.

    A list box with dates in it.
    A list box with selected Dates in it..

    The first box is populated from a Webservice.result set. (An array I believe)
    The second box is populated with dates selected from first box (Another array
    as Dataprovider in this case)

    When I select a date from the Second box, all I know is the INDEX of that
    selection. I then apply that index against the array that populated it to get
    the PHYSICAL date value.

    Now the question.

    How do I compare the PHYSICAL date value selected from the 2nd box, against
    the VALUES in the first box, so that I can then select that ITEM so it's
    visually apparent it is selected. (When a value is clicked in second box, want
    the first box to match)

    I am already aware of the vPosition propertie. My problem is finding the DATE
    value in the list, as opposed to the index value of the item.

    Any help would be greatly appreciated.

    [email]svenlaunchvision.com[/email]

    Sven Hansen
    Geek.Nerd






    Sven (flex noob) Guest

  2. #2

    Default Re: How do I programatically select....

    Unfortunately, the list-based controls do not provide a "selectItem()" method
    "yet". It is a highly requested enhancement, and yo migh want to add your vote
    at:
    [url]http://www.macromedia.com/support/email/wishform/[/url]

    In the mean time, you will simply have to iterate through the dataProvider
    items for the first list, comparing each value to the the value from the second
    list. Use the for(var i:Number ...) loop format, so when you have a match, you
    can break, and then the "i" will be bothe the selectedIndex and the vPosition
    you want for the first list..

    Tracy

    ntsiii Guest

  3. #3

    Default Re: How do I programatically select....

    Thanks for the reply Tracy.

    In the end, because I knew the value in row 0 of the list box, and that the
    dates were 1 week apart, I just used a bit of date math to determine the
    difference between the two, and then went to that row. Worked quite quickly.

    You are right, it would be nice to select the chosen item from the list.

    e.g. getSelectedIndex('05/05/2005') -- which would go to the item
    (including vPositioning) with that value in the label, and return an index of
    the same.



    Sven (flex noob) Guest

Similar Threads

  1. Select a list of items into an aliased field when doinga select
    By ehaemmerle in forum Coldfusion Database Access
    Replies: 3
    Last Post: March 18th, 10:49 PM
  2. Replies: 0
    Last Post: September 24th, 03:24 AM
  3. Replies: 0
    Last Post: September 11th, 11:26 AM
  4. Replies: 0
    Last Post: September 11th, 12:19 AM
  5. Replies: 0
    Last Post: April 15th, 01:22 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139