Combobox with dynamic dataProvider
I have a very simple code:
private function showAvailableLabels(resultXML:XML, param:Object):void
if (resultXML.children().length() == 0)
Alert.show("Sku " + sku.text + " not found!", "Error");
else
labels.dataProvider = "";
labels.dataProvider = resultXML.availablelabels;
labels.validateNow();
labels.setFocus();
labels.selectedIndex = 0;
That code assigns different dataProvider to a combobox at the run time. I cannot get the exact pattern, but after a few times the combobox starts showing data from a previous data assignment. Do I have to refresh it somehow?
Thanks
Here is a runnable demo I have put together using provided code:
<?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" creationComplete="switchDataProvider()"
xmlns:mx="library://ns.adobe.com/flex/halo"
minWidth="1024" minHeight="768">
<fx:Script>
<![CDATA[
private var model_1:XML = <VFPData>
<availablelabels>
<filename>193</filename>
<id>10</id>
</availablelabels>
</VFPData>
private var model_2:XML = <VFPData>
<availablelabels>
<filename>192</filename>
<id>9</id>
</availablelabels>
<availablelabels>
<filename>160down</filename>
<id>25</id>
</availablelabels>
</VFPData>
private var current:XML = model_1;
private function switchDataProvider():void
current = current==model_1?model_2:model_1;
comboBox.dataProvider = current.availablelabels;
]]>
</fx:Script>
<mx:VBox>
<mx:ComboBox id="comboBox" labelField="filename"/>
<mx:Spacer height="10"/>
<s:Button click="switchDataProvider()" label="Switch"/>
</mx:VBox>
</s:Application>
Click on the push button and check the content of the combo, you should 192 from previous data.
Similar Messages
-
DataGrid scroll positions resetting with dynamic dataprovider
Hi - I have a DataGrid that is backed by an ArrayCollection
that is fairly dynamic. Before doing my updates, i disable
autoupdating, and though my size is typically fixed at 100 items,
sometimes those items will be replaced. My problem is that a user
who has scrolled down the visible grid, will lose their scroll
position when i replace items. If i'm just doing updates on the
existing objects, it's fine, but the replace is causing the scrolls
(both horizontal and vertical) to reset. I've tried to isolate
where this is happening (whether set verticalScrollPosition or on
the bookmark) and i can't quite find it.
Anyone know how i can prevent this behavior? I've tried
capturing the scoll position before i begin my updates, and then
setting it back when finished, but it doesn't work.
Thanks.
./paulActually, I spoke too soon. I had a number of things I was
trying. And when i tried to clean up the other things that I
believed were extraneous (including an override of
makeColumnsAndRows), the vertical scroll resetting stopped working.
I've spent about 90 minutes trying to get back to where I was (wish
the builder was in IntelliJ!).
When it was working, I also tried to add horizontal scroll
capturing, and that didn't seem work either. I have 34 columns, the
first one is locked. When I captured my position, I saw it was 11.
Then i performed the update, and callLater my resetScroll position.
The first column i saw after the locked column is correct. However,
the scroll bar itself is fully left. On the next update I captured
a horizontal scroll of zero.
./paul -
Populating dynamic values in the combobox with XML form Builder.
I am trying to populate dynamic value in the combobox with xml form builder. I see the document saying create property group and document property Id with respecitive values. I am able to create the property group with system admin -> System config
-> KM -> CM -> Global services -> property Metadata -> groups with new button. and I am trying to create document property Id with value. I am not able to find the way to give value in the property. I am using EP 7.0 Sp 14. Please let me know how to sovel itHi
You can create new property metadata with System Admin > System Config > KM > CM > Global services > Property Metadata > Properties > New. Specify the values for this metadata as the ones you need to have in the combo box. Use allowed values parameter of the matadata to sepcify the values. Each metadata property will have unique property ID and you can map this property ID to your combo box in xml forms.
Give it a try.
Regards,
Yoga -
Populating mx:ComboBox with database info
Ok, so I set out on a quest to populate <mx:ComboBox with
info from a database using Flex and Ruby on Rails. I had a really
hard time finding tutorials about this subject, but using
information from a large set of tutorials and tweaking the code
over and over, I finally figured out something that works.
My model is sourcer
My controller is sourcers and contains the followign code:
class SourcersController < ApplicationController
def create
@sourcer = Sourcer.new(params[:sourcer])
@sourcer.save
render :xml => @sourcer.to_xml
end
def list
@sourcer = Sourcer.find :all
render :xml => @sourcer.to_xml
end
def update
@sourcer = Sourcer.find(params[:id])
@sourcer.update_attributes(params[:sourcer])
render :xml => @sourcer.to_xml
end
def delete
@sourcer = Sourcer.find(params[:id])
@sourcer.destroy
render :xml => @sourcer.to_xml
end
end
My migration file had this code:
class CreateSourcers < ActiveRecord::Migration
def self.up
create_table :sourcers do |t|
t.column :sourcername, :string
t.timestamps
end
end
def self.down
drop_table :sourcers
end
end
and finally the application code contained:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" >
<mx:HTTPService id="listSourcers" url="
http://localhost/sourcers/list"
useProxy="false" method="GET"/>
<mx:VDividedBox x="0" y="0" height="100%"
width="100%">
<mx:Panel width="100%" height="300" layout="vertical"
title="Create/Update Denial Reasons">
<mx:Form>
<mx:FormItem>
<mx:ComboBox
dataProvider="{listSourcers.lastResult.sourcers.sourcer}"
labelField="sourcername"
creationComplete="listSourcers.send()"/>
</mx:FormItem>
</mx:Form>
</mx:Panel>
</mx:VDividedBox>
Now this can be condensed to the following important items:
<mx:HTTPService id="listSourcers" url="
http://localhost/sourcers/list"
useProxy="false" method="GET"/>
<mx:ComboBox
dataProvider="{listSourcers.lastResult.sourcers.sourcer}"
labelField="sourcername"
creationComplete="listSourcers.send()"/>
Things to note -
- if you leave out the labelField="sourcername" in the
<mx:ComboBox> tag you will "object: Object" in the dropdown
after compile.
- if you leave out the
creationComplete="listSourcers.send()" in the <mx:ComboBox>
you will get a dropdown that is blank, but is sized correctly. Also
something to note on this line is it can be included in the
<mx:Application> tag but then if you have multiple ComboBoxes
you're going to need it in each of the <mx:ComboBox> tags.
Anyway, I hope this helps someone.Hi,
Try logic similar to this instead:
listOfIds as String[]
for each element in
SELECT prsnombre
FROM nameOfYourTable
WHERE prsrut = 12486023
do
listOfIds[] = element.prsnombre
end
return listOfIdsThis logic assumes that "prsnombre" is the name of the attribute you want returned, "nameOfYourTable" is the table's name and "prsrut" is the attribute with one or more rows in the table that has the value 12486023.
The underscore characters in tables and columns are a bit wacky unless you are using something called Dynamic SQL. The above statement does not use Dynamic SQL and note that I did not include them in the logic. Not sure if this is your problem, but try it without the underscore characters if your logic uses the JDBC SQL syntax shown above.
Hope this helps,
Dan -
Loading a combobox with data from a different domain
I have filled in a combobox with values from an .asp page and
have used it
successfully. The problem is that if the flash file is ran
from a different
domain from the load location, the combobox doesn't get
filled in (as
apposed to the error if I ran it off of my drive).
datafeed.asp spits out the appropriate stuff for the AddItems
function to
read correctly. (as I has said, it does work). The combobox
gets filled in
the development environment (Macromedia Flash MX Professional
2004) as well
as flash player.
But when I upload it to one of my other websites, the data is
never
retrieved. Even though that the webserver containing the data
feed, the
webserver hosting the flash file and my machine can all read
datafeed.asp.
Am I missing a setting that allows a flash file to read data
from another
domain?
The following code has been changed for security reasons. But
believe me it
works in its original format.
myData = new LoadVars();
myData.onLoad = AddItems;
myData.load("
http://www.mydomain.com/datafeed.asp")
function AddItems() {
for (i=0; i<numItems; i++) {
var ProductID = eval("myData.ProductID"+i);
var ProductName = eval("myData.ProductName"+i);
var ProductSale = eval("myData.ProductSale"+i);
var DataProvider = { productid
roductID, productsale
roductSale };
_root.application.chooseproducts.prodlist_cb.addItem(ProductName,
DataProvider);
Thank You,
Juliannot sure, but this might be what you need...
//allow loading of files from domain
System.security.allowDomain("
http://www.mydomain.com"); -
How to add ComboBox to dynamically created DataGridColumn ?
hai friends,
help me, How to add ComboBox to dynamically created DataGridColumnpublic function docfoldercurtainmanagerResult(event):void
if(event.result){
rightslistArray=event.result.RES2;
//Alert.show(event.fault.message);
<mx:DataGridColumn
headerText="Rights Level" minWidth="75" sortable="true" >
<mx:itemRenderer>
<fx:Component>
<mx:ComboBox dataProvider="{outerDocument.rightslistArray}" labelField="sec_rights_level" />
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn> -
To retive data into a combobox using a dataprovider
Hi guys,
I am a bit new to flex so plz if anyone can help me on this
I am trinying to populate a combobox with the a data
provider in
this way:
<mx:ComboBox id="cboGroup" height="22" width="100"
dataProvider="{httpEditPartyMaster.lastResult.result.row.attribute('GROUPNAME')}"/
Is right to do it in this way because i am not getting any
data into
the combobox ?
This is how i am requesting to my java application:
public function getGroup():void{
var params:Object = new Object();
params.tname = "groups";
params.column = "groupname";
httpEditPartyMaster.url ="querytable.do";
httpEditPartyMaster.request = params;
httpEditPartyMaster.send();
<mx:HTTPService id="httpEditPartyMaster"
resultFormat="xml"
method="POST" result="processRequest();" />
regards ,
Mario.DBConsole is for SYSTEM or SYS or a user with DBA privilege.
I wouldn't understand why use EM to update tables, use SQL*Plus instead, it would be more simple and less cpu consuming.
Anyway, from the maintenance page you can launch a iSQL*Plus window, which would be more or less similar at SQL*Plus, to run any insertion queries.
Nicolas. -
Combobox with multiple columns
Is it possible to make a combobox with two columns in the dropdown area?
Thanksmake your own componen to show 2 colums... and assig it to combo box as itemrenderer...
twoColums.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
horizontalScrollPolicy="off" >
<mx:Text text="{data.Column1}" width="93">
</mx:Text>
<mx:Text text="{data.Column2}">
</mx:Text>
</mx:HBox>
in your main app or another custom conponen place your combobox like thi:
<mx:ComboBox id="myCB" dataProvider="{yourdata}" labelField="Column1"
itemRenderer = "components.twoColums">
</mx:ComboBox>
mybe you need to add width and dropdowwidth properties to show the items in a good way....hope this work..
PD. this works the same for Adobe autocomplete.. as autocomplete is a component heritated from combobox..:
make shure you have included the autocomplete component in your project at its says in the readme file included by Adobe then..
<Adobe:AutoComplete id="myCB" arrowButtonWidth = "30" dataProvider="{yourdata}" labelField="Column1"
itemRenderer = "components.twoColums">
</Adobe:AutoComplete>
note the arrowButtonWidth if you dont put this property the autocomplete will just show as a common text field...
remember auto complete will have some issues with the itemrenderer stuff.. if you wirite too fast, the first character you write will be lost, so calmd down, im traing to figure out how to soleve that issue...
haaaa by the way if you already have another way to show 2 columns please telme how you solve it... -
Populating ComboBox with XML data
Hi there,
Probably the most basic question, but I'm having a hard time with this...
Trying to populate the ComboBox with XML data as a dataProvider.
Here is the code snippet:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
creationComplete="baseDataRequest.send()">
<mx:Script>
<![CDATA[
import mx.collections.XMLListCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
private var baseDataXML:XML;
private function baseResultHandler(event:ResultEvent):void
baseDataXML = event.result.node.child as XML;
]]>
</mx:Script>
<mx:HTTPService id="baseDataRequest"
useProxy="false"
resultFormat="e4x"
result="baseResultHandler(event)"
url="XML_URL"/>
<mx:ComboBox id="comboDemo"
width="390"
dataProvider="{baseDataXML}"
labelField="NodeName"/>
</mx:Application>
And that returns nothing, basically. I know the XML is being pulled, because if I do this:
baseDataXML = event.result as XML;
then I just see a single item in my ComboBox, with full XML content.
How do I populate the ComboBox with XML contents?
XML example:
<root>
<node> <child>Child1</child>
<child>Child2</child>
</node>
</root>
Question: how do I populate the ComboBox with XML data nodes? I need <child> content to be the labelField of each combo box item...
Thanks!
K<mx:Script>
<![CDATA[
var baseDataXML:XML = <root><node><child>Child1</child><child>Child2</child></node></root>;
]]>
</mx:Script>
<mx:ComboBox id="comboDemo"
width="390"
dataProvider="{baseDataXML.node.child}"
labelField="NodeName"/>
Don't do:
baseDataXML = event.result.node.child as XML;
Instead just do:
baseDataXML = XML(event.result);
And in your combo:
dataProvider="{baseDataXML.node.child}" -
Hi there,
i got some problems with phtml:comboBox with the attribute freetext set. Any manual entered values doent show up in my model when using data binding. The selected values work fine.
I found one posting regarding this problem, but wonder whether there a been a official solution from SAP in the meantime. I coulnd not find anything in SAP Notes.
phtmlb:comboBox & data binding
How do you work with comboBox freetext ? How do you get the value manual entered? I case this is not a SAP-bug -> what is this freetext attribute then for?
I though of creating a solution that works for all comboBoxes without having to know all IDs but I have no idea how to get dynamically the IDs of all comboBoxes and moreover the Get_Data Method doesnt work here (returns wrong/empty object) although I use the long ID.
View:
<phtmlb:comboBox id = "SCC2SYNCLASSLOW"
selection = "//model/SCC_OVERLONGTEXT.SYN_CLASSLOW"
table = "//f4_model/F4HELP_SYN_CLASS"
nameOfKeyColumn = "KEY"
nameOfValueColumn = "KEY"
nameOfValue2Column = "VALUE"
behavior = "FREETEXT"
/>
Handle_Event( ):
comboBox ?= CL_HTMLB_MANAGER=>GET_DATA( request = request name = 'phtmlb:comboBox' id = 'ccctrl_sccctrl_ccsearchctrl_SCC2SYNCLASSLOW' ).
Frustrated I am Thanks for any help!!
Stefan.
6.20 SP49Hi
If you write a Bindable tag and change that variable it will reflect automatically wherever you assigned that variable. so here the combobox will change whenever you change the array not the inside objects.
Hope this helps.
Rush-me -
Xcelsius Engage: Issue with dynamic visibilty of data in dashboard
Hi,
We have a requirement for a dashboard where data for 5 Sites need to be displayed as per 17 KPIs and 12 different rolling months.
Raw sample data looks like below-
SITE KPI ActYTD Act(Pre Month) PlanYTD Plan(Prev Month) VarianceYTD Variance(Pre Month)
A On-Time 76.7 82.92 111.50 109.50 -1 -1
B Delay 73.70 80.00 79.75 77.75 -1 1
There are 5 different Sites and 17 different KPIs.
Based on the raw data that we get from BI (7.0 query output), we manipulate it in MS excel, using some lookups and formulae to obtain certain values, store them in designated sheets and then Xcelsius (different components) use these sheets as source.
We are having three levels of navigation-
1. Main screen listing all KPIs site wise and months ( the site and months could be selected from Combo boxes at the top). The KPIs are bind to a list view, each row is a selectable KPI leading to level two navigation.
2. Level two contains the details for each KPI ( values and trend chart). Selection in the chart for a Site leads to level 3 navigation.
3. Level 3 screen contains data by KPI and by Site for 12 rolling months ( The sites could be changed from a drop-down).
There are custom navigation buttons (home/back) to enable navigations between the screens.
We are using 3 panel containers, 2 list views, 4-5 combo boxes and some hidden button ( with dynamic visibilty).
The workbook has 8-9 different sheets, though the Xcelsius componets are bound to only 3 sheets.
Things work fine till we select 14th KPI , but Xcelsius starts behaving awkwardly when we select 15th KPI and further.For the selected KPI, the level two screen would load for a flash of a second and then the control comes back to level 1 screen. We do not face this issue till 14th KPI.
In-order to eliminate possibiltes we did the following-
1. Changed the order of KPIs - issue persists
2. Changed the Excel option " Max. no of Rows" to 4000- issue persists
3. Decreased the amount of data to be loaded - issue persists ( though at max we are loading data for 2000 rows)
4. Decreased the no. of KPIs to 14 in level 1 list view - all works fine.
We have not noticed any gradual decrease in performance/load time till 14th KPI but everything goes for a toss when the 15th KPI is displayed.
We are on the latest Xcelsius patch ( patch 3).
We would appreciate any pointers/help to resolve this issue.
Thanks in advance for your time.
Best Regards,
Bansi.How many total rows are you dealing with in your spreadsheet?
-Dell -
Hi Team,
I am learning on webbrowser control and during the learning phase i have the following issue:-
My webbrowser [mywb in this case] is successfully navigating and displaying the website content in webbrowser control. However; that site has three textboxes with dynamically allocated text from asp script
code behind; I have tried to display these textboxes values by providing the correct id of these textboxes in my visual studio 2013 code; but I am not receiving any data except null. Can you help me on this as early as possible.
asp code written to dynamically assign the data to textbox:-
<%
myvar=Request.form("some")
Response.write("<input type=text id=num1 value=" + myvar+ ">")
%>
The code written in VS 2013 to access the textbox by its id when the DocumentCompleted event is triggered:-
string mystr ="";
mystr = myWb.Document.GetElementById("num1").InnerText;
MessageBox.Show(mystr);
Thank You in Advance.
Regards, Subhash KonduruHello,
Thank you for your post.
I am afraid that the issue is out of support range of VS General Question forum which mainly discusses
the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
and Visual Studio Editor.
Because the issue is related to website, I suggest that you can consult your issue on ASP.NET forum:
http://forums.asp.net/
for better solution and support.
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Problem with Dynamic Node & UI Elements
Hi,
The scenario is to create an Questioaire.Since the number questions which I get from R/3 may vary, I have created the Dynamic Node which is mapped with Dynamic set of Radio button Group by index for options & Dynamic text view for displaying Questions.. A New Dynamic Node will be created for each set of Questions .The Number of questions displayed per page is controlled by the Static Counter Variable....
Now the issue is ,if i click back button the count will be initialized so again it needs to trigger the DoModifyView(). at that time It is arising an exception "Duplicate ID for view & Radio button ..." because while creating Dynamic node i used to have "i" value along the Creation of node name...
for(i=Count;i<i<wdContext.nodeQuestions().size();i++)
customnod=<b>nodeinfo.getChild("Questionaire"+i);</b>
if(customnod==null)
Its not possible to create a new node whenever i click the Back button.
At the same time i am not able to fetch the elements which had already created Dynamically...
How do i make the Next & back button work?
If anyone bring me the solution It would be more helpful to me.
Thanks in advance..
Regards,
MalarHi,
We can Loop through the Node Elements but how can we do Option Button Creation for each set of question Options?. At design time we can not have the radio buttons,because we do not know how many set of questions are available at the Backend. -
Creating Report using EPM Functions with Dynamic Filters
Hi All,
I am new to BPC, In BPC 7.5 i seen like we can generate EPM report using EVDRE function very quickly and easy too. Is the same feature is existing in BPC 10.0 ? if no how can we create EPM reports using EPM Functions with Dynamic Filters on the Members of the dimension like in BPC 7.5.
And i searched in SDN, there is no suitable blogs or documents which are related to generation of Reports using EPM Functions. All are described just in simple syntax way. It is not going to be understand for the beginners.
Would you please specify in detail step by step.
Thanks in Advance.
Siva NagarajuSiva,
These functions are not used to create reports per se but rather assist in building reports. For ex, you want to make use of certain property to derive any of the dimension members in one of your axes, you will use EPMMemberProperty. Similary, if you want to override members in any axis, you will make use of EPMDimensionOverride.
Also, EvDRE is not replacement of EPM functions. Rather, you simply create reports using report editor (drag and drop) and then make use of EPM functions to build your report. Forget EvDRE for now.
You can protect your report to not allow users to have that Edit Report enabled for them.
As Vadim rightly pointed out, start building some reports and then ask specific questions.
Hope it clears your doubts. -
Running a SQL Stored Procedure from Power Query with Dynamic Parameters
Hi,
I want to execute a stored procedure from Power Query with dynamic parameters.
In normal process, query will look like below in Power Query. Here the value 'Dileep' is passed as a parameter value to SP.
Source = Sql.Database("ABC-PC", "SAMPLEDB", [Query="EXEC DBO.spGetData 'Dileep'"]
Now I want to pass the value dynamically taking from excel sheet. I can get the required excel cell value in a variable but unable to pass it to query.
Name_Parameter = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
Name_Value = Name_Parameter{0}[Value],
I have tried like below but it is not working.
Source = Sql.Database("ABC-PC", "SAMPLEDB", [Query="EXEC DBO.spGetData Name_Value"]
Can anyone please help me with this issue.
Thanks
DileepHi,
I got it. Below is the correct syntax.
Source = Sql.Database("ABC-PC", "SAMPLEDB", [Query="EXEC DBO.spGetData '" & Name_Value & "'"]
Thanks
Dileep
Maybe you are looking for
-
What's wildcards in generics for?
To be honest, wildcards make me sick all the time. I've read through related chapters in 'core java' but still don't understand the purpose of using it.Pls take a look at the below example: package generics; import java.util.ArrayList; import java.ut
-
CR XI Cascading Prompt on Dynamic Parameter Value
Hi friends need a help related to Cascading prompt parameter in CR XI. I need to modify an existing report wherein Stored Procedure having a parameter is used as a datasource. Now in Report when I go in edit mode for that parameter under the value se
-
How to hide rows if all values are Zero (0) horizontally?
Hi, I have got a requirement to hide rows from the results if all values are equal to zero horizontally. Example: Region M1 M2 M3 East 0 0 3 West 10 20 0 South -5 0 5 North 0 0 0In the above example o
-
Import contacts in My iPhone to outlook
Contacts are syncronised by the exchange, but how do i import the contacts created in "My iPhone" to outlook?
-
Cinema Tools won't let me conform a video clip
I'm using FCP 7 and CT 4.5. I want to conform a 30p clip to 24p in CT, but when I open the clip in CT, the "conform" button isn't clickable/activated. However, when I open other clips, the button is clickable. What are possible reasons that CT won't