Assigning Dataprovider to datagrid at runtime

Hi...
in my application, im using PHP-MY SQL with flex. using my php code, im retrieving data from the database and sending it to .as file in XML format. I wish to assign that data to a datagrid. how to assign those data to datagrid at runtime??? can anyone help..

<?php
$mysql_connection 
= mysql_connect("localhost", "root" , ""); 
mysql_select_db(
"pfa_db"); 
$sql 
="SELECT orgn_name FROM pfa_orgn where orgn_id=(select orgn_id from pfa_agentorgn where agent_id='" . $_POST['agentid'] . "')"; 
$result 
=mysql_query($sql); 
print 
"<stud>/n"; 
while ($row=mysql_fetch_object($result))
print 
"<orgn>".$row->orgn_name."</orgn>";}
print 
"</stud>"; 
close(
$mysql_connection);
?>
tis my php code....
public  
function view(e14:ResultEvent):void{
memblist=viewmem.lastResult.stud.orgn;//memblist is d array collection
var li:DataGrid=new DataGrid();li.x=50;
li.y=50;
li.dataProvider=memblist;
vb5.addChildAt(li,1);
tis my .as code...
can u help in someway??

Similar Messages

  • Flex datagrid re-assign dataprovider

    Hi,
    I am working on a datagrid with custom itemRenderer & [Bindable]xmllist as dataprovider. Now the changes done in xmllist are not reflected on datagrid UI until unless I re-assign the dataprovider as the same xmllist.
    As the dataprovider is Bindable so re-assigning is not required.
    But it was not working so I re-assigned the xmllist to the dataprovider of datagrid. It worked.
    Now my problem is when I re-assign the dataprovider my datagrid flicker(refreshes). It should not happen.
    1) Is there any way out to avoid re-assigning of dataprovider?
    2) Is there any way to stop flickering of datagrid on re-assigning the dataprovider?
    Thanks in advance.

    When you change a value in the dataprovider itemupdated method needs to be called in order to make the change reflected. Try using some thing like below
    ICollectionView(grid.dataProvider).itemUpdated( event.item, grid.columns[event.columnIndex].dataField );
    incase you are not having event then replace it with the item you are updating in the dataprovider.

  • Sizing a Datagrid at runtime

    I need to calculate the size of a Datagrid at runtime. I have
    the number of rows from my dataprovider. So I then need to calc
    headerHeight + rowHeight = DGHeight. Reason the DG is in a
    component in its own .mxml. So as the dg grows I'll need to expand
    its .mxml height a Canvas. It is then a component member of a main
    .mxml as <mx:myDGComp width="somesize" height="sizeunknown">.
    The effect I'm going for is as the DG grows it causes vertical
    scrolling my client saw this on another site and wants it.
    Thanks for th help

    Yay! I dug in the ClassFactory source file and figured out
    that I could use an object array to set the properties.
    private function PopulateProjectDataGrid():void{
    var
    fieldList:XMLList=projectDataRequest.lastResult.child('project1').child('field');
    var columns:Array=projectDataGrid.columns;
    var cf:ClassFactory=new ClassFactory(ComboBox);
    var ob:Object=new Object();
    for(var i:int=0;i<fieldList.length();++i){
    var newColumn:DataGridColumn=new DataGridColumn("column");
    newColumn.headerText=fieldList
    .child("fieldName");
    newColumn.dataField="field"+(i+1);
    if(fieldList.child('fieldType')=="List"){
    ob["alpha"]=0.1;
    cf.properties=ob;
    newColumn.itemRenderer=cf;
    columns.push(newColumn);
    projectDataGrid.columns=columns;
    }

  • How to generate a PDF 417 Barcode by assigning a dynamic value at runtime?

    PDF 417 Barcode Description given in the Livecycle Designer 8.2
    : PDF 417 Non-Scriptable Barcode. Value must be assigned to this barcode at design time, and this barcode will not update after form object value changes.
    And my question is how to generate a PDF 417 Barcode by assigning a dynamic value at runtime?

    All the information you described points to the problem that reports seems can't generate to a file which already exist. You can verify that by simply doing
    r30run32 C:\AC_REPORT.REP DESTYPE = FILE DESFORMAT = PDF BATCH = YES' desname=c:\temp\ac_report.pdf
    several times. If first time the report is successfully generated in c:\temp\ac_report.pdf, but not the second, third time, then it looks like there is a bug on reports r30run32 executable.
    You may try to find any latest patch for Reports 3.0 to see if patch can solve you problem. But keep in mind Reports 3.0 is de-supported, you are better to move to 6i or 9i reports.
    Thanks,
    -Shaun

  • Dynamic dataprovider in Datagrid combobox.

    Hi,
    i am using Flex 3. I have a data grid with first two rows having item renderers as ComboBoxes. What i want to implement is that, depending on my selection in the first combobox, the respective second combobox should get a dataprovider of my choice.
    For e.g.
    If I select the 1st combobox as India, then the adjacent combobox should have the cities in India.
    If I select the 1st combobox as France, then the adjacent combobox should have the cities in France.
    I dont have the values in any local variables. The values must be fetched at runtime because the list of Countries(in first combobox) is very exaustive so fetching the list of all cities for all countries would not be right. So for each selection of country i have to make an http service call to fetch the corresponding city list.
    My question is how do i dynamically give the cities as dataprovider to each of the combo boxes in each row.
    Hope my description is comprehensible enough.
    Thanks
    Sid.

    HI,
    Can you check the below code. If that is what you need.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                     layout="vertical"
                     creationComplete="application1_initializeHandler(event)">
         <mx:Script>
             <![CDATA[
                 import mx.collections.ArrayCollection;
                 import mx.events.FlexEvent;
                 // Defines your collections
                 [Bindable]
                 public var countriesData:ArrayCollection=new ArrayCollection([{label: 'India'}, {label: 'Brazil'}]);
                 [Bindable]
                 public var citiesData:ArrayCollection;
                 [Bindable]
                 public var collection:ArrayCollection=new ArrayCollection();
                 protected function application1_initializeHandler(event:FlexEvent):void
                     dataGrid.addEventListener("countryChanged", country_changed_handler);
                     collection.addItem({cityData:citiesData});
                // Change this method to the remote callings.
                // In the resultEvent you will change the citiesData collection.
                 protected function country_changed_handler(event:DataEvent):void
                     if (event.data == 'India')
                         dataGrid.selectedItem.cityData = new ArrayCollection([{label: 'Mumbai'}, {label: 'Delhi'}]);
                     else
                         dataGrid.selectedItem.cityData = new ArrayCollection([{label: 'São Paulo'}, {label: 'Rio de Janeiro'}]);
                     dataGrid.invalidateList();
                 public function addRow(event:MouseEvent):void{
                     //collection.addItem(new Object());
                     collection.addItem({cityData:citiesData});
                 public function dropRow(event:MouseEvent):void{
             ]]>
         </mx:Script>
         <mx:DataGrid id="dataGrid"
                      dataProvider="{collection}">
             <mx:columns>
                 <mx:DataGridColumn>
                     <mx:itemRenderer>
                         <mx:Component>
                             <mx:ComboBox dataProvider="{this.parentDocument.countriesData}"
                                          labelField="label"
                                          change="combobox1_changeHandler(event)"
                                          selectedIndex="-1">
                                 <mx:Script>
                                     <![CDATA[
                                         import mx.collections.ArrayCollection;
                                         import mx.events.ListEvent;
                                        protected function combobox1_changeHandler(event:ListEvent):void
                                             dispatchEvent(new DataEvent("countryChanged", true, true, this.selectedLabel));
                                     ]]>
                                 </mx:Script>
                             </mx:ComboBox>
                         </mx:Component>
                     </mx:itemRenderer>
                 </mx:DataGridColumn>
                 <mx:DataGridColumn>
                     <mx:itemRenderer>
                         <mx:Component>
                             <mx:ComboBox labelField="label">
                                 <mx:Script>
                                     <![CDATA[
                                              override public function set data(value:Object):void
                                                super.data = value;
                                                var prevSelectedItem:Object = this.selectedItem;
                                                this.dataProvider = data.cityData ;
                                                this.selectedItem = prevSelectedItem;
                                     ]]>
                                 </mx:Script>
                             </mx:ComboBox>
                         </mx:Component>
                     </mx:itemRenderer>
                 </mx:DataGridColumn>
             </mx:columns>
         </mx:DataGrid>
         <mx:HBox width="299" horizontalAlign="center" horizontalGap="51">
             <mx:Button label="Add" click="addRow(event)"/>
             <mx:Button label="Drop" click="dropRow(event)"/>
         </mx:HBox>
    </mx:Application>

  • DataProvider in DataGrid not handling path well

    I have an example document structured as follows:
    <html>
    <head><style type=text/css> url{visibility:
    hidden}</style></head>
    <body>
    <span><a class="Customer" href="
    http://localhost:8080/nfjs/customer?id=103"
    >Atelier graphique</a><br/></span>
    <span><a class="Customer" href="
    http://localhost:8080/nfjs/customer?id=112"
    >Signal Gift Stores</a><br/></span>
    <span><a class="Customer" href="
    http://localhost:8080/nfjs/customer?id=114"
    >Australian Collectors, Co.</a><br/></span>
    </body>
    </html>
    When I create a DataGrid and set the
    dataProvider={source.lastResult.html.body.span} it only works
    properly if I remove the <head> element .. it seems it cannot
    skip a sibling element when dereferencing an XML path.
    Any ideas?

    Don't skip the <head> element.

  • Assigning dataprovider to a chart in report designer

    Hi experts,
    In the report designer, I'm able to include a chart in a report section(but not in the main design area). But i want the chart to reflect according to the query (but it seems to be static). I tried all the options to assign a dataprovider to the chart, but I failed. Is this the right way to do it? or am i missing something obvious?
    And one more question, how can i add chart directly to the report designer just like adding a dataprovider? It allows me to add a dataprovider, what to do if i want the dataprovider result to reflect in chart/pie chart?
    Any pointers or tips would be helpful and appreciated.
    thanks in advance folks.

    Hi
    Follow this steps to insert chart and assign Data Provider
    1. Insert the Page header and Insert the Chart in the Header using the menu Insert ->Chart.  Or the Context menu Insert Graphic. chart will insert in the Report section.
    2. In the Left hand side of the Report designer -> Click on the Properties Tab or
       Goto Menu ->View ->Properties Pane
    3.In the Report section click on the Chart (single click) and verify in the properties pane.
    4. In the Properties pane You can find out the  option Add data provider
       below that you can find the option Edit chart
    I think you have tried with the Context menu of the Chart. that why you are seeing only the edit chart option.
    Only way to assign data provider to the chart is using the Properties pane of the Report designer
    Hope this explanation Helps You to find out the Option
    Regards
    Veda

  • Human Task : assign task to user at runtime based on some conditions

    HI ,
    I have a requirement that is, Assign task to users/ groups at runtime for approval based on material qty. please help me in design approach to achieve the same.
    thanks in advance.
    Guru

    Hi Guru
    You can achieve this with and without business rules. I am assuming you have a payload with element like "qty". In task details page or somehow, this gets filled. Now later on you can have like this:
    1. Without Business Rules:
    a) Lets assume you have human tasks like ApproverDefault, Approver100, Approver200, ApproverAll etc.
    b) After your first Task, add a XOR Gateway. Default path of XOR goes to ApproverDefault. Then you have like 3 more paths with Conditions like qty between 0 and 100 goes to Approver100. Qty between 100 and 200 goes to Approver200. Qty more than 200 goes to ApproverAll.
    Quantity
    No conditions (Default) -> ApproverDefault
    qty < 100 -> Approver100
    qty > 100 and qty < 200 -> Approver200
    qty > 300 -> ApproverAll.
    2. With Business Rules
    a) This needs some learning. Please do refer detailed online docs. I am just giving brief steps. Create extra fields of type Boolean in payload like AutoApproved, NeedApproval100, NeedApproval200, NeedApprovalAny etc. Have more meaningful names as per your requirement and human task though.
    b) You need to drag and drop Business Rules component and edit it in JDeveloper.
    c) First create a Bucket set with Range of Values for Qty field like -infinity to 0, 0 to 100, 100 to 200, 200 to infinity. You just enter rows like 0, 100, 200, and rest is taken care to add these Ranges.
    d) Now create Decision Rules. For each range, create a action and set the flag(s) appropriately.
    e) See hello world example for exact steps and full understanding.
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/firstProcess/firstprocess_obpm11g.htm
    Pros & Cons:
    a) Without Business Rules is very simple and straight forward. Quick and easy to develop and test. But if you want to control the range of values for qty, you need to modify the process and redeploy. Its kind of tight.
    b) Business Rules gives more flexible. You can change qty at run time, provided you use BPM Composer. But takes some learing and needs some debug if it fails like that.
    There are many differences and pros and cons. But above are the main ones.
    If you are a beginner, go with First Approach for now.
    Thanks
    Ravi Jegga

  • Assign Action and user at runtime

    Hello Experts,
         I have a requirement that we have to assign the action at runtime using the following way
    TaskTaskDetail     User1(Executer)     User2(Reviwer)
    XXXX     XXXX          Smith          John
    YYY     YYYY     Sneha          Rama
    Here Smith, John, etc... are the users that we have to assign at runtime while XXXX, YYYY are the actions having defined template.
    Can you please give me the right path to achive this requirement?
    Thanks in Advance
    Regards,
    Kuldeep Verma
    Edited by: Kuldeep Verma on Nov 11, 2008 1:53 PM

    hi,
    check the following links that will help you
    The specified item was not found.
    Different ways to model "Dynamical assignment of user to process roles" using Composition Tool Guided Procedures - Part 1
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/fcdf77fc6510b3e10000000a11466f/frameset.htm
    with regards
    shanto aloor

  • Simple dataProvider for dataGrid question

    I have a question about accessing some values from an
    xmllist. I have a piece of xml that is returned from an httpservice
    that looks similar to this.
    <topnode>
    <list>
    <item>value</item>
    <item>value2</item>
    <item>value3</item>
    </list>
    </topnode>
    I'm interested in creating a datagrid to display the values
    of each list.item, so: value, value2, value3. I'm not sure what my
    data provider should look like in this case since there are no
    nodes underneath the repeating node.
    I can create an xml list like:
    myList = event.result.list.item
    but this gives me an xmllist with values of [0].item.value,
    [1].item.value etc. I'm just unsure how to setup my datagrid to
    extract values from the item node.
    I think if my xml looked like the following I could access it
    like:
    (in my httpservice result handler)
    myList = event.result as XML
    (the datagrid provider would look like)
    dataProvider={myList.item}
    (and the column would have an entry like this)
    dataField="name"
    <topnode>
    <list>
    <item>
    <name>bob</name>
    </item>
    <item>
    <name>stan</name>
    </item>
    <item>
    <name>bill</name>
    </item>
    </list>
    </topnode>
    But in my case, the value I'm extracting is the value set at
    the top level node that repeats. Maybe I'm missing something
    obvious here.
    Any thoughts?

    Thanks again for responding. I've tried that, but when I do
    all the values show up in the first row of the datagrid. Which
    looks like this:
    <item>value</item>
    <item>value2</item>
    <item>value3</item>
    Perhaps I'm making an incorrect assumption below:
    [Bindable]
    public var myList:XMLList;
    myList = event.result.list;
    <mx:DataGrid dataProvider="{myList}" width="100%">
    <mx:columns>
    <mx:DataGridColumn headerText="Names"
    dataField="item"/>
    </mx:columns>
    </mx:DataGrid>
    xml from server:
    <topnode>
    <list>
    <item>value</item>
    <item>value2</item>
    <item>value3</item>
    </list>
    </topnode>

  • DataGrid - Create at runtime - How to Add Items??

    I create a DataGrid at runtime and then and columns to it as need be. How Can I add items with the correct dataField if I don't if I don;t know this till runtime? In other word I'm having trouble constructing the Object to send to AddItem becase the dataField Name needs to be hard coded...
    Below does not work for me because if I have more than one column then I can seem to figure out out to create  ItemObjFinal dynnamically.
    var ItemObjFinal:Object = {ThisNameNeedsToBeDynamic: "text", ThisNameNeedsToBeDynamic: "value" };
    I also tried creating an array of Objects like this:
    var ItemObjFinal:Object = new Object;
    var obj:Object= dgc.dataField;
    ItemObjFinal [0] = {(obj.valueOf()):  dgc.headerText };
    ItemObjFinal [1] = {(obj.valueOf()):  dgc.headerText };
    =========================================================================================
                  ac.addItemAt(dgc, int(ac.length));
                  dataGrid_preview.columns = ac.toArray();
                  var obj:Object= dgc.dataField;
                  var ItemObjFinal:Object = {(obj.valueOf()):  dgc.headerText };
                  var obj2:Object= dgc.dataField;
                  var ItemObjFinal2:Object = {(obj2.valueOf()): dgc.headerText};
                  //K Now add it!
                  //IList(dataGrid_preview.dataProvider).removeAll();
                  IList(dataGrid_preview.dataProvider).addItemAt(ItemObjFinal,0);
                 //IList(dataGrid_preview.dataProvider).addItemAt(ItemObjFinal2,1);

    Ahh answered my own question:
                 ac.addItemAt(dgc, int(ac.length));
                  dataGrid_preview.columns = ac.toArray();
                  var ItemObjFinal:Object = new Object;
                  var ItemObjFinal2:Object = new Object;
                  for each(var col:DataGridColumn in ac)
                    ItemObjFinal[col.dataField] = col.headerText;
                    ItemObjFinal2[col.dataField] = col.headerText;
                  ItemObjFinal[dgc.dataField] = dgc.headerText;
                  ItemObjFinal2[dgc.dataField] = dgc.headerText;
                  //K Now add it!
                  if(IList(dataGrid_preview.dataProvider).length > 1)
                      IList(dataGrid_preview.dataProvider).removeItemAt(0);
                      IList(dataGrid_preview.dataProvider).removeItemAt(1);
                  IList(dataGrid_preview.dataProvider).addItemAt(ItemObjFinal,0);
                  IList(dataGrid_preview.dataProvider).addItemAt(ItemObjFinal2,1);
    This code may still need some tweaking as I get an RTE at  "IList(dataGrid_preview.dataProvider).removeItemAt(1);"   but at least I'm able to solve my original question. Thanks Alex!

  • How to assign agent at runtime

    Hello gurus,
    I have a small querie.
    My requirement is when a workitem is received by a possible agent and he is not responding eventhough he receives repeative mail. I want to assign the new agent at runtime when the actual agent is received more than 4 workitems for the same task.
    It means 5th workitem should be diverted to new agent.
    Thanks in advance.
    Please help me out.
    Thanks & Regards,
    Siraj Md.
    Edited by: siraz ahmed on Dec 15, 2009 3:52 PM

    Hi,
    1. specify a counter Variable between the loop and increment the counter once the counter is reached 4
    if Counter > 4 then
    Specify the new agent id in dialogue task 
    You want to assign the agent at runtime means we have two options
    1. Go to SWIA-> Give the dialogue workitem no -> Select Assign possible agents tab -> Specify the agent id at runtime
    2. SBWP ->Select Work item ->Workflow settings ->Maintain Substitution

  • SRM-MDM 3.0, assignment failed, runtime error

    Hi all,
    We are using SRM-MDM catalog 3.0, MDM-Client version are 7.1.01.78.
    When building assignments which include lookup tables, the assignment failes giving the following runtime error:
        "Assignment operation failed: A runtime error occurred while evaluating an validation or calculation field"
    The assignment is initialising the item type with "Normal". If it is already filled, leave the old value.
    Assignment Code Used:  IF(IS_NULL(Item Type.[[Record]]), Item Type [[Normal]],Item Type.[[Record]])
    The runtime error only occures when the Else-branche is processed.
    This code above is also used in version 2.0 of the srm catalog, it is valid and working properly.
    The code was re-entered in a, newly created, version 3.0 catalog-repository.

    Error solved, we upgraded to version 3.0 Support pack 05 patch 2

  • How can we assign BS at runtime ?

    Hi
    How can we assign Buisness systems at runtime ?
    Ajith

    Hi Ajith
    Assigning the business system at runtime is possible using conditional receiver determination
    Importing in ID at runtime i dont think so. You have to import it at design time. Right click and assign business system this will allow you to choose from SLD components
    Check SLD
    http://help.sap.com/saphelp_nw04/helpdata/en/fe/39ae3d47afd652e10000000a114084/frameset.htm
    Thanks
    Gaurav

  • Message error "Define an assignment set in the runtime repository"

    Hello Experts,
    I'm creating a new component and when I'll assign the view created to be displayed in the screen the follow message appears "Define an assignment set in the runtime repository".
    Best regards,
    Caíque Escaler

    Hi,
    I am sure that when you Click on your view in component workbench, this message must be flashing up.
    Correct me if i am wrong.
    Now first thing is its not an error but an info message.
    There is nothing wrong in your developments. It just the fact that just creating a view does not mean we can use it. To use it, you must assign it to either a Window or a View Set or an Overview page in Runtime repository and thats why system tell you that you must do the view assignment.
    Go to the runtime repositoy and assign the view. Now whether it to be assigned to a viewset, overviewpage or window, depends upon your requirement. If your view is Assignement Block, you will attach it to an overviewpage . If its a separate edit/display view then you may attach it in existing viewset or Main Window.
    You can also create an empty window and attach your view to it..Ultimately view assignment completely depends upon what you want the view to be used as.
    Hope it solves your problem.
    Regards,
    Suchita

Maybe you are looking for