Repository: flex-asjs Updated Branches: refs/heads/develop 14abba2c9 -> d4244fe45
First implementation of js:Form. Is nesting tags, but action attribute is not working Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/d4244fe4 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/d4244fe4 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/d4244fe4 Branch: refs/heads/develop Commit: d4244fe4574a8a7bb42d10d8e1ac3fb5b06594f7 Parents: 14abba2 Author: Carlos Rovira <carlosrov...@apache.org> Authored: Mon Oct 17 11:57:20 2016 +0200 Committer: Carlos Rovira <carlosrov...@apache.org> Committed: Mon Oct 17 11:57:20 2016 +0200 ---------------------------------------------------------------------- .../src/main/flex/org/apache/flex/html/Form.as | 99 ++++++++++++++++++++ .../HTML/src/main/resources/basic-manifest.xml | 1 + .../HTML/src/main/resources/defaults.css | 4 + 3 files changed, 104 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4244fe4/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Form.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Form.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Form.as new file mode 100644 index 0000000..d7b0459 --- /dev/null +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Form.as @@ -0,0 +1,99 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.html +{ + import org.apache.flex.core.ContainerBase; + + COMPILE::JS + { + import org.apache.flex.core.WrappedHTMLElement; + } + + [DefaultProperty("mxmlContent")] + + /** + * The Form class is a simple form. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public class Form extends ContainerBase + { + /** + * Constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function Form() + { + super(); + } + + /** + * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement + */ + COMPILE::JS + override protected function createElement():WrappedHTMLElement + {HTMLFormElement + element = document.createElement('form') as WrappedHTMLElement; + + positioner = element; + + positioner.style.position = 'relative'; + element.flexjs_wrapper = this; + return element; + } + + + private var _action:String = "#"; + + [Bindable("actionChange")] + /** + * The action to be performed when the form is submitted + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get action():String + { + return _action; + } + + /** + * @private + */ + public function set action(value:String):void + { + _action = value; + + COMPILE::JS + { + this.element.setAttribute('action', action); + this.dispatchEvent('actionChange'); + } + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4244fe4/frameworks/projects/HTML/src/main/resources/basic-manifest.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/resources/basic-manifest.xml b/frameworks/projects/HTML/src/main/resources/basic-manifest.xml index f56d4d8..6737a40 100644 --- a/frameworks/projects/HTML/src/main/resources/basic-manifest.xml +++ b/frameworks/projects/HTML/src/main/resources/basic-manifest.xml @@ -40,6 +40,7 @@ <component id="RadioButton" class="org.apache.flex.html.RadioButton"/> <component id="ComboBox" class="org.apache.flex.html.ComboBox"/> <component id="Container" class="org.apache.flex.html.Container"/> + <component id="Form" class="org.apache.flex.html.Form"/> <component id="HContainer" class="org.apache.flex.html.HContainer"/> <component id="VContainer" class="org.apache.flex.html.VContainer"/> <component id="Panel" class="org.apache.flex.html.Panel"/> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4244fe4/frameworks/projects/HTML/src/main/resources/defaults.css ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/resources/defaults.css b/frameworks/projects/HTML/src/main/resources/defaults.css index 28f2077..40ed0b5 100644 --- a/frameworks/projects/HTML/src/main/resources/defaults.css +++ b/frameworks/projects/HTML/src/main/resources/defaults.css @@ -174,6 +174,10 @@ RangeStepper { IBeadController: ClassReference("org.apache.flex.html.beads.controllers.RangeStepperMouseController"); } +Form { + +} + HContainer { IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");