ComboBox onEnterFrame Issue
Hi,
I have created an email form in one swf that is called into
another swf. In this form there is a comboBox that will populate a
text field when something is selected in it. Everything works fine
with the comboBox in it's own swf but when it's called into another
swf the comboBox is inactive. I'm not sure but I think it may have
to do with the onEnterFrame.... here is the code from the swf that
contains the comboBox and email information.
import mx.remoting.Service;
import mx.services.Log;
import mx.rpc.RelayResponder;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;
import mx.remoting.PendingCall;
import mx.remoting.RecordSet;
import mx.remoting.DataGlue;
onEnterFrame = function(){
area_ta.text = area_cb.value;
submit_btn.onRelease = function() {
if (question1_txt.text == "") {
gotoAndStop ("error");
}else{
var pc:PendingCall = myService.mailSuggestion
(question1_txt.text, area_cb.value);
pc.responder = new RelayResponder (this,
"mailSuggestion_Result","mailSuggestion_Fault");
gotoAndStop ("correct");
var myService : Service = new Service("
http://******flashservices/gateway",
new Log (Log.DEBUG),
"tap.*******.emailfunction",
null,
null);
stop();
Thanks for helping me with this by the way...
Ok I added the listener and that worked in it's own swf, but
same issue when I pull from the main swf. I'll try putting it in
the main swf but I would like to keep it in the one its in.
Picture a website and when you click on Ask The Trainer
button that calls a swf and in this swf there will be a combobox to
select what area you are from and a text box that you will fill in
your question in and then click submit. That sends an email
containing the info from the combobox and the text field. So I
would need them all in the same swf, wouldn't I?
Similar Messages
-
Short version: ComboBox's dropdown works and renders properly before fullscreen, but not during or after.
I'm not totally sure how to ask this, so I've actually made a page demonstrating the error, with a very simple Flex app, and all three directions you need to experience the problem yourself.
For those of you not daring enough to follow my link above, I'll do my best to explain here. I've built a more extensive Flex application (not the one in the link) that has some graphs and charts and checkboxes and other controls for those charts. At the bottom of app in a few of the application States, there is a ComboBox. Because this is at the very bottom, when you click it to access it's dropdown menu, Flex thoughtfully has it come out of the top. Yay, Flex!
This works well until Fullscreen mode. Upon entering fullscreen, I scale everything up with a stage.scaleMode = StageScaleMode.SHOW_ALL. Now when you click on the ComboBox, the dropdown is astonishingly large, and actually drops beneath the ComboBox, causing it to mostly disappear off-screen. The best part is, once you exit fullscreen mode, the dropdown insists on continuing to drop below the ComboBox, which is positioned at the bottom of the app, and so continues to be cut off.
Has anyone else run into this beast, stared into it's great maw, and come away victorious? Am I doing fullscreen mode wrong? Please help!
You can get the source code via View Source from the Flash player in the link, and thank you so much for your time.Thanks for the prompt reply!
Here is a link to my identical, but two week old post on the Flex forums: [Flex] ComboBox fullscreen issue. I believe the answer to your question is "no".
Additionally, I have filed a bug report under the Flash player category to this effect, as well as doppelganger posts on Stack Overflow and Flexcoders. This is the first human response I've gotten on this issue to date, but I did earn an S.O. badge for having no responses for such an extended period of time.
I posted here after this prolonged duration of nothing, and because I thought perhaps it wasn't an issue with the language, but rather the way it was rendered in the player. I have no idea where I should be getting answers for this from, but the problem isn't going away on it's own or through my repeated attempts at a solution. So if this helps me even get directed to the right place, I will be grateful.
Thank you! -
DropDownList / ComboBox DataProvider Issue
In this example I have an ArrayCollection (values) that serves as a DataProvider and a Bindable field (value). I would like to twoWay bind the value and dynamically load the values. When dynamically loading the values, my bounded value is null.
I have two applications below, in the first example the dataprovider is initialized with all its values and the behavior is correct:
<?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark">
<s:layout>
<s:VerticalLayout/>
</s:layout>
<fx:Declarations>
<fx:String id="value">B</fx:String>
<s:ArrayCollection id="values">
<fx:String>A</fx:String>
<fx:String>B</fx:String>
<fx:String>C</fx:String>
</s:ArrayCollection>
</fx:Declarations>
<s:ComboBox id="comboBox" selectedItem="@{value}" dataProvider="{values}"/>
<s:TextInput text="@{value}"/>
</s:Application>
In the second example the dataprovider is loaded dynamically, which is typical for a data driven application. Now the bounded value is lost:
<?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Script><![CDATA[
private function comboxCreated():void {
values.addItem("A");
values.addItem("B");
values.addItem("C");
]]></fx:Script>
<s:layout>
<s:VerticalLayout/>
</s:layout>
<fx:Declarations>
<fx:String id="value">B</fx:String>
<s:ArrayCollection id="values"/>
</fx:Declarations>
<s:ComboBox id="comboBox" selectedItem="@{value}" dataProvider="{values}" creationComplete="comboxCreated()"/>
<s:TextInput text="@{value}"/>
</s:Application>
Is there any recommended / elegant solution to fix this issue?
Kind RegardsI tried this and it seems to work fine - just moved the setting of the value of "value" to the creationComplete handler:
<?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Script>
<![CDATA[
private function comboxCreated():void {
values.addItem("A");
values.addItem("B");
values.addItem("C");
value="B";
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout/>
</s:layout>
<fx:Declarations>
<s:ArrayCollection id="values"/>
<fx:String id="value"/>
</fx:Declarations>
<s:ComboBox id="comboBox" selectedItem="@{value}" dataProvider="{values}" creationComplete="comboxCreated()"/>
<s:TextInput text="@{value}"/>
</s:Application> -
I'm using a spark combobox in my AdvancedDataGrid, as an itemEditor. At some point I noticed that clicking on the scroll bar arrows would close the CB - very annoying. After much research I found this which completely solved my problems - awesome!
One more and last lingering issue left though: when selecting an item from an open dropdownlist the mouse click seems to propagate to the cell below once the dropdown has closed. I assumed that the fix above would take care of this last issue, but it doesn't seem to. I tried to override the item_mouseDownHandler for the CB and stopImmediatePropagation() of the mouse event post its usual behavior, but that also seems to have no effect. I also tried setting the mouseChildren property for the skin['dropDown'] to false, but that impairs the whole functionality.
Would love any help / suggestions.
thank you all, as always
fI'm not sure. Happy to try this out and post code if it helps debugging the issue, but I'm stuck with an ADG, so switching to DG would not be an option for me.
-
I have an application that populates combobox2 based off of the selection made in combobox1. When a selection in combobox1 is made, I call a function that connects to a database and gets a list of all compatible parts for the selection in combobox1 from the MySQL table. I read the result set into a vector. I then pass the vector to combobox2 and it displays the list. Everything works perfectly.
The columns in MySQL are: sku, manufacturer, speed, cores, fsb, cache, l1,l2, compatible. I am puling out everything but the sku and compatible, and adding them to each row of the vector.
The problem I have is that after the user picks the option they want and it is time to submit the form, I want to get the sku number associated with their selection. Unfortunately, I can't go back to the database, as the manufacturer, speed, cores, fsb, cache, l1 and l2 might match hundreds of records. (I am using the column called "compatible" to determine which records go with which combobox1 selections).
What I can not seem to grasp, is what data structure I need to use to store the sku and the manufacturer/speed/cores/fsb/cache/l1/l2 so that they can be related to one another inside the combobox. I don't want to display the sku to the user, as that is unnecessary information.
There is a way in VB.net to set a value for a selection in the combobox, so that what is selected and what is sent to the system can be different. I don't know if something like that exists in Java. I don't know if something like an ArrayList would be better.I may have just answered my own question. I can still go back to the database and pull the sku based on description, I just have to remember to include a check against the compatible list.(There should never been two rows with the exact same description for the exact same system.) However, that will require me to break out my string. See, when I read the a row into the vector I do:
optionsVector.add(rs.getstring("manufacturer" + "speed" + "cores" + "fsb" + "cache" + "l1" + "l2");
So in reverse I would have to break out the line "Intel, 2.5ghz, 4 cores, 800mhz, 8mb, 512k, 512k" into the original format and then search. Should be easier with the commas as delimiters. Still, seems like there should be an easier way. -
Hi:
I have a popup window of a fixed size which is used through out the application. This popup has a combobox of a set width. But the length of label data in the box is longer than the width so data is always hidden. for example, say my combobox width is set to 250 but the label width in the combobox could sometime be 500. How do I display the full label with a larger width keeping the actual combobox width to 250?
Thanks in advance.
KMThanks a lot Flex HarUI for the quick and relevant reply. Appreciate it.
-
Dear All,
Please let me know the fastest way to populate a combobox with values. Right now I am using the below code to populate the values in the combobox. I have some 1000 records to populate in the combobox. Its taking a lot of time to populate.
Private Sub AddVillagesToCombo(ByRef oCombo As SAPbouiCOM.ComboBox)
Dim RS As SAPbobsCOM.Recordset
Dim Bob As SAPbobsCOM.SBObob
RS = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
Bob = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge)
RS.DoQuery("SELECT T0.[Code], T0.[U_Vilage] FROM [dbo].[@IS_VILLAGE] T0 order by T0.[U_Vilage]")
RS.MoveFirst()
If oCombo.ValidValues.Count > 0 Then
For i As Integer = 1 To oCombo.ValidValues.Count
oCombo.ValidValues.Remove(0, SAPbouiCOM.BoSearchKey.psk_Index)
Next
End If
While RS.EoF = False
oCombo.ValidValues.Add(RS.Fields.Item("U_Vilage").Value, RS.Fields.Item("Code").Value)
RS.MoveNext()
End While
oCombo.ValidValues.Add("Define New", "Define New")
End Sub
Regards,
Noor HussainHi noor,
ZHANGLAN is absolutely correct. There is no good performance solution to load that many records onto a ComboBox.
You can achieve a better solution to the one you have now, if you catch the form load event and insert the values into the XML form:
<item uid="Report" type="113" left="620" ... AffectsFormMode="0">
<AutoManagedAttribute></AutoManagedAttribute>
<specific AffectsFormMode="0" TabOrder="0">
<ValidValues>
<action type="add">
<ValidValue value="1" description="Document"></ValidValue>
<!-- ADD Valid Values here... -->
</action>
</ValidValues>
<databind databound="1" table="" alias="Report"></databind>
</specific>
</item>
But, for the best performance, I suggest you change your control to an EditText with a CFL.
Regards,
Vítor Vieira -
Hi,
I have a combobox in my user defined form.
Its value is getting refreshed normally.
But, if you go to Find mode, and find a record, combo's value is not displayed.
(It is blank)
if you click on the combo, valid value is getting displayed.
Please help me with this!
Thanks in advance!did you apply a dbdatasource to the combobox field?
Regards,
WB -
Strange Combobox selectIndex issue
Hi,
I can't explain why the following code produces these
results:
trace(month_cbx.selectedIndex) // equals 4
month_cbx.selectedIndex = month_cbx.selectedIndex-1;
trace(month_cbx.selectedIndex); // STILL EQUALS 4!?
Can anyone tell me why this is happening?
Thanks for any help,
~Oni.*Bump*
I still can't work it out?? -
I ran across a bug using the combobox change event listener
with an Alert.show call.
The movie runs into a recursive loop that is caught and stops
the movie.
1) add a combobox to the stage and name it 'combobox' - add
two labels using the parameters tab
2) drag an alert instance from the component panel to the
library
3) add the code below to your root timeline
4) compile
5) now change the value of the combobox
I think for some reason, the Alert popup conflicts with
Focus. This possibly triggers the change event listener, causing a
recursive loop with no sentinel.
Has anyone else run into this or does anyone know how to work
around it??Hi MikeDoh,
you need to use one more listener for using alert. combobox
onEnterframe causing error when we select any data.
have a look attached code. -
Issue in Combobox flex 3.5
Hello all,
I got a serious issue in combobox while using flex sdk 3.5.
The issue is if we filter the collection before creation complete of component and use that filtered collection as a dataprovider for combobox.
If the result from the filtered collection is a blank collection then that combobox is still pouplated from the first value from the source of collection. However the actual result should be null in the selected item of comboBox.
Giving you the sample test code to reproduce the issue.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*"
initialize="onInitialize()" >
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var dp:ArrayCollection = new ArrayCollection(['t1','t2','t3']);
private function filterFunction(inData:Object):Boolean
return false;
private function onInitialize():void
dp.filterFunction=filterFunction;
dp.refresh()
]]>
</mx:Script>
<mx:ComboBox id="cb" dataProvider="{dp}" x="66" y="31"/>
<mx:Button label="Refresh DP" x="102" y="92" click="dp.refresh()"/>
</mx:Application>
However it is corrected after refreshing the dataprovider after creation complete. But I don't want to refresh it everywhere thoughout my application.
Please, provide your comments on this.
Thanks
Vikash KumarHi Vikash Kumar,
Just put the initialize event on ComboBox itself instead of Application tag....as shown below...
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*"
>
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var dp:ArrayCollection = new ArrayCollection(['t1','t2','t3']);
private function filterFunction(inData:Object):Boolean
return false;
private function onInitialize():void
dp.filterFunction=filterFunction;
dp.refresh()
]]>
</mx:Script>
<mx:ComboBox id="cb" dataProvider="{dp}" x="66" y="31" initialize="onInitialize()"/>
<mx:Button label="Refresh DP" x="102" y="92" click="dp.refresh()"/>
</mx:Application>
Thanks,
Bhasker -
Issue with combobox : value never change
Hello,
I have made a VI for control a motor.
There is my subVI
I have create a VI with a combobox to control the motor with 3 commands.
Each command send a string who the motor understand.
My issue is when i choose a command, in my subVI that doesnt change.
What i have to do to make my VI working with the combobox ?
Thanks for your help.1) Put a delay in your loop - you are hammering the serial port and wasting CPU.
2) If you wire your combo box into the VI as shown, it can change only at the startup of the loop, because once it starts looping, it has to finish.
Try running it as one VI rather than a sub-VI and you should see what I mean.
You need a parallel process in order to control the combo box. In other words, you need a parallel loop architecture.
Message Edited by Broken Arrow on 06-08-2010 09:56 AM
Richard -
ComboBox issue w/ imported swf assets
I've imported a swf into my actionscript code which contains a combobox (instance name of "cb"). I'm having an issue with not being able to set the "prompt" property from within the code and also with the first item in the combobox always remaining blank.
When I compile my project withing FlashDevelop, the combobox populates all the items properly, but always leaves the first item (item 0) blank. When I try to assign the "prompt" property to a string, it has no effect - the first item always remains blank. When choosing different items in the combobox, the chosen item does not appear in the combobox for the user to see she has chosen it - it just remains blank.
**PLEASE help**
Here is the condensed code:
[Embed(source = "../../../../flash/as3/video_player.swf")]
private var VideoPlayerAssets:Class;
_xVideoAssetsLoader = new EmbeddedAssetSwfLoader(VideoPlayerAssets);
_xVideoAssetsLoader.addEventListener(EmbeddedAssetSwfLoader.EMBEDDED_ASSET_LOADED, videoAssetsLoaded); _xVideoAssetsLoader.loadAssetSwf();
_xVideoControlsSymbol = _xVideoAssetsLoader.getSymbolInstance("VideoControlsHome");
_xVideoControlsSymbol.embedWindow.content.cb.prompt = "Choose a Size"; //THIS HAS NO EFFECT
_xVideoControlsSymbol.embedWindow.content.cb.addItem( { label: "400 x 320", width:400, height:320, data:"400x320" } );
_xVideoControlsSymbol.embedWindow.content.cb.addItem( { label: "480 x 384", width:480, height:384, data:"480x384" } );
_xVideoControlsSymbol.embedWindow.content.cb.addItem( { label: "560 x 448", width:560, height:448, data:"560x448" } );
_xVideoControlsSymbol.embedWindow.content.cb.addItem( { label: "640 x 512", width:640, height:512, data:"640x512" } );
_xVideoControlsSymbol.embedWindow.content.cb.addEventListener(Event.CHANGE, sizeSelected);Unbelievable...
So after two days of trying shorter animations, pouring over countless amounts of code, sifting through result after result of google searches, it all came down to a 2-second delay.
When I imported the .swf into Catalyst, I set the delay to 2 seconds before playing the animation. I uploaded it to the test server, and the freezing went away. I tried several other swf files, and they all played perfectly! Granted, there's a tiny delay before the animation plays, but its better than having it play right off the bat then watching it hang.
Is this a caching or buffering issue? I would think that, when the Catalyst swf loads, it would start pre-loading the animations before it played (unless if there's a way to do that on the original .swf, but I'm not that versed in AS3 to figure it out). That may be a feature worth having in future Catalyst versions.
So, for anyone experiencing an issue where their animations hang (i.e.: an imported banner): when you import it into Catalyst and set it to play, place a 1 or 2 second delay on it before it starts playback. That should give it time to load up. -
Revision: 12982
Revision: 12982
Author: [email protected]
Date: 2009-12-15 20:44:23 -0800 (Tue, 15 Dec 2009)
Log Message:
Fix for issue with exposing accessible names for combobox list items
QE notes: none
Doc notes: none
Bugs: n/a
Reviewer: Gordon
Tests run: checkintests
Is noteworthy for integration: no
Modified Paths:
flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/ComboBoxAccImpl.as
flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/ListBaseAccImpl.asAdd this to the end of your nav p CSS selector at Line 209 of your HTML file, after 'background-repeat...':
margin-bottom: -2px;
Your nav p will then look like this:
nav p {
font-size: 90%;
font-weight: bold;
color: #FFC;
background-color: #090;
text-align: right;
padding-top: 5px;
padding-right: 20px;
padding-bottom: 5px;
border-bottom-width: 2px;
border-bottom-style: solid;
border-bottom-color: #060;
background-image: url(images/background.png);
background-repeat: repeat-x;
margin-bottom: -2px; -
So I am sure Jonathan groans when he sees my name pop up, but I found another ComboBox issue and I am looking for help finding a workaround.
(I opened a JIRA - http://javafx-jira.kenai.com/browse/RT-27654)
Seems that calling clearSelecion() on a ComboBox disallows selecting the same item that was selected when the clearSelection() was called. In my sample code, if you
1) select 'a' - 'a' displays
2) click reset button - 'a' disappears
3) select 'a' - 'a' does NOT appear and it should
The issue is major when the combobox only has a singe item
package javafxapplication2;
import java.net.URL;
import java.util.ArrayList;
import java.util.ResourceBundle;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.ComboBox;
* @author user
public class SampleController implements Initializable {
@FXML
private ComboBox<MyObject> cb;
private ObservableList<MyObject> myList = FXCollections.observableList(new ArrayList<MyObject>());
@FXML
private void handleButtonAction(ActionEvent event) {
cb.getSelectionModel().clearSelection();
@Override
public void initialize(URL url, ResourceBundle rb) {
MyObject a = new MyObject("a", "A");
MyObject b = new MyObject("b", "B");
MyObject c = new MyObject("c", "C");
myList.add(a);
myList.add(b);
myList.add(c);
cb.setItems(myList);
class MyObject {
String key;
String Value;
public MyObject(String key, String Value) {
this.key = key;
this.Value = Value;
@Override
public String toString() {
return key;
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.collections.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane id="AnchorPane" prefHeight="200.0" prefWidth="320.0" xmlns:fx="http://javafx.com/fxml" fx:controller="javafxapplication2.SampleController">
<children>
<ComboBox fx:id="cb" layoutX="82.0" layoutY="78.0" prefWidth="160.0">
<items>
</items>
</ComboBox>
<Button onAction="#handleButtonAction" layoutX="130.0" layoutY="137.0" mnemonicParsing="false" text="Reset" />
</children>
</AnchorPane>Hi. Here is a workaround.
//Modified initialize method. Added a null object to the list:
@Override
public void initialize(URL url, ResourceBundle rb) {
MyObject a = new MyObject("a", "A");
MyObject b = new MyObject("b", "B");
MyObject c = new MyObject("c", "C");
myList.add(a);
myList.add(b);
myList.add(c);
myList.add(null);
cb.setItems(myList);
Modified handleButtonAction(ActionEvent event) method:
private void handleButtonAction(ActionEvent event) {
cb.getSelectionModel().selectLast();
cb.getSelectionModel().clearSelection();
}
Maybe you are looking for
-
External Number Range in SD Document
Hi, I have created a external number range for SD documents & also updated the same in Std order type OR. But when I create any sales order system is not picking the no. from this Ext. No. Range Grp. Plz help me out in thie matter. Regards, Mahavir
-
Can't remove bluetooth device in file explorer.
I had an LG LS970 Phone paired with my windows 8.1 HP touchsmart PC. After I uninstalled the phone under bluetooth devices, it keeps showing up on my File Explorer. When I double click on it, an FTP No Response dialog box pops up. When i right click
-
Opening files from BR in PS CC-2014
I want to open files in Br in PS CC-2014 automatically. I don't know how to access preferences and make the change. I need step by step directions. Currently the files open in Acrobat. Thanks.
-
Losing Events, Places, Faces and other problems in iPhoto
Bought the new iMac in January; carefully transferred photos from old G4 and took ages updating the details using the great events/places/faces etc facility. Recently 2 things happened - I bought a new camera (Nikon D500); imported and updated event/
-
Question about AMF format archives
Hi everybody. I need help with archives with format amf. My Knowledge on the subject is too poor and I would like more about it. How could I create this kind of archives and it is posible convert the archives in to a txt archives?? Please any help...