Combo Box Selected Data
I have a combo box called class_cb, I am trying to use the
combo box in a maths formula.
I am trying to set that if the active selected combo box data
= 1 then a text area = given number, if data = 2 then ....
I can get flash to recognise the change i just can't seem to
get the statement
"if selected combo box data = 1 then text area = 5" to work,
the text area defaults to the first value and changing the
combo box item and pressing calculate doesn't change the
value of the text box.
Any help would be appreciated, thanks
// COMBO BOX
// Add Items to List.
class_cb.addItem({data:1, label:"Normal"});
class_cb.addItem({data:2, label:"Free"});
class_cb.addItem({data:3, label:"Close & Interference"});
// Update Upon Change Listener Object
// Create Listener Object.
var cbListener:Object = new Object();
// Assign function to Listener Object.
cbListener.change = function(event_obj:Object) {
trace("Value changed to:
"+event_obj.target.selectedItem.data);
// Add Listener.
class_cb.addEventListener("change", cbListener);
// CALCULATE
shaft_ta.text = "nul";
//On calculate_btn release
//Math functions
calculate_btn.onRelease = function(){
//If combo box = data no. then change label
if (class_cb.selectedItem.data = 1) {
shaft_ta.text = "6";
} else {
if (class_cb.target.selectedItem.data = 2){
shaft_ta.text = "7";
} else {
if (class_cb.selectedItem.data = 3){
shaft_ta.text = "9";
}
can any one help?, I have tried many different things and
still can't get it to work.
Similar Messages
-
Combo box selected index is not working.
Hi guys, I have a problem with changing the combo box selected index.
I load a list of phone types(such as "Home","Office",...) using Remote Object and assign it as a data provider for a combo box.What I need is to select a specific index in the combo but combo.selectedIndex statement doesn't work for the first time, I mean the combo changes its index only if I load the view again.
I checked different examples, solutions but none of them worked for me!! Can anyone here help me to figure out the problem?
Here is my Code:
<mx:Canvas creationComplete="init()"
xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:ComboBox id="comboPhone0"
prompt="Type"
dataProvider="{phoneTypeList}"
/>
<mx:Script>
<![CDATA[
[Bindable]
private var phoneTypeList:ArrayCollection;
private function init():void
loadPhoneType();
private function loadPhoneType():void
phoneTypeLoaderService.getPhoneType(); //phoneTypeLoaderService is a remote Object to load the phone types
private function handlephoneTypeLoadResult(ev:ResultEvent):void
phoneTypeList=ev.result as ArrayCollection;
comboPhone.selectedIndex = getComboSelectedIndex("HOME");
private function getComboSelectedIndex(phoneType:String):int
var index : int= -1;
var result : int= -1;
for each (var pt:PhoneType in phoneTypeList)
if (pt.type == phoneType)
result = index;
break;
else{
index++;
return result;
]]>
</mx:Script>
</mx:Canvas>hi
I think in getComboSelectedIndex() method index should initialized to zero. If that does not work use after assigning the data from result event.
phoneTypeList.refresh();
Hope this helps
Rush-me -
Access 2010 - How to display data from a table into a text box upon combo box selection?
Hi
I have a a table with 5 columns: month, year, USD, SGD, BAHT.
I created a form with a combo box for selection of the month and year, and I would like to set adjacent text boxes to show USD, SGD, BAHT information. How can i go about doing that?
From the Q&A here, most of them uses the function similar to this "=[Combo0].[Column](1)" to show the data in the text box, but this would require the combo box to list a whole bunch of details if i were to add in more currency values to the
table. Is it possible to not show this information in the combo box, but still populate data in the textboxes base on a selection on only the "month" and "year" in the combo box.Hi,
According to your description, my understanding is that you want to show only the month/year in the combo box, we can choose the date, and it will display the value of USD/SGD/BAHT based on the month/year.
If it is, I recommend you try the steps:
Create a form based on your data source table>Add the combo box>combo box wizard>Find a record on my form based on the value I selected my combo box>Add mouth and year to selected fields
http://office.microsoft.com/en-us/access-help/create-a-list-of-choices-by-using-a-list-box-or-combo-box-HA010113052.aspx
If I misunderstand something, please let me know. We may upload some screenshots or a sample through OneDrive.
Regards,
George Zhao
TechNet Community Support -
Change combo box selection dynamically?
I would like to have a combo box change its selection dynamically according to what is selected in another selector. As far as I can tell from reading the Help, this feature is available for List Boxes, List Views and List Builders only ("The Dynamic Selected Item functionality is available in list-based selectors") and based on the wording I assume that it is currently unavailable for other components. Is this true? If so I would like to formally request that other selectors - particularly combo boxes - be included.
The use case for me is this: After the user has already inputted information and digested some of the output, they eventually reach a section of the project that appears only under certain conditions. This area is about 800 pixels to the right of the original combo box in the inputs area, and so in order to quickly change that selection they would have to go look for the original selector, which could easily discourage them from browsing that particular selection. Hopefully this makes sense.
It would also be great to hear back that this kind of feature request can actually be made in this way. I've submitted a few similar requests in the past and did not see an acknowledgment, and so I am still unclear as to whether or not feature requests are even possible.
(Edit: I thought about creating duplicate overlapping instances of the combo boxes in question and, using dynamic visibility, control which appears according to the current selection. But this is only suitable for smaller lists).>
Alan McClean wrote:
> To get around it I shuffled my selection list dynamically, so that the one I wanted appeared at the correct place. I did this using the source data component and some Excel logic. However, it is buggy and a lot of work.
Thanks, Alan. I am currently working on a similar solution. Seems to be the best for my situation, but it is far from elegant.
>
Charles Davies wrote:
> Just a thought, would the Filter component work for you?
The Filter component requires that the underlying Excel data be structured in a pretty specific way. As far as I can tell, I would probably have to rip apart my XLS and redesign it in order to make use of that component. Perhaps in a future generation I'll give it a go, but I've already gone through too many redesigns this time around. -
Combo box select default value.
Hi,
I am using Combo box to display the status of the document.
my code is
oForm = SBO_Application.Forms.Item("I8_BGU_")
Dim oCombo1 As SAPbouiCOM.ComboBox
oForm.DataSources.UserDataSources.Add("ComboSrc5", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1)
'oItem = oForm.Items.Item("21") ''for accessing the combo box item
oCombo1 = oForm.Items.Item("21").Specific
'' to bind the combo box item to defined user data source
oCombo1.DataBind.SetBound(True, "", "ComboSrc5")
''giving some static values to combobox
oCombo1.ValidValues.Add("Open", "Open")
oCombo1.ValidValues.Add("Closed", "Closed")
oCombo1.ValidValues.Add("Extended", "Extended")
' oCombo.Select("Open")
oCombo1.Select("Open", SAPbouiCOM.BoSearchKey.psk_ByValue)
oForm.Items.Item("21").Specific.DataBInd.SetBound(True, "@I8_BGU", "U_STATUS")
oCombo1.Select("Open")
In this code when it reaches last lineof line it is throwing error.
Object refertence not set to any instance..
some time it is throwing
error,,
" Unble to cast COM object sbouiCom.itemeventClas to Interface Type IItemevent. This application Cal is failed.
The same logic working form for another form..
Is there any modification needed.
Please.. get to me..
mahi.Hi Mahendra,
In case of selecting a default value in a combo, it has 2 parameters to be passed. Its as below.
objCombo.Select(0, SAPbouiCOM.BoSearchKey.psk_Index)
Replace this with proper value (1st parameter). It will work.
I find that you have already used that line. So you can remove your last line.
Best Regards,
satish. B.
Edited by: satish b on Jan 12, 2010 8:35 AM -
Changing xy graph scale using combo box selection
Hello,
I have a xy graph with x scale set to 10k and y scale set to 6 by default.
I have a combo box which i use to select what the graph will display. For example in combo box i have 3 choices, A, B, C.
If i select A, xy scale is set to 10k and 6. If i select B, xy scale is set to 2.5k and 8, if i select C, xy scale is set to 4k and 10 respectively. Is there some functions that i can use to do this?
Thanks.
Solved!
Go to Solution.Like this (attached)?
Of course, if the data actually follows these mins and maxes, you could just turn on auto scaling and it would do it automatically
Tim Elsey
LabVIEW 2010, 2012
Certified LabVIEW Architect
Attachments:
Untitled 1.vi 14 KB -
Combo Box Selection Issue in SBO 2007
Hello.
Here is one issue which I am facing now.
I have just installed the 2007 Version of SBO in my machine. And using VB.Net.
When I tried to retrieve the <i>Selected.Value</i> from a ComboBox, it is returning a wrong value.
The real problem is this.
Suppose there is two ValidValues in the Combo box
1. <b>aaa</b>
2. <b>bbb</b>
and suppose we manually selected the value '<b>aaa</b>' in it.
Then the combobox will show '<b>aaa</b>' as selected value.
When we try to return it using the <i>Selected.Value</i> property, it returns <b>aaa</b>.
then I tried to select '<b>bbb</b>' using a code which is here
<i>oCombo.Select("bbb",SAPBouicom.BoSearchKey.psk_ByValue)</i>
Now the combobox will show '<b>bbb</b>' as selected value. But,
When we try to return it using <i>Selected.Value</i> property, It still returns <b>aaa</b>.
If we select <b>bbb</b> manually, it will return <b>bbb</b>.
IT ALWAYS RETURNS THE LAST MANUALLY SELECTED VALUE.
here is the original Code which I tried in my application.
<i>cboCategory.Select(CWRptMaint.ReportCategory, SAPbouiCOM.BoSearchKey.psk_ByValue)
Dim s As String = cboCategory.Selected.Value
Dim t As String = cboCategory.Selected.Description
</i>
Please Help me to solve this issue.
Thank you
AnoopHI
I never had a problem about combobox not using datasource
But here's the example code about combobox using datasource and not using datasource that i'm taken from one of my friend's project (VB6)
'================================================================
Public Type objectReportBA
oComboBox As SAPbouiCOM.ComboBox
oComboBox2 As SAPbouiCOM.ComboBox
oUserDataSource As SAPbouiCOM.UserDataSource
End Type
Public oRBA As objectReportBA
'==================================================================
'// example Adding a Combo Box item not using user data source
Set oItem = oFormReportBA.Items.Add("RCB1", it_COMBO_BOX)
oItem.Left = 70
oItem.Width = 85
oItem.Top = 4
oItem.Height = 18
oItem.DisplayDesc = True
Set oRBA.oComboBox = oItem.Specific
oRBA.oComboBox.ValidValues.Add "1", "aaa"
oRBA.oComboBox.ValidValues.Add "2", "bbb"
oRBA.oComboBox.Select "bbb", psk_ByValue
SBO_Application.MessageBox "Combo1->" & oRBA.oComboBox.Selected.Value '<<<< will get a value = 2
SBO_Application.MessageBox "Combo1->" & oRBA.oComboBox.Selected.Description '<<<< will get a description = bbb
'==================================================================
'// example Adding another Combo Box item and using datasource
Set oItem = oFormReportBA.Items.Add("RCB2", it_COMBO_BOX)
oItem.Left = 157
oItem.Width = 163
oItem.Top = 24
oItem.Height = 14
oItem.DisplayDesc = True
Set oRBA.oComboBox2 = oItem.Specific
oRBA.oComboBox2.ValidValues.Add "1", "aaa"
oRBA.oComboBox2.ValidValues.Add "2", "bbb"
oFormReportBA.DataSources.UserDataSources.Add "CombSource", dt_LONG_TEXT, 30
oRBA.oComboBox2.DataBind.SetBound True, "", "CombSource"
Set oRBA.oUserDataSource = oFormReportBA.DataSources.UserDataSources.Item("CombSource")
oRBA.oUserDataSource.Value = "bbb"
SBO_Application.MessageBox "Combo2->" & oRBA.oUserDataSource.Value '<<< will get a value = bbb (but u will get diferent value if u click the combobox manually)
'======================================================================
'if you click the combobox manually using itemEvent
Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, pVal As SAPbouiCOM.IItemEvent, BubbleEvent As Boolean)
Select Case pVal.ItemUID
Case "RCB1": '//combobox object not using datasource
If pVal.EventType = et_COMBO_SELECT Then
If pVal.BeforeAction = False Then
SBO_Application.MessageBox "combo1->" & oRBA.oComboBox.Selected.Description '<<<< will get a description = aaa or bbb
End If
End If
Case "RCB2": '//Combobox object that using datasource
If pVal.EventType = et_COMBO_SELECT Then
If pVal.BeforeAction = False Then
SBO_Application.MessageBox "combo2->" & oRBA.oUserDataSource.Value '<<<< will get a descriptian = 1 or 2
SBO_Application.MessageBox "combo2->" & oRBA.oComboBox2.Selected.Description '<<<< will get a description = aaa or bbb
End If
End If
end select
end sub
'===============================================================
Hopefully this will Help You Anoop
Regards
Ancumen -
Show text box from one combo box selection
Total newb here and need help. I tried searching for a javascript to copy/paste, but without any luck. I am using Acrobat Pro 9.2.0. If you could help me out with the javascript or with directions on how to make the following be accomplished, I would be greatly appreciative.
I am creating a fillable PDF and currently have a combo box that is labeled "Internship Satisfied By" with the options of "TCoB PDP", "MRKTNG 4185", and "Other College". I would like a hidden text box (where the end user can fill in to explain) to become visible only when the end user selects the "Other College" option, but stay hidden for the other selections. The hidden text box is labeled "Internship Explained".
Thanks in advance! JarrodUse this code as the combo box's validation script:
if (event.value == "Other College") {
getField("Internship Explained").display = display.visible;
} else {
getField("Internship Explained").display = display.hidden; -
Control the combo box select of COPY FROM in Delivery Order
Dear all
I have a requirement where in the user wants to restrict the "copy from" button on the delivery order. They want the delivery orders to be created only from Sales orders.
So that would mean that i do a bubbleevent = false when any other row is selected in the combo box dropdown. But I am not able to get the control to the combobox.
In the system information it says that the form is "-9876", but couldnt catch any event on it either.
Any suggestions to control the selection of the "COPY FROM" combobox is most welcome.
Thanks in advance
RashmiHi Use This Ihave Checked This
If pVal.Before_Action Then
If pVal.FormType = 140 And pVal.EventType = SAPbouiCOM.BoEventTypes.et_COMBO_SELECT And Not pVal.InnerEvent Then
If pVal.ItemUID = "10000330" Then
If pVal.PopUpIndicator = "2" Then
objAddOn.objApplication.SetStatusBarMessage("You Can Not Copy From Returns")
BubbleEvent = False
Exit Sub
ElseIf pVal.PopUpIndicator = "0" Then
objAddOn.objApplication.SetStatusBarMessage("You Can Not Copy From Sales Quotations")
BubbleEvent = False
Exit Sub
End If
End If
End If
End If
Mohamed Zubair -
A text box should appear based on combo box selection in a jsp page.
Hi,
I have this problem. I ahve an option in the combo box"other". If other is selected then a text box shud appear . Can any one post a quick answer for me. may be a sample of how to do it will help me a lot.
Thank You,
Sagar.Hi Guys,
Thnx all for ur replies. Let me explain u the scenario which i work in now. I have a combo box with 4 values "other " being the last of them. If i select "other" then a text box shud appear with the label. what happenes now is i have added onChange whn an option is changed . I have named that functiion refresh for which the code goes like this..
function refresh()
window.location.reload(true);
whn i select an other option thn the whole page gets refreshed and the first value only appears. If i select other then the page refreshes and gets back again to the first value. These guys here use tags like <c: if> <C;choose> <c: otherwise> which am not familiar with. Do pls help me in retaining the option selected.. Thank You. -
Adobe Acrobat 9: Javascript array populated combo box - Selected answer will not save
I have a combo box on one of my forms that is populated using a Javascript array. The combo box is populating just fine, but when an item is selected from that combo box, the selected item does not save when the user saves the document. Any suggestions as to what the problem is and how it can be corrected? I am a loss as to where to even begin looking. Any help is greatly appreciated.
Thank you.
LisaYou might also want to check the Scripting forum
http://forums.adobe.com/community/acrobat/acrobat_scripting -
Combo Box Selection to Change Selection in another Combo Box
I'm pretty familiar with excel and VBA, but when it comes to Adobe Acrobat, I am lost with Javascript.
I am creating a form.
My first field is a combo box named: Rent.booth
My second field is also a combo box named: County.booth
I need to know where and how I would implement a java command that states that if Rent.booth = Rent, then County.booth automatically = No.
If No is selected for Rent.booth, then allow the user to choose any of the 3 values.
Combo Box Options for Rent.booth:
Select One
Rent
No
Combo Box Options for County.booth:
Select One
Yes
No
Any leads would be appreciated. So far I've only seen the Combo Box to Text box solutions, nothing for Combo box to Combo Box.You'll get the best help with Javascript in the Acrobat Scripting forum.
-
For example:
Combo box choices:
apple
tomato
squash
Pumpkin
The text box depending on the selection above would state the color:
Green (if Apple was chosen from the combo box
Red (if Tomato was chosen from the combo box
Yellow (if Squash was chosen from the combo box
Orange (if Pumpkin was chosen from the combo box
I am very new at this and have spent hours looking for an answer. Thank to anyone in advance who can help!Place each value as the export value of the options in the combo-box and then use this code as the text field's custom calculation script:
event.value = this.getField("ComboBox Name").value; -
Layer/OCG Visibility based on Combo Box Selection
Hello,
I'm VERY new to javascript, so please bear with me. I have a combo box with multiple selections. For some selections, I would like a separate OCG layer to appear, and with other selections that same layer to disappear.
For example:
ComboBox1: A, B, C
Layer 1 default: hidden
A - toggle layer 1: hidden
B - toggle layer 2: hidden
C - toggle layer 3: visible
I have seen the javascripting involved turning layers on/off with buttons, but I'm having some difficultly with the combo box.
Thanks!
MikeThe code would be much the same as with buttons. Use the Validate event of the combo box to get the selected value (event.value) and show/hide the appropriate OCGs. If the combo box items have export values, you'd use the Keystroke event so you can get the export value of the selected item via the event.changeEx property: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.607.html
-
Display Record Based on Combo Box Selection
Hi
Using Flash Builder 4.6.
I have a combo box that lists names stored in a mysql database. Once the user selects a name from the combo box, I would like to have the complete record display on a form. Can you please point me in the right direction to accomplish this task?
ThanksHi
Using Flash Builder 4.6.
I have a combo box that lists names stored in a mysql database. Once the user selects a name from the combo box, I would like to have the complete record display on a form. Can you please point me in the right direction to accomplish this task?
Thanks
Maybe you are looking for
-
Trouble renaming files after a 'small' import error
I mostly photograph people and I name my files with the convention: date-person-photo number. I'm using LR3.3 at the moment. I recently did 2 shoots in quick succession and made the mistake of naming the second set of photos with the name of the per
-
What do I need to implement to recognize a "return" in a JTextArea?
When the user presses the return key, I wish to trigger an event, but I don't know what to implement to do that (I can't get ActionListener to work, and KeyListener covers all the keys and I just want to listen for the return key) Thanks
-
Hi everyone Im configuring an ISE demo, version 1.1.1.268, using the trial license included (100 base + 100 advanced). The ISE is installed on a Vmware ESXi host. The ISE image was downloaded directly from Cisco website. I am configuring posture for
-
Columns Switching Position when Moving Between Mailboxes
I organize my mail with the "From" column first. I have done so since I first began using Mail. I find and recognize e-mail by sender. Lately whenever I switch to a mailbox that does not have the From column (or in which I do not need to see the From
-
Is there a way to get a drop down field in a muse form? (Not using a third party like jot or Wufoo) if not then it needs to be a priority for the developers (also radio buttons) as whay should we have to use third party form generators !! Thanx