Populate textInput from DataGrid
Please help!
My DataGrid has "FIELD_NAME" and "FIELD_VALUES" columns.
My TextInput objects has to match id names from "FIELD_NAME"
columns, and populate value from "FIELD_VALUES" column into text.
How I can do this?
Thank you very much!
Slava
Sorry for the messed up cut and paste.
private function itemClickEvent(event:ListEvent):void
if(event.columnIndex < 0)
//can't do anything
else
var
selectedVIPName:String=event.currentTarget.selectedItem.VIPName;
var
selectedVIPAddress:String=event.currentTarget.selectedItem.VIPAddress;
var
selectedExternalAddress:String=event.currentTarget.selectedItem.ExternalAddress;
var selectedvid:String=event.currentTarget.selectedItem.vid;
vipname_inp.text=String(selectedVIPName);
vipaddress_inp.text=String(selectedVIPAddress);
external_inp.text=String(selectedExternalAddress);
vid_inp.text=String(selectedvid);
<mx:DataGrid id="dg" dataProvider="{lc}" width="100%"
height="100%" rowHeight="20" itemClick="itemClickEvent(event);"
>
<mx:columns>
<mx:DataGridColumn headerText="VID" dataField="vid"
visible="False" />
<mx:DataGridColumn headerText="VIP Name"
dataField="VIPName" />
<mx:DataGridColumn headerText="VIP Address"
dataField="VIPAddress"/>
<mx:DataGridColumn headerText="External Address"
dataField="ExternalAddress"/>
</mx:columns>
</mx:DataGrid>
Similar Messages
-
How to populate data from table into datagrid in form
hi there. may i know how to populate data from a table into a datagrid? i have created a datagrid in a form using OLE's microsoft datagrid. i'm having problem to populate data from table into the grid. can i know how to do that? thanks
Not exactly. I want to enter input from form and the user can have all options to choose i.e. HIGH, MEDIUM or so on.
Suppose, you have option to select HIGH, MEDIUM or LOW and you can see all these options together. You select LOW and when you save, it is saves in the table as a value. So when you view the table again, it will show LOW as active and HIGH and MEDIUM are null. -
Drag and drop data from datagrid to textInput with flex.
Hi,
Cay please help me out on this problem..
I have a datagid with some values..I have a textInput on the UI..
There is one "+" button on the UI..when i click on that button it will add one more TextInput box to the UI below the first TextInput..Like thiseverytime when you click on the "+" button it will add one more TextInput to the UI just below the previous one..
Now i want to drag the values from datagrid to Textinput boxes..User may drag two or more vlaues to each textInput upon his requirement..
How can i drag ...could you please help me out on thi issue....
I am not able to drag the values to TextInputs:
Here is my code:::Could anyone please help me...
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%" creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.containers.HBox;
import mx.controls.Alert;
import mx.managers.PopUpManager;
// import Components.testPopUpWindow;
import mx.core.UIComponent;
import mx.containers.TitleWindow;
import mx.core.DragSource;
// import mx.core.IUIComponent;
import mx.managers.DragManager;
import mx.events.DragEvent;
import mx.controls.Alert;
import mx.controls.Text;
import flash.geom.Point;
import mx.collections.ArrayCollection;
[Bindable]
private var dpFlat:ArrayCollection = new ArrayCollection([
{JobName:"A"},
{JobName:"B"},
{JobName:"C"},
{JobName:"D"},
{JobName:"E"},
{JobName:"F"},
{JobName:"G"}]);
private function box_addChild():void
var box:HBox = new HBox();
box.width=716;
var descriptionTextInput:TextInput = new TextInput();
var strButton:Button=new Button();
strButton.label="Submit";
descriptionTextInput.width=174;
descriptionTextInput.height=58;
box.addChild(descriptionTextInput);
/* box.addChild(strButton); */
// strButton.addEventListener(MouseEvent.CLICK,submitButtonClicked);
interactiveQuestionsVBoxID.addChild(box);
public function init():void
this.addEventListener( DragEvent.DRAG_ENTER, acceptDrop );
this.addEventListener( DragEvent.DRAG_DROP, handleDrop );
public function acceptDrop( dragEvent:DragEvent ):void
if (dragEvent.dragSource.hasFormat("items"))
DragManager.showFeedback( DragManager.COPY );
DragManager.acceptDragDrop(TextInput(dragEvent.currentTarget));
var pt:Point;
public function handleDrop( dragEvent:DragEvent ):void
// var dragInitiator:UIComponent = dragEvent.dragInitiator;
//var dropTarget:UIComponent = dragEvent.currentTarget as UIComponent;
var items:Array = dragEvent.dragSource.dataForFormat("items") as Array;
/* pt = new Point(dragEvent.localX, dragEvent.localY);
pt = dragEvent.target.localToContent(pt);
var img:TextInput = new TextInput();
img.x=dragEvent.localX; img.y=dragEvent.localY;
// img.x=pt.x - Number(dragEvent.dragSource.dataForFormat("mouseX"));
//img.y=pt.y - Number(dragEvent.dragSource.dataForFormat("mouseY"));
img.width = 50;
img.height=50;
img.setStyle("fontSize",20); // img.source="assets/" + items[0].id + ".png";
img.text=items[0].JobName.toString();
img.buttonMode = true;
img.mouseChildren = false;
TextInput(event.currentTarget).text=itemsArray[0].label;
var itemsArray:Array = event.dragSource.dataForFormat("items") as Array; */
TextInput(dragEvent.currentTarget).text=items[0].label;
public function beginDrag( mouseEvent:MouseEvent ):void
var dragInitiator:TextInput = mouseEvent.currentTarget as TextInput;
var dragSource:DragSource = new DragSource();
// dsource.addData(this, 'node');
dragSource.addData(this.mouseX, 'mouseX');
dragSource.addData(this.mouseY, 'mouseY');
//parent.addChild(dragImg);
//dragSource.addData(mouseEvent.currentTarget.text, "txt");
try{
var dragProxy:TextInput=new TextInput();
dragProxy.text = mouseEvent.currentTarget.text;
// Alert.show("Text isss"+dragProxy.text);
dragProxy.setActualSize(mouseEvent.currentTarget.width,mouseEvent.currentTarget .height)
// ask the DragManger to begin the drag
DragManager.doDrag( dragInitiator, dragSource, mouseEvent, dragProxy );
catch(e){}
]]>
</mx:Script>
<mx:Canvas id="c1" width="100%" height="100%" y="10" x="10" >
<mx:DataGrid id="d1" dataProvider="{dpFlat}" x="10" y="119" dragEnabled="true" dragMoveEnabled="true" height="229" width="176"/>
<!--<mx:Label id="lbl" text="Job Name" width="195" height="28" x="0" y="0" fontWeight="bold"/>-->
<mx:Box id="questionLabelMode" direction="horizontal" width="270.5" height="24" y="76" x="211">
<mx:Label name="Answer" width="173" text="Answer" fontWeight="bold"/>
<mx:Button label="+" width="70" click="box_addChild();" fontWeight="normal"/>
<!--<mx:Button label="-" width="71" fontWeight="bold" click="box_deleteChild();"/>-->
</mx:Box>
<mx:VBox id="interactiveQuestionsVBoxID" y="119" height="100%" width="270.5" horizontalScrollPolicy="off" x="211">
<!--<mx:Box id="boxID" direction="horizontal" width="268" height="58">-->
<mx:TextInput id="t1" width="174" dragDrop="handleDrop(event)" height="58"/>
<!--<mx:Button label="Submit" id="b1" />-->
<!-- </mx:Box>-->
</mx:VBox>
</mx:Canvas>
</mx:Application>Hi Satya,
I have done it for you ...please copy the below whole code and try to run the application. You can see the application working for you.
You have done two mistakes --- you have added the event listeners on this object........but this refers to current object(i.e; your main application file but not TextInput).
So you need to addEventListeners for your textinput "t1" but not to this...
If you add the listeners on this then in your "acceptDrop" and "handleDrop" functions you will get the "dragEvent.currentTarget" as your main app but not TextInput(Since you have added listeners to "this "). If you addListeners on t1 then its correct.
Also you need to add the eventListeners for the newly added textboxes as I done in "box_addChild" function in below code.
Also in the handleDrop function the line of code where you are assigning the text is wrong ......it should be the below code...
TextInput(dragEvent.currentTarget).text=items[0].JobName;
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%" creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.containers.HBox;
import mx.controls.Alert;
import mx.managers.PopUpManager;
// import Components.testPopUpWindow;
import mx.core.UIComponent;
import mx.containers.TitleWindow;
import mx.core.DragSource;
// import mx.core.IUIComponent;
import mx.managers.DragManager;
import mx.events.DragEvent;
import mx.controls.Alert;
import mx.controls.Text;
import flash.geom.Point;
import mx.collections.ArrayCollection;
[Bindable]
private var dpFlat:ArrayCollection = new ArrayCollection([
{JobName:"A"},
{JobName:"B"},
{JobName:"C"},
{JobName:"D"},
{JobName:"E"},
{JobName:"F"},
{JobName:"G"}]);
private function box_addChild():void
var box:HBox = new HBox();
box.width=716;
var descriptionTextInput:TextInput = new TextInput();
var strButton:Button=new Button();
strButton.label="Submit";
descriptionTextInput.width=174;
descriptionTextInput.height=58;
descriptionTextInput.addEventListener( DragEvent.DRAG_ENTER, acceptDrop );
descriptionTextInput.addEventListener( DragEvent.DRAG_DROP, handleDrop );
box.addChild(descriptionTextInput);
/* box.addChild(strButton); */
// strButton.addEventListener(MouseEvent.CLICK,submitButtonClicked);
interactiveQuestionsVBoxID.addChild(box);
public function init():void
t1.addEventListener( DragEvent.DRAG_ENTER, acceptDrop );
t1.addEventListener( DragEvent.DRAG_DROP, handleDrop );
public function acceptDrop( dragEvent:DragEvent ):void
if (dragEvent.dragSource.hasFormat("items"))
DragManager.showFeedback( DragManager.COPY );
DragManager.acceptDragDrop(TextInput(dragEvent.currentTarget));
private var pt:Point;
public function handleDrop( dragEvent:DragEvent ):void
// var dragInitiator:UIComponent = dragEvent.dragInitiator;
//var dropTarget:UIComponent = dragEvent.currentTarget as UIComponent;
var items:Array = dragEvent.dragSource.dataForFormat("items") as Array;
/* pt = new Point(dragEvent.localX, dragEvent.localY);
pt = dragEvent.target.localToContent(pt);
var img:TextInput = new TextInput();
img.x=dragEvent.localX; img.y=dragEvent.localY;
// img.x=pt.x - Number(dragEvent.dragSource.dataForFormat("mouseX"));
//img.y=pt.y - Number(dragEvent.dragSource.dataForFormat("mouseY"));
img.width = 50;
img.height=50;
img.setStyle("fontSize",20); // img.source="assets/" + items[0].id + ".png";
img.text=items[0].JobName.toString();
img.buttonMode = true;
img.mouseChildren = false;
TextInput(event.currentTarget).text=itemsArray[0].label;
var itemsArray:Array = event.dragSource.dataForFormat("items") as Array; */
var currTarget:* = dragEvent.currentTarget;
//interactiveQuestionsVBoxID = currTarget.getChildByName("interactiveQuestionsVBoxID");
TextInput(dragEvent.currentTarget).text=items[0].JobName;
public function beginDrag( mouseEvent:MouseEvent ):void
var dragInitiator:TextInput = mouseEvent.currentTarget as TextInput;
var dragSource:DragSource = new DragSource();
// dsource.addData(this, 'node');
dragSource.addData(this.mouseX, 'mouseX');
dragSource.addData(this.mouseY, 'mouseY');
//parent.addChild(dragImg);
//dragSource.addData(mouseEvent.currentTarget.text, "txt");
try{
var dragProxy:TextInput=new TextInput();
dragProxy.text = mouseEvent.currentTarget.text;
// Alert.show("Text isss"+dragProxy.text);
dragProxy.setActualSize(mouseEvent.currentTarget.width,mouseEvent.currentTarget .height)
// ask the DragManger to begin the drag
DragManager.doDrag( dragInitiator, dragSource, mouseEvent, dragProxy );
catch(e:Error){}
]]>
</mx:Script>
<mx:Canvas id="c1" width="100%" height="100%" y="10" x="10" >
<mx:DataGrid id="d1" dataProvider="{dpFlat}" x="10" y="119" dragEnabled="true" dragMoveEnabled="true" height="229" width="176"/>
<mx:Box id="questionLabelMode" direction="horizontal" width="270.5" height="24" y="76" x="211">
<mx:Label name="Answer" width="173" text="Answer" fontWeight="bold"/>
<mx:Button label="+" width="70" click="box_addChild();" fontWeight="normal"/>
</mx:Box>
<mx:VBox id="interactiveQuestionsVBoxID" y="119" height="100%" width="270.5" horizontalScrollPolicy="off" x="211">
<mx:TextInput id="t1" width="174" dragDrop="handleDrop(event)" height="58"/>
</mx:VBox>
</mx:Canvas>
</mx:Application>
If this post answers your question or helps, please kindly mark it as such.
Thanks,
Bhasker Chari -
Info package ABAP Routine to populate date from and To filed
Hello Experts,
I have requirement to populate the From and To dates with the: T-1 to T (Current Date u2013 1 to Current Run Date aka Sy-Datum) at info package level.I have written a code for this but see that From filed is not getting populated but TO filed is filled with current date.Can someone please tell me wats wrongwith my code?It is a delta info pacakage.
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = 'CPUDT'.
l_idx = sy-tabix.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
l_t_range-low = sy-datum - 1.
l_t_range-High = sy-datum.
modify l_t_range index l_idx.
p_subrc = 0.
Thanks,Was able to tackle this using the following code.
data: l_idx like sy-tabix.
data: V_date type sy-datum.
v_date = sy-datum - 1.
read table l_t_range with key
fieldname = 'CPUDT'.
l_idx = sy-tabix.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
l_t_range-low = v_date.
l_t_range-High = sy-datum.
modify l_t_range index l_idx.
p_subrc = 0.
Thanks,
I am closing this thread -
How to populate data from dynamic drop down list to the text field
Hi,
I tried to populate data from dynamic drop down list to city field. I would like to concat data from drop down list.When selecting add button to add the item and select item from drop down list, data should be displayed in the text field. However, Please help. I spent alot of time to make it works I am not successful.
Please see the link below.
https://acrobat.com/#d=SCPS0eVi6yz13ENV0cnUdw
Thanks for your help
CindyHi Rosalin,
Loop the hidden table, get the values and populate drop down in each iteration.
DropDownList1.addItem("Text","Value");
You can use one more solution for this scenario. If it is a matter of 2,3 dropdowns, put three dropDowns in the form layout and give seperate static data binding to them. At run time make the dropDowns hide/visible as per the requirement.
Hope this helps.
Thanks & Regards,
Sanoosh -
How to Save Data from DataGrid to Excel Sheet?
Hi All,
I am trying to use Adobe Flex 3.0 for making web pages.
I want to save the data from DataGrid and Advanced DataGrid of Adobe Flex 3.0 to Excel Sheet file. I am trying Flex Help, but didn't find answer for it.
In the application there is a button for 'save' by pressing which the 'Save As' window should appear.
And giving the path to the '.xls' file, the data from DataGrid should be saved on that location in .xls format.
This is my requirement.
If anybody knows how to do this please help.
Thank You,
SharadHi
Using document.applet.saveAsCSVFile(); code you can not get data in proper format.
For one of my application i have stored the data from Grid to excel.
But i am not sure about Adobe Flex 3.0, my code will work or not.
Also you need to make the "Initialize and Script Activex Control Not marked as Safe" as enabled in your IE.
You can share ur email. So that i can send the code. Here I am not able to paste the code.
Thanks -
Populate data from internal table
Hi Experts,
DATA: BEGIN OF it_tables OCCURS 0,
file(30),
tabname TYPE tabname,
END OF it_tables.
DATA: ldo_data TYPE REF TO data,
ld_tabnam TYPE tabname.
FIELD-SYMBOLS: <lt_itab> TYPE table.
ld_tabnam = it_tables-tabname.
CREATE DATA ldo_data TYPE STANDARD TABLE OF (ld_tabnam).
ASSIGN ldo_data->* TO <lt_itab>.
ld_tabnam = it_tables-file.
In the above code it_tables-tabname contains the structure name by which <lt_itab> structure is declared. it_tables-file contains the internal table name.
Now the next step is, i want to populate data from the internal table using ld_tabnam into <lt_itab>.
Is this possible?
Thanks & Ragards
AkshayHI,
Refer to this link..how to populate the dynamic internal table
How to populate data into Dynamic Internal Table. -
WPF: How to know the selection is come from datagrid or from ListBox?
Our application has a page which includes DataGrid and ListBox.
Both ItemSource are binding to PlateCells.
public ObservableCollection<CellVM> PlateCells
public class CellVM : BaseViewModel
public CellVM(int wellNumber)
WellNumber = wellNumber;
Row = wellNumber / define.NumberofWellsInRow;
Col = wellNumber % define.NumberofWellsInRow;
// row and col are 0-based
public int WellNumber { get; set; }
public int Row { get; set; }
public int Col { get; set; }
bool _isSelected;
public bool IsSelected
get { return _isSelected; }
set
_isSelected = value;
OnPropertyChanged("IsSelected");
string _sampleId;
public string SampleId
{ get { return _sampleId; }
set
_sampleId = value;
OnPropertyChanged("SampleId");
when a cell is selected, the cell will be highlight in both DataGrid and ListBox.
We also implement SelectAll button for both DataGrid and ListBox.
And SelectAll is ToggleButton. First time click is select All cells and second time click, it will unselect All cells.
What we notice when SelectAll button is click, all cells in both DataGrid and List box are highlight.
After that click on a grid any cell, all cells becomes unselected in both DataGrid and ListBox.
We assume this the behavior from DataGrid, after click SelectAll and click any cell in DataGrid will remove all selection and only highlight one cell in the datagrid.
However, this is behavior does not happen in ListBox. click any cell in ListBox only unselect that cell and not unselect all cells.
So we need to know click(selection) is coming from DataGrid or ListBox and take different actions.
How do we know the click is coming from DataGrid or ListBox? Thx!
JaneC>>How do we know the click is coming from DataGrid or ListBox? Thx!
It depends on where in the code you want to be able to determine this. In the view model class you cannot really know if the user clicked in the ListBox or in the DataGrid because the view model knows nothing (and shouldn't know either) about any of these
controls. It only exposes a property that may be set from anywhere.
Handling the GotFocus event for any or each of the controls seems to be a good solution because then you can take the appropriate action depending on which control was focused/clicked.
You could of course move the code that is being executed when the GotFocus event occurs, i.e. the code in your event handler, from the code-behind of the view to the view model class by using a command in the view model class and then hook up the GotFocus
event to this command using event triggers:
<DataGrid>
<i:Interaction.Triggers>
<i:EventTrigger EventName="GotFocus" >
<i:InvokeCommandAction Command="{Binding YourCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</DataGrid>
How to do this is a topic of its own though. Please refer to my blog post about how to handle events in MVVM for more information:
http://blog.magnusmontin.net/2013/06/30/handling-events-in-an-mvvm-wpf-application/. You will need to reference an assembly that is part of the Expression Blend SDK which you can download from here:
http://www.microsoft.com/en-us/download/details.aspx?id=10801.
Anyway, as mentioned, handling the GotFocus event seems like a good idea here since you cannot determine which control that was clicked in the setter of the source property in the view model class.
Hope that helps.
Please remember to close your threads by marking helpful posts as answer and please start a new thread if you have a new question. -
Populate combobox2 From database WHERE combobox1.text = something
I want to populate combobox2 from database WHERE combobox1.text = something. Here is the code I have and also I am using datable so I want to keep it that way
private void cbCompany_SelectedIndexChanged(object sender, EventArgs e)
this.cmpLocationTableAdapter.FillLocbyCmp(this.shahiemsDataSet.cmpLocation, cbCompany.SelectedText.ToString());
cbLocation.DataSource = shahiemsDataSet.cmpLocation;The result is a blank combobox2(cbLocation).
Hello,
Did you mean that the combobox2 bound to the datatable cbLocation, but it didn't contain any item, right?
If so, it seems that the method FillLocbyCmp didn't fill any data to that datatable, to troubleshoot this case, we need to check the following tips.
1. Whether the database for that dataAdapter contains any data, and whether you connected to the right database.
2. Whether that database could get any result filtering by that text value.
3. Whether that method could get that datatable filt succeccfully.
Since we could not get code about that FillLocbyCmp method, if possible, you could share them with us.
Regards,
Carl
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. -
Checkout: Auto Populate Billing from Shipping ?
Hi, I'm trying to cobble together a auto populate billing from shipping or vice versa, and I've gotten this far with JS and added it to the register buy form, but it is supposed to go into the header, for which, in the module template, there is no access. I'm sure I have some of it wrong, because I grabbed it from another site. Anyway, when I check the box for same as, nothing happens. I 'm wondering if the script needs to be placed elsewhere and/or if the variables I am using are incorrect for BC ?
<script type="text/javascript">
<!--
function shipsame(form){
if(form.sameasbilling.checked){
form.ShippingAddress = form.BillingAddress;
form.ShippingCity = form.BillingCity;
form.ShippingState = form.BillingState;
form.ShippingCountry = form.BillingCountry;
form.ShippingZip = form.BillingZip;
else{
form.BillingAddress= "";
form.ShippingCity = "";
form.ShippingState = "";
form.ShippingCountry = "";
form.ShippingZip = "";
//-->
</script>
<div class="shop-checkout shop-form">
<h1 class="heading colr">Check Out</h1>
<p>• Required</p>
<form id="catwebformform42059" name="catwebformform42059" onsubmit="return checkWholeForm42059(this)" action="/FormProcessv2.aspx?WebFormID=10850&OID={module_oid}&OTYPE={module_otype} &EID={module_eid}&CID={module_cid}" method="post" enctype="multipart/form-data">
<div class="form">
<div class="item">
...SNIP....
<label> Same as Shipping <input type="checkbox" name="sameasbilling" value="checkbox" onclick="shipsame(this.form);" />
<div class="item"> <br />
<label>
Billing Address</label>
<input class="cat_textbox" id="BillingAddress" type="text" maxlength="500" name="BillingAddress" />
</div>
TIA,
JeffA button would only work once. So if the user went back and changed the billing address the change would not be reflected in the shipping address.
With a check box one can use a calculation script in the shipping address to check if the billing address should be copied over. -
How make a button enable property "true" while i am clicking a row from datagrid in mxml flex4 app
hi friends,
i am new to flex, i am doing flex4 web application with mxml tags.
i have struck in this place,please give some idea.
i have one data grid with 5 rows and 4columns,and also i am having one button (property enable is false).
while i am click a particular row from datagrid that time the button property enbale should be change to true.
where i have to write code.
any suggession or snippet code,
Thanks in advance.
B.venkatesan.Hi,
You can take help of following 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"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var Arr:ArrayCollection = new ArrayCollection([{a:"AAA",b:"BBB"} , {a:"111" , b:"222"}]);
public function enable():void{
Btn.enabled=true;
]]>
</fx:Script>
<mx:DataGrid x="91" y="36" dataProvider="{Arr}" click="enable()">
<mx:columns>
<mx:DataGridColumn headerText="Column 1" dataField="a"/>
<mx:DataGridColumn headerText="Column 2" dataField="b"/>
</mx:columns>
</mx:DataGrid>
<s:Button x="210" y="237" id="Btn" label="Button" enabled="false"/>
</s:Application>
Thanks and Regards,
Vibhuti Gosavi | [email protected] | www.infocepts.com -
How do i populate certificates from a spreadsheet
I am trying to print some certificates and would like to populate them from a spreadsheet. Unsure if Numbers or Pages or Keynote would be the correct application.
You've posted this in the iWork for iOS forum, is that what you really wanted?
The Mac version is here:
https://discussions.apple.com/community/iwork/pages?view=discussions
Peter
btw Helps if you say what version of Pages you are using. -
Populate ComboBox from database - NOT using Flex Data Services
Hi there,
We are using CF with Flex but are not using the Flex Data
Service. I'm very much a newb and I'm having trouble finding any
information on how to populate controles from a database without
using Flex Data Service. Any help would be greatly appreciated.
First I have a page... JobSearch.mxml that contains a combo
box that I want to populate with the job_id and job_title from a
MSSQL database.
In Flex in the RDS DataView I used the "Create CFC" Wizard
which generated "job.cfc" and "jobGateway.cfc". It also generated
"job.as".
The CF Function that selects the data appears to be defaulted
and called "load" and the .as function is called simply "job".
So, that all looks great. But I can't find any information on
what I need to have on my JobSearch.mxml to actually get this data
into the comboBox.
I did:
<mx:Script>
<![CDATA[
[Bindable]
public var jobData:job = null;
]]>
</mx:Script>
And then:
<mx:ComboBox
text="{jobData.job_title}"></mx:ComboBox>
But I'm being told "Type was not found or was not a
complie-time constant: job"
I guess I'm missing something, or doing something way
wrong... I just don't know enough of Flex at this point to know
what it is.
Thanks!
AprilUsing php or asp is not an option, as we are a Cold Fusion
House.
I was looking at an article on Ben Forta's blog (
http://www.forta.com/blog/index.cfm?mode=e&entry=1786)
and following his example I did this... only it doesn't work:
I'm very very new to Flash and we are using ColdFusion but
are not using Flex Data Services. I've been trying to figure out
how to populate a combobox from a database and I'm just not having
any luck.
My project is called "PreTraffic". I have my main file as
"JobSearch.mxml" and a folder under the root named "cfc" with a
file called "job.cfc".
job.cfc contains the following code:
<cfcomponent>
<!--- Get jobs --->
<cffunction name="GetJob" access="remote"
returntype="query" output="false">
<cfset var job="">
<cfset var results="">
<cfquery datasource="discsdev" name="job">
SELECT job_id, job_title
FROM job
WHERE status = 'O'
ORDER BY job_title
</cfquery>
<cfquery dbtype="query" name="results">
SELECT job_title AS label, job_id AS data
FROM job
ORDER BY label
</cfquery>
<cfreturn results>
</cffunction>
</cfcomponent>
And JobSearch.mxml has the following code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="
http://www.adobe.com/2006/mxml"
xmlns="*"
layout="absolute"
backgroundGradientColors="[#ffffff, #d0d0d0]"
creationComplete="InitApp()">
<mx:Style source="style.css" />
<mx:Script>
<![CDATA[
public function InitApp():void {
jobSvc.GetJob();
]]>
</mx:Script>
<!-- ColdFusion CFC (via AMF) -->
<mx:RemoteObject id="jobSvc" destination="PreTraffic"
showBusyCursor="true" />
<mx:VBox label="Job History" width="100%" height="100%"
x="10" y="92">
<mx:Label text="Search jobs by"/>
<mx:Form label="Task" width="100%">
<mx:FormItem label="Job Name:">
<mx:ComboBox id="jobNameCB"
dataProvider="{jobSvc.GetJob.results}"></mx:ComboBox>
</mx:FormItem>
</mx:Form>
<mx:HBox>
<mx:Button label="Search"/>
<mx:Button label="Clear"/>
</mx:HBox>
</mx:VBox>
</mx:Application>
My Compiler thingy points to:
-services
"/Volumes/flexwwwroot/WEB-INF/flex/job-services-config.xml" -locale
en_US
and job-services-config.xml contains the following code:
<destination id="PreTraffic">
<channels>
<channel ref="my-cfamf"/>
</channels>
<properties>
<source>flex.pretraffic.cfc.job</source>
<lowercase-keys>true</lowercase-keys>
</properties>
</destination>
Well, when I run the app... the combobox is not populated...
Can anyone help with what I've done wrong?
Thanks!
April -
Hai
I have pasted the mxml below, because i am unable to attach the mxml, pl copy this below file into flex and run the application.
1. Run the application.
2. Enter values in the textbox and click add, values will be added to the datagrid.
3. now click AND or OR and then change the values in the second and thrid combobox and again click add.
4.Like wise change the combobox values and add five rows to the datagrid.
5.now if u delete the last row u can see the curent last row in the combobox, so that the AND or Or can be added to it
6. now if u delete a row in between, the deleted row's value oly maintains in the combobox,so i am unable to add AND or Or to the grid
7.I need the last row data in the datagrid to be in the second and third combobox, which ever row is deleted.
Can anyone help me....
Thanks in advance.
This is the mxml for sample
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
// ActionScript file
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
import mx.managers.CursorManager;
import mx.collections.ArrayCollection;
[Bindable]
public var adhoc:ArrayCollection = new ArrayCollection();
[Bindable]
public var serverString = "" ;
private function initImage(event:MouseEvent):void {
if(adhoc.length > 0){
CursorManager.setBusyCursor();
private function onChange():void{
if(comboBox.selectedIndex == 0){
}else{
private function onChange1():void{
if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
datepick.visible = true
txt.visible = false
}else{
txt.visible = true
datepick.visible = false
private function add():void{
var str:String = txt.text;
if(str.length == 0 && txt.visible == true){
Alert.show("Value Can Not Be Empty");
return;
if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){
if(txt.visible == true){
var temp:Object = new Object();
temp.fname = combo2.selectedItem;
temp.opera = combo1.selectedItem;
temp.val = "'"+txt.text+"'";
adhoc.addItem(temp);
txt.text = "";
var str1:String = datepick.text;
if(comboBox.selectedIndex == 1){
if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
if(str1.length == 0 && datepick.visible == true){
Alert.show("Date Cannot Be Empty");
}else{
var temp:Object = new Object();
temp.fname = combo2.selectedItem;
temp.opera = combo1.selectedItem;
temp.val = datepick.text;
adhoc.addItem(temp);
datepick.text = "";
addbutton.enabled = false;
addopenbracket.enabled = false;
combo2.enabled = false;
combo1.enabled = false;
private function querydelete():void{
if (AdHoc.selectedIndex > 0) {
if(AdHoc.selectedIndex == (adhoc.length-1)){
adhoc[AdHoc.selectedIndex-1].cond = "";
addopenbracket.enabled = false;
addclosebracket.enabled = false;
addbutton.enabled = false;
combo2.enabled = false;
combo1.enabled = false;
combo2.selectedItem = adhoc[adhoc.length-2].fname
combo1.selectedItem = adhoc[adhoc.length-2].opera
adhoc.removeItemAt(AdHoc.selectedIndex);
// adhocdetailgridcompilance.dataProvider = null ;
// adhocdetailgrid.dataProvider = null ;
}else if (adhoc.length == 1) {
adhoc.removeItemAt(AdHoc.selectedIndex);
// adhocdetailgridcompilance.dataProvider = null ;
// adhocdetailgrid.dataProvider = null ;
addopenbracket.enabled = true;
addclosebracket.enabled = true;
addbutton.enabled = true;
combo2.enabled = true;
combo1.enabled = true;
}else{
Alert.show("Select The Rows To Delete");
private function andSubmit():void{
for each(var obj:Object in adhoc){
if(obj.fname == combo2.selectedItem && obj.opera == combo1.selectedItem){
if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){
if(txt.visible == true){
trace("2 equals");
var temp:Object = new Object();
obj.cond = and.label
adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
}else{
trace(obj.fname + ":" + combo2.selectedItem);
trace(obj.opera + ":" + combo1.selectedItem);
trace(obj.val + ":" + "'"+txt.text+"'");
}else if(obj.fname == addclosebracket.label){
if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){
if(txt.visible == true){
trace("2 equals");
var temp:Object = new Object();
obj.cond = and.label
adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
}else{
trace(obj.fname + ":" + combo2.selectedItem);
trace(obj.opera + ":" + combo1.selectedItem);
trace(obj.val + ":" + "'"+txt.text+"'");
if(obj.fname == combo2.selectedItem && obj.opera == combo1.selectedItem){
if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
if(datepick.visible == true){
trace("2 equals");
var temp:Object = new Object();
obj.cond = and.label
adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
}else{
trace(obj.fname + ":" + combo2.selectedItem);
trace(obj.opera + ":" + combo1.selectedItem);
trace(obj.val + ":" + datepick.text);
}else if(obj.fname == addclosebracket.label){
if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
if(txt.visible == true){
trace("2 equals");
var temp:Object = new Object();
obj.cond = and.label
adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
}else{
trace(obj.fname + ":" + combo2.selectedItem);
trace(obj.opera + ":" + combo1.selectedItem);
trace(obj.val + ":" + datepick.text);
addbutton.enabled = true;
addopenbracket.enabled = true;
combo2.enabled = true;
combo1.enabled = true;
private function orSubmit():void{
for each(var obj:Object in adhoc){
if(obj.fname == combo2.selectedItem && obj.opera == combo1.selectedItem){
if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){
if(txt.visible == true){
trace("2 equals");
var temp:Object = new Object();
obj.cond = or.label
adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
}else{
trace(obj.fname + ":" + combo2.selectedItem);
trace(obj.opera + ":" + combo1.selectedItem);
trace(obj.val + ":" + "'"+txt.text+"'");
}else if(obj.fname == addclosebracket.label){
if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){
if(txt.visible == true){
trace("2 equals");
var temp:Object = new Object();
obj.cond = or.label
adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
}else{
trace(obj.fname + ":" + combo2.selectedItem);
trace(obj.opera + ":" + combo1.selectedItem);
trace(obj.val + ":" + "'"+txt.text+"'");
if(obj.fname == combo2.selectedItem && obj.opera == combo1.selectedItem){
if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
if(datepick.visible == true){
trace("2 equals");
var temp:Object = new Object();
obj.cond = or.label
adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
}else{
trace(obj.fname + ":" + combo2.selectedItem);
trace(obj.opera + ":" + combo1.selectedItem);
trace(obj.val + ":" + datepick.text);
}else if(obj.fname == addclosebracket.label){
if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
if(txt.visible == true){
trace("2 equals");
var temp:Object = new Object();
obj.cond = or.label
adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
}else{
trace(obj.fname + ":" + combo2.selectedItem);
trace(obj.opera + ":" + combo1.selectedItem);
trace(obj.val + ":" + datepick.text);
addbutton.enabled = true;
addopenbracket.enabled = true;
combo2.enabled = true;
combo1.enabled = true;
public function addOpenBracket():void{
var temp:Object = new Object();
temp.fname = addopenbracket.label
adhoc.addItem(temp);
addopenbracket.enabled = false
addclosebracket.enabled = true
if(adhoc.length > 1 && addopenbracket.enabled == false){
addbutton.enabled = true
public function addCloseBracket():void{
var temp:Object = new Object();
if(adhoc.length > 1){
temp.fname = addclosebracket.label
adhoc.addItem(temp);
addopenbracket.enabled = true
addclosebracket.enabled = false
if(adhoc.length > 1 && addclosebracket.enabled == false){
addbutton.enabled = true
private function dateChange(date:Date):void{
if (date == null){
}else{
txt.text = date.getDate() + '/' + (date.getMonth()+1).toString() + '/' +
date.getFullYear().toString() ;
public function saveadhoc(event:Event):void {
var AdhocRows:String = "";
var i:int ;
var selectedType = comboBox.selectedItem;
if(adhoc.length == 0){
Alert.show("Enter The Query");
}else{
for(i = 0; i < adhoc.length;i++) {
if(adhoc[i].fname != null){
AdhocRows = AdhocRows +adhoc[i].fname+" ";
if(adhoc[i].opera != null){
AdhocRows = AdhocRows + adhoc[i].opera+" ";
if(adhoc[i].val != null){
AdhocRows = AdhocRows + adhoc[i].val+" ";
if(adhoc[i].cond != null){
AdhocRows = AdhocRows + adhoc[i].cond+" ";
var parameters:Object = {adhocquery:AdhocRows,FlexActionType:"ADHOCQUERYSUBMIT",adhocType:selectedType};
// adhocClick.send(parameters);
private function retrieve():void{
datepick.visible = false
txt.visible = true
]]>
</mx:Script>
<mx:Array id="comp">
<mx:String>TYPE</mx:String>
<mx:String>AUDITRESULT</mx:String>
<mx:String>CATEGORY</mx:String>
<mx:String>CHILDRULE</mx:String>
<mx:String>PARENTRULE</mx:String>
<mx:String>AUDITGROUP</mx:String>
<mx:String>LOCATION</mx:String>
<mx:String>VENDOR</mx:String>
<mx:String>DEVICECATEGORY</mx:String>
</mx:Array>
<mx:Array id="inven">
<mx:String>VENDOR</mx:String>
<mx:String>DEVICETYPE</mx:String>
<mx:String>SERIES</mx:String>
<mx:String>MODEL</mx:String>
<mx:String>SUP/CPU</mx:String>
<mx:String>CODEVERSION</mx:String>
<mx:String>IMAGENAME</mx:String>
<mx:String>DATEDEPLOYED</mx:String>
<mx:String>LOCATIONNAME</mx:String>
<mx:String>ADDRESS1</mx:String>
<mx:String>ADDRESS2</mx:String>
<mx:String>CITY</mx:String>
<mx:String>STATE</mx:String>
<mx:String>COUNTRY</mx:String>
<mx:String>FLOOR</mx:String>
<mx:String>CABINET</mx:String>
<mx:String>CATEGORYNAME</mx:String>
<mx:String>DEPARTMENT</mx:String>
<mx:String>CONTACTNAME</mx:String>
<mx:String>CONTACTNUMBER</mx:String>
<mx:String>VERSION</mx:String>
<mx:String>FILENAME</mx:String>
<mx:String>DATEUPLOADED</mx:String>
</mx:Array>
<mx:Accordion x="13" y="55" width="230" height="492">
<mx:Form label="AdHoc Query Analyzer" width="100%" creationComplete="retrieve()" height="100%" color="#F2F8F9" backgroundColor="#020202">
<mx:Canvas label="Query" width="204" height="440" backgroundColor="#020202">
<mx:ComboBox x="66" y="287" width="134" id="comboBox" dataProvider="[COMPLIANCE , INVENTORY]" change="onChange()" color="#050505">
</mx:ComboBox>
<mx:ComboBox x="5" y="344" width="109.25" id="combo1" dataProvider="[=,!=,>,>=,<,<=,LIKE]" color="#010101"></mx:ComboBox>
<mx:TextInput x="119.25" y="344" width="77.75" id="txt" color="#050505"/>
<mx:Button x="3" y="401" label="Add" width="59" click="add()" id="addbutton" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
<mx:Button x="66" y="401" label="Delete" width="63.25" click="querydelete()" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
<mx:Button x="2" y="373" label="(" id="addopenbracket" click="addOpenBracket()" width="45" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
<mx:Button x="51" y="373" label=")" id="addclosebracket" click="addCloseBracket()" width="45" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
<mx:Button x="134.25" y="401" label="Submit" click="saveadhoc(event);initImage(event)" color="#FFFEFE" fillAlphas="[1.0, 0.69, 0.75, 0.65]" fillColors="[#77B97A, #77B97A, #EEEEEE, #EEEEEE]" borderColor="#77B97A" themeColor="#009DFF"/>
<mx:ComboBox x="66" y="317" width="134" id="combo2" change="onChange1()" dataProvider="{comp}" color="#010101">
</mx:ComboBox>
<mx:DateField x="122.25" y="344" width="74.75" initialize="dateChange((event.target).selectedDate)" id="datepick" color="#050505"/>
<mx:DataGrid x="1" y="1" width="203" height="282" id="AdHoc" dataProvider="{adhoc}" allowMultipleSelection="true" color="#020202">
<mx:columns>
<mx:DataGridColumn headerText="Name" dataField="fname" id="fnam"/>
<mx:DataGridColumn headerText="Operator" dataField="opera" id="ope"/>
<mx:DataGridColumn headerText="Value" dataField="val" id="valu"/>
<mx:DataGridColumn headerText="Condition" dataField="cond" id="condt"/>
</mx:columns>
</mx:DataGrid>
<mx:Button x="99" y="373" label="AND" width="52" click="andSubmit()" id="and" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
<mx:Button x="154" y="373" label="OR" width="49" click="orSubmit()" id="or" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
<mx:Label x="7" y="291" text="TYPE" width="59" fontWeight="bold"/>
<mx:Label x="5" y="319" text="DISPLAY" width="59" fontWeight="bold"/>
</mx:Canvas>
</mx:Form>
</mx:Accordion>
</mx:Application>Ok... but I am a little confused (sorry to be a nuisance ),
my delete function within my webService requires an ID to be
passed from the Flex application, thus when a row is selected, the
ID of the selected row is taken, so when the Delete button is
pressed it sends this ID to the webService where it is taken and
used - and therefore deleting the row etc.....
Do you mean to define the result handler for the deleteOPG
operation in the main webService tag, i.e. :
<mx:WebService id="wsData" wsdl=http://...?wsdl>
<mx:operation name="getRes" result="handleWSR(event)"/>
<mx:operation name="deleteOPG"
result="handleWSR_deleteOPG(event)"/>
</mx:WebService>
and then call it in my delete function, passing the ID from
my delete function to my new result handler function ??? :
Thanks,
Jon. -
How to Populate multi column datagrid
I would like to populate a datagrid from my dynamic xml
source. The datagrid is two collumns, the "name" collumn and the
"id" collumn, my problem comes in when i try to get both the name
and the id values from a single nested xml string rather then two
seperate ones. What i get is a list in the first row of each
collumn is a comman deliminated list like this "product 1, product
2, product 3,", do i need to convert this to an array? I would also
like to be able to sort this grid but im not sure if thats done on
the data side in my xml source with a particular "Tag" or what..
Examples are below:
-xml-rendered-by-source-to-HTTPService-is-confirmed-
<products>
<name>product 1</name>
<pid>101</pid>
<name>product 2</name>
<pid>102</pid>
<name>product 3</name>
<pid>103</pid>
<name>product 4</name>
<pid>104</pid>
</products>
-end-xml--------------------------------------------
-flex-application-----------------------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="
http://www.adobe.com/2006/mxml"
width="400" height="300"
creationComplete="getCat();changeCat('Tile')">
<mx:HTTPService id="prodByCatStream"
url="
http://localhost/rogerwilko/AndeanStone/xml.asp"
method="post"/>
<mx:DataGrid id="prodList"
dataProvider="{mx.utils.ArrayUtil.toArray(this.prodByCatStream.lastResult.products)}"
columnWidth="200" width="200" left="10" top="62" bottom="10"
cornerRadius="2">
<mx:columns>
<mx:DataGridColumn headerText="{prodCatList.value}"
dataField="name"/>
<mx:DataGridColumn headerText="PID" dataField="pid"/>
</mx:columns>
</mx:DataGrid>
</mx:Canvas>
-end-flex-application-------------------------------
Thanks alot to anyone willing to help!
leoOk after reading 3 paragraphs from an XML pdf i realised how
stupid my mistake was,
by changing the xml output to this i fixed all my issues
including the sort arrow error i was having.
<products>
<name>Test 1</name>
<pid>101</pid>
</products>
<products>
<name>Test 2</name>
</products>
leo
Maybe you are looking for
-
Did the erase and install new option as have all important files backed up to an external Freecom USB HD. Have now plugged the USB drive in and it doesn't come up in Finder? Which is a bit concerning....
-
Can I bond two conections together in one MacBook Pro?
I am at the beach for a week, and in desperarte need of some conectivity. Although I haven't used it in a while, I have the Apple Modem, and can get in using that alone at ~52k using traditional dialup speeds (Ugh!). I had forgotten how slow that is!
-
2 VGA displays, one blueish
Hi, I just got a Mac Pro 2.66 GHz to replace my old G5. Now I've got two identical VGA-LCD-Displays (Dell E171FPb) connected to the GeForce 7300GT. Unfortunately, one looks very blueish. I tried to calibrate the blueish display, but I couldn't even g
-
Hi Everyone, could anyone help me to solve my problem? I need to create a line chart where i can double click on the line and create a data point, then i ned to be able to drag it and save coordinates in to charts Array Collection. Is it possible in
-
New phone - iMessage and Facetime not working with number?
I had a 4s and recently got a 5s, and now iMessage on my Mac only has my email as an option. My phone number is the same. I searched around for a solution, and one involved signing out and back into both iMessage and Facetime on my Mac, so I did, and