You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Peter Ent <pe...@adobe.com> on 2013/10/09 20:33:50 UTC
FlexJS Dynamic Controls
Hi,
I've spent some time on an experiment in FlexJS. Right now we have all of the components sitting in one package called, "staticControls". The intent of this package was to have controls that were relatively simple and had direct or close approximation with HTML elements. For example, Button would be a <button> element and List would be a <select>.
But I've been putting more and more complex controls into this package, so Alex came up with an experiment to create another package, which I've called "dynamicControls". I've only done a handful of controls and some of it is just duplicated code for the time being. What I did do, which I think is the most beneficial, is move common items, such as models and controllers, into a "common" package so both sets, static and dynamic, controls could share them.
This code is on a branch from develop in FlexJS called "feature/dynamicControls" if you care to check it out.
Regards,
Peter
Re: FlexJS Dynamic Controls
Posted by Peter Ent <pe...@adobe.com>.
I'm 99% sure we will be renaming and refactoring - just wanted to separate
the component sets. Here's an example:
MainView.mxml:
<flexjs:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:flexjs="library://ns.apache.org/flexjs/basic"
xmlns:local="*">
<fx:Script>
<![CDATA[
private function doesSomething() : void
{
var newLabel:Label = new Label();
Š
addElement(newLabel);
}
]]>
</fx:Script>
<flexjs:Label text="Title Here" />
<flexjs:Button text="Push Me" click="doesSomething()" />
Š
</flexjs:ViewBase>
In this sample, which is built using the basic components (which, for now,
maps to the staticControls set by the basic-manifest.xml) the Button
creates a new Label and maybe some other stuff.
Now suppose you want to switch over to the more complex controls offered
in the dyanmicControls package. You simply change the flexjs namespace:
xmlns:flexjs="library://ns.apache.org/flexjs/dynamic"
or whatever it will be called. The point is you can switch component
packages or, if you want to mix them, do that as well (although you will
need to fully qualify them to avoid ambiguity).
Anyway, just some ideas to put out there.
--peter
On 10/10/13 7:52 AM, "Tom Chiverton" <tc...@extravision.com> wrote:
>On 09/10/2013 19:33, Peter Ent wrote:
>> "staticControls". The intent of this package was to have controls
>>that were relatively simple and had direct or close approximation with
>>HTML elements.
>In which case I think the name is confusing. They are just as dynamic in
>terms of data binding as the other ones, right ?
>Maybe 'baseControls' or 'basicControls' is better? 'directHtmlControls' ?
>
>Tom
Re: FlexJS Dynamic Controls
Posted by Tom Chiverton <tc...@extravision.com>.
On 09/10/2013 19:33, Peter Ent wrote:
> "staticControls". The intent of this package was to have controls that were relatively simple and had direct or close approximation with HTML elements.
In which case I think the name is confusing. They are just as dynamic in
terms of data binding as the other ones, right ?
Maybe 'baseControls' or 'basicControls' is better? 'directHtmlControls' ?
Tom