Filed under: actionScript, components, development, flex, jwo_lib
I have been working on a personal project for sometime now. It makes heavy use of forms and renderer type class. This means loads of mx:TextInput. The issue was that I wanted the effect of inline editing on a form that, at first glance, looks like any pre-filled data will just appear as labels (or in this case a TextInputs minus their borders).
One approach was to simply use mx:states and swap out labels for textInputs and visa versa when needed. That would probably entail either some intense if/else and switch statements or just doing a massive form state swap when one of the controls is activated. I don’t like this because a) it deals with states which IMHO kinda suck and are finicky and b) seems very inefficient.
The other approach (which I opted for) was to have the actual control switch its state manually. In this case not states as in mx:states but rather it would handle its own display logic based on the user interaction. Enter the new com.jwopitz.controls.TextInput. When you are not editing it looks like a simple label with a prompt and when you want to edit it, WHALLLA, just click it and it appears to be the TextInput it really is.
I think this makes the component itself more inline with what a RIA is. Forms by nature are not really all that exciting and RIA-ish. I mean really, how much more fun can entering data be? But this very simple addition to the TextInput’s feature set might help make a boring form into a ….. well … less….. boring form.
Keep in mind, even though I have done quite a bit of use testing with this, there may be a few undiscovered bugs. Hey its a beta version right? If any major issues come up, shoot me an email.
Anywhoo… I have updated jwo_lib and the example file (link above). I will post updates to the docs here shortly.
1 Comment so far
Leave a comment
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

I think this is great. I am a tufte fan and I hate the thought of having textinputs with their borders when there is information in them.
This is great!
Thanks for sharing.
Pierre
Comment by Pierre Roberge Tuesday, October 23, 2007 @ 1:30 pm