You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2020/06/17 14:57:59 UTC

[GitHub] [royale-asjs] raudjcholo opened a new pull request #869: New bead to select an item in the ComboBox of Jewel from a variable

raudjcholo opened a new pull request #869:
URL: https://github.com/apache/royale-asjs/pull/869


   This bead allows to select an item by Field. It has two variables: valueField and selectedValue.
   
   - valueField: The String that will be used for comparison field name
   - selectedValue: Any kind of object to perform the comparison or select the item with this value in the field.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] raudjcholo commented on a change in pull request #869: New bead to select an item in the ComboBox of Jewel from a variable

Posted by GitBox <gi...@apache.org>.
raudjcholo commented on a change in pull request #869:
URL: https://github.com/apache/royale-asjs/pull/869#discussion_r442143566



##########
File path: frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/ComboBoxItemByField.as
##########
@@ -0,0 +1,71 @@
+package com.iest.winplusweb.beads
+{
+  import org.apache.royale.core.IBead;
+  import org.apache.royale.jewel.ComboBox;
+  import org.apache.royale.core.IStrand;
+  import org.apache.royale.collections.CollectionUtils;
+  import org.apache.royale.collections.ArrayList;
+  import org.apache.royale.events.Event;
+
+  public class ComboBoxItemByField implements IBead{
+
+      protected var comboBox:ComboBox;
+
+
+      public function ComboBoxItemByField()
+		{
+		}
+
+        public function set strand(value:IStrand):void
+		{
+			comboBox = value as ComboBox;

Review comment:
       Hi:
   
   I have tried to change the code to use an interface but I have not got it to work. 
   
   I will send an email to the list with the code to see if you can help me.
   
   Thanks!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] carlosrovira commented on pull request #869: New bead to select an item in the ComboBox of Jewel from a variable

Posted by GitBox <gi...@apache.org>.
carlosrovira commented on pull request #869:
URL: https://github.com/apache/royale-asjs/pull/869#issuecomment-645432509


   Hi Raúl, thanks for the contribution :)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] yishayw commented on a change in pull request #869: New bead to select an item in the ComboBox of Jewel from a variable

Posted by GitBox <gi...@apache.org>.
yishayw commented on a change in pull request #869:
URL: https://github.com/apache/royale-asjs/pull/869#discussion_r441657973



##########
File path: frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/ComboBoxItemByField.as
##########
@@ -1,21 +1,65 @@
-package com.iest.winplusweb.beads
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.royale.jewel.beads.controls.combobox
 {
   import org.apache.royale.core.IBead;
   import org.apache.royale.jewel.ComboBox;
   import org.apache.royale.core.IStrand;
   import org.apache.royale.collections.CollectionUtils;
   import org.apache.royale.collections.ArrayList;
   import org.apache.royale.events.Event;
+  
+  /**
+	 *  The ComboBoxItemByField class is a specialty bead that can be used with
+	 *  any ComboBox control. This bead allows to select an item by field
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.9.4

Review comment:
       Royale version should be the next released one. Unfortunately, we still don't know what the next version number will be... I suggest using 0.9.8 because that has been the convention so far. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] yishayw commented on a change in pull request #869: New bead to select an item in the ComboBox of Jewel from a variable

Posted by GitBox <gi...@apache.org>.
yishayw commented on a change in pull request #869:
URL: https://github.com/apache/royale-asjs/pull/869#discussion_r441648944



##########
File path: frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/ComboBoxItemByField.as
##########
@@ -0,0 +1,71 @@
+package com.iest.winplusweb.beads

Review comment:
       This looks wrong. Also, I don't see Apache headers in this file.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] yishayw commented on a change in pull request #869: New bead to select an item in the ComboBox of Jewel from a variable

Posted by GitBox <gi...@apache.org>.
yishayw commented on a change in pull request #869:
URL: https://github.com/apache/royale-asjs/pull/869#discussion_r441664157



##########
File path: frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/ComboBoxItemByField.as
##########
@@ -0,0 +1,71 @@
+package com.iest.winplusweb.beads
+{
+  import org.apache.royale.core.IBead;
+  import org.apache.royale.jewel.ComboBox;
+  import org.apache.royale.core.IStrand;
+  import org.apache.royale.collections.CollectionUtils;
+  import org.apache.royale.collections.ArrayList;
+  import org.apache.royale.events.Event;
+
+  public class ComboBoxItemByField implements IBead{
+
+      protected var comboBox:ComboBox;
+
+
+      public function ComboBoxItemByField()
+		{
+		}
+
+        public function set strand(value:IStrand):void
+		{
+			comboBox = value as ComboBox;
+			comboBox.addEventListener("selectionChanged", selectionChangedHandler);
+			updateHost();
+		}
+
+        private var _valueField:String;
+        
+        public function get valueField():String
+        {
+            return _valueField;
+        }
+        public function set valueField(value:String):void
+        {
+            _valueField = value;
+			updateHost();
+        }
+
+        private var _selectedValue:*;
+
+        public function get selectedValue():*{
+            return _selectedValue;
+        }
+
+        public function set selectedValue(value:*):void{
+            _selectedValue = value;
+            updateHost();
+        }
+
+        protected function updateHost():void
+		{
+			if(comboBox && valueField != "" && selectedValue != null){
+			    var aux:* = CollectionUtils.getItemByField(comboBox.dataProvider as ArrayList,valueField,selectedValue);

Review comment:
       CollectionUtils.getItemByField() expects an ICollectionView. It's better to use an interface rather than a conrete class when possible for better reuse.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] raudjcholo commented on a change in pull request #869: New bead to select an item in the ComboBox of Jewel from a variable

Posted by GitBox <gi...@apache.org>.
raudjcholo commented on a change in pull request #869:
URL: https://github.com/apache/royale-asjs/pull/869#discussion_r441699667



##########
File path: frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/ComboBoxItemByField.as
##########
@@ -0,0 +1,71 @@
+package com.iest.winplusweb.beads
+{
+  import org.apache.royale.core.IBead;
+  import org.apache.royale.jewel.ComboBox;
+  import org.apache.royale.core.IStrand;
+  import org.apache.royale.collections.CollectionUtils;
+  import org.apache.royale.collections.ArrayList;
+  import org.apache.royale.events.Event;
+
+  public class ComboBoxItemByField implements IBead{
+
+      protected var comboBox:ComboBox;
+
+
+      public function ComboBoxItemByField()
+		{
+		}
+
+        public function set strand(value:IStrand):void
+		{
+			comboBox = value as ComboBox;

Review comment:
       Ok, it's a great idea!!!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] yishayw commented on a change in pull request #869: New bead to select an item in the ComboBox of Jewel from a variable

Posted by GitBox <gi...@apache.org>.
yishayw commented on a change in pull request #869:
URL: https://github.com/apache/royale-asjs/pull/869#discussion_r441648944



##########
File path: frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/ComboBoxItemByField.as
##########
@@ -0,0 +1,71 @@
+package com.iest.winplusweb.beads

Review comment:
       This looks wrong. Also, I don't see Apache headers in this file.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] yishayw commented on a change in pull request #869: New bead to select an item in the ComboBox of Jewel from a variable

Posted by GitBox <gi...@apache.org>.
yishayw commented on a change in pull request #869:
URL: https://github.com/apache/royale-asjs/pull/869#discussion_r441651883



##########
File path: frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/ComboBoxItemByField.as
##########
@@ -0,0 +1,71 @@
+package com.iest.winplusweb.beads
+{
+  import org.apache.royale.core.IBead;
+  import org.apache.royale.jewel.ComboBox;
+  import org.apache.royale.core.IStrand;
+  import org.apache.royale.collections.CollectionUtils;
+  import org.apache.royale.collections.ArrayList;
+  import org.apache.royale.events.Event;
+
+  public class ComboBoxItemByField implements IBead{
+
+      protected var comboBox:ComboBox;
+
+
+      public function ComboBoxItemByField()
+		{
+		}
+
+        public function set strand(value:IStrand):void
+		{
+			comboBox = value as ComboBox;

Review comment:
       Have you considered casting this to an interface so it can work on strands other than jewel ComboBox? It could be better to place this in Basic so other component sets can use this.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] carlosrovira commented on pull request #869: New bead to select an item in the ComboBox of Jewel from a variable

Posted by GitBox <gi...@apache.org>.
carlosrovira commented on pull request #869:
URL: https://github.com/apache/royale-asjs/pull/869#issuecomment-645863536


   Don't think so. The merge is valid as it's in the current state. What we are asking is for a next iteration to enhance the solution to make it more available for more components.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] raudjcholo commented on a change in pull request #869: New bead to select an item in the ComboBox of Jewel from a variable

Posted by GitBox <gi...@apache.org>.
raudjcholo commented on a change in pull request #869:
URL: https://github.com/apache/royale-asjs/pull/869#discussion_r441680766



##########
File path: frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/ComboBoxItemByField.as
##########
@@ -1,21 +1,65 @@
-package com.iest.winplusweb.beads
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.royale.jewel.beads.controls.combobox
 {
   import org.apache.royale.core.IBead;
   import org.apache.royale.jewel.ComboBox;
   import org.apache.royale.core.IStrand;
   import org.apache.royale.collections.CollectionUtils;
   import org.apache.royale.collections.ArrayList;
   import org.apache.royale.events.Event;
+  
+  /**
+	 *  The ComboBoxItemByField class is a specialty bead that can be used with
+	 *  any ComboBox control. This bead allows to select an item by field
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.9.4

Review comment:
       Ok, perfect!!. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] carlosrovira merged pull request #869: New bead to select an item in the ComboBox of Jewel from a variable

Posted by GitBox <gi...@apache.org>.
carlosrovira merged pull request #869:
URL: https://github.com/apache/royale-asjs/pull/869


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] Harbs commented on pull request #869: New bead to select an item in the ComboBox of Jewel from a variable

Posted by GitBox <gi...@apache.org>.
Harbs commented on pull request #869:
URL: https://github.com/apache/royale-asjs/pull/869#issuecomment-645545562


   Should we revert the merge until the suggestions are implemented?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] raudjcholo commented on a change in pull request #869: New bead to select an item in the ComboBox of Jewel from a variable

Posted by GitBox <gi...@apache.org>.
raudjcholo commented on a change in pull request #869:
URL: https://github.com/apache/royale-asjs/pull/869#discussion_r441681246



##########
File path: frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/ComboBoxItemByField.as
##########
@@ -0,0 +1,71 @@
+package com.iest.winplusweb.beads
+{
+  import org.apache.royale.core.IBead;
+  import org.apache.royale.jewel.ComboBox;
+  import org.apache.royale.core.IStrand;
+  import org.apache.royale.collections.CollectionUtils;
+  import org.apache.royale.collections.ArrayList;
+  import org.apache.royale.events.Event;
+
+  public class ComboBoxItemByField implements IBead{
+
+      protected var comboBox:ComboBox;
+
+
+      public function ComboBoxItemByField()
+		{
+		}
+
+        public function set strand(value:IStrand):void
+		{
+			comboBox = value as ComboBox;
+			comboBox.addEventListener("selectionChanged", selectionChangedHandler);
+			updateHost();
+		}
+
+        private var _valueField:String;
+        
+        public function get valueField():String
+        {
+            return _valueField;
+        }
+        public function set valueField(value:String):void
+        {
+            _valueField = value;
+			updateHost();
+        }
+
+        private var _selectedValue:*;
+
+        public function get selectedValue():*{
+            return _selectedValue;
+        }
+
+        public function set selectedValue(value:*):void{
+            _selectedValue = value;
+            updateHost();
+        }
+
+        protected function updateHost():void
+		{
+			if(comboBox && valueField != "" && selectedValue != null){
+			    var aux:* = CollectionUtils.getItemByField(comboBox.dataProvider as ArrayList,valueField,selectedValue);

Review comment:
       I will change it. Thanks for the feedback




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org