InputAssist control is updated to 0.12 release

October 15th, 2010

As always the latest source code and SWC file can be downloaded from GitHub:http://github.com/JabbyPanda/InputAssist

Short description of new features:

“processing” property
   Quite often the long data list is being loaded into InputAssist control asynchronously from remote destinations. Now InputAssist is able to display “hourGlass” icon during the data loading process by controlling “processing” property.

“errorMessage” property
    If InputAssist’s dataProvider is currently empty, then there is nothing to be chosen from. Displaying “errorMessage” text and disabling the control gives the user the right UI feedback about the component state.

“prompt” property
   If no value is not selected yet via InputAssist control, the control can display text specified by the “prompt” value to explain what action is expected to be taken from the user side.

   Alternative usage of “prompt” property that I can think of – is to display the suppossedly selected current data object label which is not present in the InputAssist’s dataProvider list == e.g. this selected data object is not valid and should be altered by the further user action.

And yes, sorry about long time delay to retrieve city list in the demo below, it is not a component fault, but long service time response from api.business.gov

Get Adobe Flash player

Changelog for 0.12 release:
[+] Added property “prompt”
[+] Added property “errorMessage”
[+] Added property “processing”

[!] Fixed issue with dispatching InputAssistEvent.CHANGE event for nullable selectedItem
[!] Fixed issue with auto-completion by hitting ENTER key

  • http://blogagic.com/ Blogagic

    Better and better!

    Did you notice that when using the up and down arrows the cursor is moved from beg or end of the input field? (up arrow moves it to the beg of the field, down arrow moves it to the end).

  • http://www.jabbypanda.com JabbyPanda

    2Blogagic: This keyboard interaction is built-in into Spark TextInput component, I’ve just checked it at the demo above by playing with “prompt message” input text field.

    Do you think this behaviour is not natural for InputAssist component?

    When dropdown menu is opened, pressing Keyboard.UP or Keyboard.DOWN scrolls the list up and down, although I’ve just found a small quirk – will fix it on Monday.

  • http://blogagic.com/ Blogagic

    It puzzled me when I played with your component ;-)

    I think it would be more natural not to move the cursor in the input area when moving inside the assist list.

    If I start by entering a substring, I can use the arrow keys to see what are the proposed matching values. If I just use the DOWN arrow, I can then safely type more characters to refine the “search”. Now, if I used the UP arrow, the additional characters would be appended at the beginning of my search pattern.

    The very first time I used your component, I felt into this trap since I didn’t notice that the cursor was moved in first position when using the UP arrow :-)

    Now, as you know, I’m not yet using Flex 4 and Spark component so I don’t know how easy the change would be (I don’t want you to break your component just for my remark!).

  • Steven Dick

    I tried to use the InputAssist control in my project in Flash Builder 4 but I see 2 problems:
    * the design view in Flash Builder 4 is empty and won’t render
    * the application blows up the first time I enter the screen containing the InputAssis control (it looks like the control is not created)

    Any ideas? Thanks

    • http://www.jabbypanda.com JabbyPanda

      a) Regarding Design view, you are right, InputAssist currently breaks Design View in Flash Builder 4. Personally I do not use Design View in FB4, but I will look into means to provide the support for InputAssist to behave gracefully in Design View

      b) Can you paste a sample application code to http://pastebin.org/ ?

  • Rio Grande

    Hi,
    In first place I would like to thank you for this tool, very useful.

    Two things :
    - I can only making the InputAssist work with the compiled version (swc), with the sources I have sometimes errors.

    - The second thing is that the labelField property seems not to work. I would like debug to find if I made a mistake or you but I can’t due to the source problems.

    Note that I’m using the version 0.13 and Flex SDK 4.5 in flexbuilder.

  • Rio Grande

    I got the error, I have the same with the swc in fact :

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at com.jabbypanda.controls::InputAssist/onFlexWindowActivate()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.managers::FocusManager/activateWindowHandler()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\FocusManager.as:725]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()[E:\dev\hero_private\frameworks\projects\framework\src\mx\core\UIComponent.as:12977]
    at spark.components::WindowedApplication/nativeWindow_activateHandler()[E:\dev\hero_private\frameworks\projects\airspark\src\spark\components\WindowedApplication.as:2716]

    I have to admit the case is very particular. I’m in an Air Application here is the sequence:
    - display the filed in a State
    - switching stat (the InputAssist is hidden, not anymore included in the stat)
    - I go to another application (let say FireFox)
    - I go back to my air application and I got this error.

    I guess that there is a case missing in your “onFlexWindowActivate” function but what ?

  • http://www.jabbypanda.com JabbyPanda

    Thank you for reporting this issue, I will look into it!

    Did not try this InputAssist within Air application yet…

  • Rio Grande

    No problem.
    I noticed that when i put in comment this line :

    focusManager.addEventListener(FlexEvent.FLEX_WINDOW_ACTIVATE, onFlexWindowActivate);

    It works, but you probably put this line for a reason ;)

    But more annoying is the labelField, I didn’t found the solution yet.

  • http://www.jabbypanda.com JabbyPanda

    2Rio: The example above features 2 instances of InputAssist, the instance which is located below makes use of “labelField” property.

    Do you load your data from a remote location or its embedded into the SWF?

  • Rio Grande

    No, i found the problem. It’s because I was using an ArrayList, it works fine with an ArrayCollection. In the future it could be nice if it work with the two structures ;)

    Note that if I use the source code instead the SWF on (for example) this code :
    http://mysql.paste-bin.com/view/4176e187

    I have the following error :
    http://mysql.paste-bin.com/view/be3ea064

  • http://www.jabbypanda.com JabbyPanda

    2 Rio: InputAssist version 0.13 now supports ArrayList data type for dataProvider, enjoy

    http://www.jabbypanda.com/blog/2010/11/inputassist-is-updated-to-0-13-release/

  • Rio Grande

    Oops… I reported the problem with the Enter key (in your last post), but it work if you set “requireSelection” to “true”. Interessting only if the field is indeed required, but if it’s not the case you style hang with the problem.
    .
    InputAssist miss also a “selectedIndex” property in complement to the “selectedItem”. I add this in th InputAssist.as, works fine for me (probably not perfect).
    .
    http://mysql.paste-bin.com/view/70c09b7b

  • http://www.jabbypanda.com JabbyPanda

    Thank you for your reports.

    I promise that InputAssist will provide a better support for item selection by user interaction with a keyboard by hitting ENTER key.

    I will add “selectedIndex” property too.. right now you can always do the following:

    var selectedIndex : int = IList(inputAssist.dataProvider).getItemIndex(inputAssist.selectedItem);

  • Rio Grande

    Nice thanks,

    I also noticed that your dataProvider isn’t really a data provider. In face you do a copy of the object, so you can’t do any change on the dataProvider (because there is no link).

    Yeah a know I’m full of challenging ideas :p. Sadly I have not enough skills to propose a solution.