[jira] [Commented] (FLEX-33120) Please check support for ExactValue initializer
[ https://issues.apache.org/jira/browse/FLEX-33120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13664997#comment-13664997 ] Justin Mclean commented on FLEX-33120: -- From applying the patch and doing a little testing look like the patch may be missing some code from method in ValueInitilizer.java. protected Node formatExpr(NodeFactory nodeFactory, HashSetString configNamespaces, boolean generateDocComments, Type targetType, Object value) I assume it would to do something like this: if (value instanceof ExactValueExpression) { return ((ExactValueExpression) value).getValueExpression(nodeFactory); } However not 100% sure what needs to go on in getValueExpression passed a nodeFactory. Please check support for ExactValue initializer --- Key: FLEX-33120 URL: https://issues.apache.org/jira/browse/FLEX-33120 Project: Apache Flex Issue Type: Improvement Components: MXML Compiler Reporter: Alex Harui Priority: Minor Labels: easyfix Attachments: exactValue.patch, screenshot-1.jpg, workiingExample.jpg I've done my own improvement for MXML to support any values for property initializer WITHOUT bindings, for example: Was: TextField xmlns=flash.text.* autoSize={TextFieldAutoSize.CENTER} / is generated into: private function _MyOwnFlexFrameworkTest_TextField1_i() : flash.text.TextField { var temp : flash.text.TextField = new flash.text.TextField(); _MyOwnFlexFrameworkTest_TextField1 = temp; mx.binding.BindingManager.executeBindings(this, _MyOwnFlexFrameworkTest_TextField1, _MyOwnFlexFrameworkTest_TextField1); return temp; } // binding mgmt private function _MyOwnFlexFrameworkTest_bindingsSetup():Array { var result:Array = []; result[0] = new mx.binding.Binding(this, function():String { var result:* = (TextFieldAutoSize.CENTER); return (result == undefined ? null : String(result)); }, null, _MyOwnFlexFrameworkTest_TextField1.autoSize ); return result; } now: TextField xmlns=flash.text.* autoSize=${TextFieldAutoSize.CENTER} / give us such result: private function _MyOwnFlexFrameworkTest_TextField1_i() : flash.text.TextField { var temp : flash.text.TextField = new flash.text.TextField(); temp.autoSize = TextFieldAutoSize.CENTER; _MyOwnFlexFrameworkTest_TextField1 = temp; mx.binding.BindingManager.executeBindings(this, _MyOwnFlexFrameworkTest_TextField1, _MyOwnFlexFrameworkTest_TextField1); return temp; } this implementation is similar to twoWay bindings and written in the same way. btw, sorry for my English, I'm Russian. Thanks -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FLEX-33120) Please check support for ExactValue initializer
[ https://issues.apache.org/jira/browse/FLEX-33120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13665006#comment-13665006 ] Justin Mclean commented on FLEX-33120: -- Sample that fails with current patch. ?xml version=1.0 encoding=utf-8? s:Application xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx s:layout s:VerticalLayout / /s:layout fx:Script ![CDATA[ public static const myName:String = Justin; public static const WIDTH:int = 600; ]] /fx:Script s:Label text=@Once{myName} width=100% / s:List width=@Once{WIDTH} height=@Once{WIDTH/2} / /s:Application Please check support for ExactValue initializer --- Key: FLEX-33120 URL: https://issues.apache.org/jira/browse/FLEX-33120 Project: Apache Flex Issue Type: Improvement Components: MXML Compiler Reporter: Alex Harui Priority: Minor Labels: easyfix Attachments: exactValue.patch, patch.diff, screenshot-1.jpg, workiingExample.jpg I've done my own improvement for MXML to support any values for property initializer WITHOUT bindings, for example: Was: TextField xmlns=flash.text.* autoSize={TextFieldAutoSize.CENTER} / is generated into: private function _MyOwnFlexFrameworkTest_TextField1_i() : flash.text.TextField { var temp : flash.text.TextField = new flash.text.TextField(); _MyOwnFlexFrameworkTest_TextField1 = temp; mx.binding.BindingManager.executeBindings(this, _MyOwnFlexFrameworkTest_TextField1, _MyOwnFlexFrameworkTest_TextField1); return temp; } // binding mgmt private function _MyOwnFlexFrameworkTest_bindingsSetup():Array { var result:Array = []; result[0] = new mx.binding.Binding(this, function():String { var result:* = (TextFieldAutoSize.CENTER); return (result == undefined ? null : String(result)); }, null, _MyOwnFlexFrameworkTest_TextField1.autoSize ); return result; } now: TextField xmlns=flash.text.* autoSize=${TextFieldAutoSize.CENTER} / give us such result: private function _MyOwnFlexFrameworkTest_TextField1_i() : flash.text.TextField { var temp : flash.text.TextField = new flash.text.TextField(); temp.autoSize = TextFieldAutoSize.CENTER; _MyOwnFlexFrameworkTest_TextField1 = temp; mx.binding.BindingManager.executeBindings(this, _MyOwnFlexFrameworkTest_TextField1, _MyOwnFlexFrameworkTest_TextField1); return temp; } this implementation is similar to twoWay bindings and written in the same way. btw, sorry for my English, I'm Russian. Thanks -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FLEX-33120) Please check support for ExactValue initializer
[ https://issues.apache.org/jira/browse/FLEX-33120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13665007#comment-13665007 ] Justin Mclean commented on FLEX-33120: -- Two way binding sample that compiles and works with the patch: ?xml version=1.0 encoding=utf-8? s:Application xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx s:layout s:VerticalLayout / /s:layout s:TextInput id=firstField / s:TextInput id=secondField text=@TwoWay{firstField.text} / /s:Application Please check support for ExactValue initializer --- Key: FLEX-33120 URL: https://issues.apache.org/jira/browse/FLEX-33120 Project: Apache Flex Issue Type: Improvement Components: MXML Compiler Reporter: Alex Harui Priority: Minor Labels: easyfix Attachments: exactValue.patch, patch.diff, screenshot-1.jpg, workiingExample.jpg I've done my own improvement for MXML to support any values for property initializer WITHOUT bindings, for example: Was: TextField xmlns=flash.text.* autoSize={TextFieldAutoSize.CENTER} / is generated into: private function _MyOwnFlexFrameworkTest_TextField1_i() : flash.text.TextField { var temp : flash.text.TextField = new flash.text.TextField(); _MyOwnFlexFrameworkTest_TextField1 = temp; mx.binding.BindingManager.executeBindings(this, _MyOwnFlexFrameworkTest_TextField1, _MyOwnFlexFrameworkTest_TextField1); return temp; } // binding mgmt private function _MyOwnFlexFrameworkTest_bindingsSetup():Array { var result:Array = []; result[0] = new mx.binding.Binding(this, function():String { var result:* = (TextFieldAutoSize.CENTER); return (result == undefined ? null : String(result)); }, null, _MyOwnFlexFrameworkTest_TextField1.autoSize ); return result; } now: TextField xmlns=flash.text.* autoSize=${TextFieldAutoSize.CENTER} / give us such result: private function _MyOwnFlexFrameworkTest_TextField1_i() : flash.text.TextField { var temp : flash.text.TextField = new flash.text.TextField(); temp.autoSize = TextFieldAutoSize.CENTER; _MyOwnFlexFrameworkTest_TextField1 = temp; mx.binding.BindingManager.executeBindings(this, _MyOwnFlexFrameworkTest_TextField1, _MyOwnFlexFrameworkTest_TextField1); return temp; } this implementation is similar to twoWay bindings and written in the same way. btw, sorry for my English, I'm Russian. Thanks -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FLEX-33120) Please check support for ExactValue initializer
[ https://issues.apache.org/jira/browse/FLEX-33120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13631116#comment-13631116 ] Cyrill Zadra commented on FLEX-33120: - In dev list ( http://markmail.org/thread/ajtd7wg7uszs5fwc) I've found a large discussion about it .. and as far as I could understand there was no consensus found. There were following suggestions: s:TextInput text=@Once{initial} / s:TextInput text=${initial}/ Please check support for ExactValue initializer --- Key: FLEX-33120 URL: https://issues.apache.org/jira/browse/FLEX-33120 Project: Apache Flex Issue Type: Improvement Components: MXML Compiler Reporter: Alex Harui Priority: Minor Labels: easyfix Attachments: exactValue.patch, screenshot-1.jpg, workiingExample.jpg I've done my own improvement for MXML to support any values for property initializer WITHOUT bindings, for example: Was: TextField xmlns=flash.text.* autoSize={TextFieldAutoSize.CENTER} / is generated into: private function _MyOwnFlexFrameworkTest_TextField1_i() : flash.text.TextField { var temp : flash.text.TextField = new flash.text.TextField(); _MyOwnFlexFrameworkTest_TextField1 = temp; mx.binding.BindingManager.executeBindings(this, _MyOwnFlexFrameworkTest_TextField1, _MyOwnFlexFrameworkTest_TextField1); return temp; } // binding mgmt private function _MyOwnFlexFrameworkTest_bindingsSetup():Array { var result:Array = []; result[0] = new mx.binding.Binding(this, function():String { var result:* = (TextFieldAutoSize.CENTER); return (result == undefined ? null : String(result)); }, null, _MyOwnFlexFrameworkTest_TextField1.autoSize ); return result; } now: TextField xmlns=flash.text.* autoSize=${TextFieldAutoSize.CENTER} / give us such result: private function _MyOwnFlexFrameworkTest_TextField1_i() : flash.text.TextField { var temp : flash.text.TextField = new flash.text.TextField(); temp.autoSize = TextFieldAutoSize.CENTER; _MyOwnFlexFrameworkTest_TextField1 = temp; mx.binding.BindingManager.executeBindings(this, _MyOwnFlexFrameworkTest_TextField1, _MyOwnFlexFrameworkTest_TextField1); return temp; } this implementation is similar to twoWay bindings and written in the same way. btw, sorry for my English, I'm Russian. Thanks -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FLEX-33120) Please check support for ExactValue initializer
[ https://issues.apache.org/jira/browse/FLEX-33120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13631219#comment-13631219 ] Justin Mclean commented on FLEX-33120: -- I'd suggest @Once and add support for @TwoWay (for current @{}) as it fit with existing style. Please check support for ExactValue initializer --- Key: FLEX-33120 URL: https://issues.apache.org/jira/browse/FLEX-33120 Project: Apache Flex Issue Type: Improvement Components: MXML Compiler Reporter: Alex Harui Priority: Minor Labels: easyfix Attachments: exactValue.patch, screenshot-1.jpg, workiingExample.jpg I've done my own improvement for MXML to support any values for property initializer WITHOUT bindings, for example: Was: TextField xmlns=flash.text.* autoSize={TextFieldAutoSize.CENTER} / is generated into: private function _MyOwnFlexFrameworkTest_TextField1_i() : flash.text.TextField { var temp : flash.text.TextField = new flash.text.TextField(); _MyOwnFlexFrameworkTest_TextField1 = temp; mx.binding.BindingManager.executeBindings(this, _MyOwnFlexFrameworkTest_TextField1, _MyOwnFlexFrameworkTest_TextField1); return temp; } // binding mgmt private function _MyOwnFlexFrameworkTest_bindingsSetup():Array { var result:Array = []; result[0] = new mx.binding.Binding(this, function():String { var result:* = (TextFieldAutoSize.CENTER); return (result == undefined ? null : String(result)); }, null, _MyOwnFlexFrameworkTest_TextField1.autoSize ); return result; } now: TextField xmlns=flash.text.* autoSize=${TextFieldAutoSize.CENTER} / give us such result: private function _MyOwnFlexFrameworkTest_TextField1_i() : flash.text.TextField { var temp : flash.text.TextField = new flash.text.TextField(); temp.autoSize = TextFieldAutoSize.CENTER; _MyOwnFlexFrameworkTest_TextField1 = temp; mx.binding.BindingManager.executeBindings(this, _MyOwnFlexFrameworkTest_TextField1, _MyOwnFlexFrameworkTest_TextField1); return temp; } this implementation is similar to twoWay bindings and written in the same way. btw, sorry for my English, I'm Russian. Thanks -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira