datagrid problem

Hello, I'm luciano, I come from milan, I am beginner programmer, I have e problem with datagrid I have because I am not not to be able to solve a simple problem infact I porpose this issue in this forum

hoping to help anyone.

I realizate a small procedure who receive data from a SQL database and I am happy because this little program work correctly but have a problem, because this research only once when I clik button on the first time and I don't know how I can change this program to search for data constantly.

I think my problem is to change the sendVariable method because 'urlLoader.addEventListener (Event.COMPLETE, callServerHandler)' send data

only first time but how can I change it?

It's my program and I'm happy if there at - it someone help me thank you

package classes.mysql {}

import flash.text.TextField;
Import fl.controls.DataGrid;
Import fl.controls.dataGridClasses.DataGridColumn;
Import fl.data.DataProvider;
Import fl.events.DataGridEvent;

import flash.display.MovieClip;
to import flash.display.SimpleButton;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
to import flash.net.URLVariables;
import flash.events. *;

SerializableAttribute public class LogonUtenti extends MovieClip {}

var sendButton:SimpleButton = new SimpleButton();
var urlRequest:URLRequest;
var urlLoader:URLLoader;
var phpFile:String = " " http://localhost/EsercitazioniFlashandPHP/SendResponseVarMySqlDataGrid/PHP/getUtLogon.php ";
var dataObj:URLVariables;
var col: Boolean = false;
var dati:DataProvider = new DataProvider();
var DatGrid:DataGrid = new DataGrid();

public void LogonUtenti (): void {}
this.addChild (sendButton);
sendButton.y = 35;
sendButton.x = 680;
sendButton.addEventListener (MouseEvent.CLICK, sendVariable);

}

private void sendVariable(evt:MouseEvent):void
{
var varSend:URLVariables = new URLVariables (evt.target.data);
varSend.nome = nome_txt.text;
varSend.cognome = cognome_txt.text;
varSend.telefono = telefono_txt.text;

urlRequest = new URLRequest();
urlRequest.url = phpFile;
urlRequest.method = URLRequestMethod.POST;
urlRequest.data = varSend;

urlLoader = new URLLoader();
urlLoader.addEventListener (Event.COMPLETE, callServerHandler);
urlLoader.dataFormat = pouvez;
urlLoader.load (urlRequest);
}
private void callServerHandler(evt:Event):void {}
var urll:URLLoader = URLLoader (evt.target);
urll.dataFormat = pouvez;
dataObj = new URLVariables (evt.target.data);

this.addChild (DatGrid);
if(col == false) {}
DatGrid.addColumn ("name");
DatGrid.addColumn ("last name");
DatGrid.addColumn ("phone");
DatGrid.addColumn ("professione");
DatGrid.addColumn ("address");
DatGrid.addColumn ("email");
DatGrid.dataProvider = dati;
DatGrid.setSize (700, 600);
DatGrid.move (40, 80);
for (var i: int = 0; i < dataObj.total; i ++) {}
dati.addItem ({name: dataObj ['name' + i] last name: dataObj ['hit' + i], telefono:dataObj ['telef' + i], professione:dataObj['prof'+i],indirizzo:dataObj['ind'+i],email:dataObj['eml'+i]});})
Col = true;
}
}
}

}
}

If you knew more about this than me, you wouldn't post a question in this forum.  you would be answering the questions.

Tags: Adobe Animate

Similar Questions

  • Data binding to DataGrid problem

    Hey guys, I have a quick question for you. I can not get my data appears in my DataGrid, and I probably do something stupid which is at the origin of the problem.

    To quickly explain, I'm out my DB given in my file DBClass, then return of the DBClass as a DataProvider function. When I get the DataProvider to return, I create a table, push my DataProvider inside, and then link to my DataGrid using new ArrayCollection (array). It sounds like a big NUMBER to Exchange around the types of variables, but I've not found an easier way to do it. I find it funny that I cannot bind my DataGrid dataprovider to a typed variable dataprovider, but I suspect it's because it's a spark datagrid and a dataprovider of qnx. If there is a better way, please let me know cause all these types of data are confused the hell out of me.

    In any case, here's the code:

    DBClass.as:

    var result:SQLResult = sqlStatement.getResult();
    var dp:DataProvider = new DataProvider();
    for each(var obj:Object in result.data) {
        if (obj != null) {
            dp.addItem({week:obj["week"], suHours:obj["su_end"], moHours:obj["mo_end"], tuHours:obj["tu_end"], weHours:obj["we_end"], thHours:obj["th_end"], frHours:obj["fr_end"], saHours:obj["sa_end"]});
        }
    }
    return dp;
    

    I don't understand the SQL statement or enforcement because this part is fine. It's just the DP put in place.

    viewHistory.mxml viewActivateHandler:

    protected function view1_viewActivateHandler(event:FlexEvent):void
    {
        var database:DBClass = new DBClass();
    
        var daHistory:Array = new Array();
        daHistory.push(database.getHistory(1));
    
        if(daHistory.length > 0)
            dgHistory.dataProvider = new ArrayCollection(daHistory);
    }
    

    getHistory (1) is back the DP from DBClass.as code listed above, the 1 is just a variable to determine what exactly to the back, so it is not related.

    viewHistory.mxml DataGrid:

    
        
            
                ... some custom itemrenderers that take up a lot of space ...
                
                
                
                
                
                
                
            
        
    
    

    I took out a couple of converters element custom in this last excerpt just to save space.

    Is that all the columns are empty instead of display the data provided in the table. I made the debug to prove that the RFP returned records and daHistory's records before being put in the ArrayCollection collection and defined as the dataprovider, so I don't know where I'll lose my data or setting of something wrong.

    Any help would be appreciated. As I said, all these types of data are a bit confusing, because it's a new language, I learn that I will. Thank you!

    Solved mine once again! I feel like all I have to do is post something here and I find myself the answer soon after. It's not like I've been stuck on this since yesterday, but regardless, it works.

    And to answer my question, Yes, I was going WAY out of how to get my data with too many data types.

    I've simplified the get function in DBClass.as to just return a table:

  • Flex 3 Datagrid problem

    Hi all

    After an afternoon of frustrated, I'll try my luck on this forum...

    I have a simple DataGrid (or list) that displays the text. I define an itemRenderer like this:

    < mx:itemRenderer >
    < mx:Component >
    < mx:Text width = '100% ' text = "{data.description}" selectable = "false" fontSize = "12" / > "
    < / mx:Component >
    < / mx:itemRenderer >

    Works fine, no problem.

    Now, I want to color the background of this text. To do this, I wrap the text component in a canvas (or VBox):

    < mx:itemRenderer >
    < mx:Component >
    < mx:Canvas width = "100%" height = "100%" backgroundColor = "{Config.COLOR_DARK_GREEN}" >

    < mx:Text width = '100% ' text = "{data.description}" selectable = "false" fontSize = "12" / > "
    < / mx:Canvas >
    < / mx:Component >
    < / mx:itemRenderer >

    .. .but when I do this, measure the height of the datagrid lines is not correct more!

    What I am doing wrong?

    The results are presented here:

    Schermafbeelding 2011-06-13 om 16.49.33.png

    THX in advance,

    Dany

    You can link text explicitWidth to explicitWidth of the canvas.

    Although I subclass mx:Text and draw a background on it.

  • Validation of DataGrid problem

    Hi friends

    I'm working on an application in which i m facing a problem.i have a datagrid having two is a simple datagrid column column field and in the other column datagrid I give textinput as a component. There are only two ranks in my datagrid.so now I must apply the validation on this average of grid.i of data if any textinput component that is rendered in the second column of the data grid is empty and I click on the button Save while there should be alert message for validation.

    I am facing a problem on id (instance) of this textinput component rendered getting two. Please help me.

    Thanks and greetings

    Vineet Osho

    Hi Vineet Osho,

    You can try this...


    http://www.Adobe.com/2006/mxml"layout ="absolute ".
    >
       
            Import mx.utils.StringUtil;
    Import mx.collections.ArrayCollection;
    Import mx.controls.TextInput;
    Import mx.events.DataGridEvent;
    Import mx.controls.Alert;
    public var arr:Array = [];
    public var incrementer: int;
               
    private function validateTextInputs (): void
    {
    var strIndexes:String ="";
    var gridDP:ArrayCollection = dataGrid.dataProvider as ArrayCollection collection;
    for (var i: int = 0; i<>
    {
    If (StringUtil.Trim (gridDP.getItemAt (i). (DisplayText) == ' ')
    {
    strIndexes += (i + 1) + ",";
    }
    }
    If (strIndexes.Length > 0)
    {
    strIndexes = strIndexes.substring(0,strIndexes.length-1);
    Alert.Show ("The TextInputs" + strIndexes + "empty.");
    }
    }
    ]]>
       

       
           
               
                
                      
                           
                                
                                

                           

                       

                 
          
     
                 
                   
                     
                       
                       
                     

                   

                 

         
     
         

    Thank you

    Jean Claude

  • XML to datagrid problem

    IM new to flex and I have a problem with getting my data in a datagrid control. This should be simple, but I'm running out of ideas to make this work.

    I can't control the data. It happens in this form. can it be integrated in a datagrid? I need the text between the tags field.

    Any ideas would be very useful.

    Thanks in advance!

    My data:

    <? XML version = "1.0" encoding = "UTF - 8"? >

    < report >

    < data >

    < row >

    < name of field = "EL_VALUES_FIELD8" pos = "1" > Vietnam < / field >

    < name of field = "EL_VALUES_FIELD9" pos = "2" > United States < / field >

    < name of field = "EL_VALUES_FIELD10" pos = "3" > PUBLIC POWER DISTRICT < / field >

    < name of field = "EL_VALUES_FIELD11" pos = "4" > FORT bumper < / field >

    < name of field = "EL_VALUES_FIELD12" pos = "5" > BOO < / field >

    < name of field = "EL_VALUES_FIELD13" pos = "6" > SINCLAIR < / field >

    < name of field = "EL_VALUES_FIELD14" pos = "7" > NOT < / field >

    < name of field = "EL_VALUES_FIELD5' pos '8' = > 29/03/2010 12:00:00 AM < / field >

    < name of field = "EL_VALUES_FIELD6' pos '9' = > ELEMENT, PRO-RO-430-HR-WT < / field >

    < = "EL_VALUES_FIELD8" pos = '10' field name > 3021590 < / field >

    < name of the field 'EL_VALUES_FIELD7' pos = '11' = > 36 < / field >

    < = field name "S.EL_VALUES_FIELD10 |"-'| "" S.EL' pos '12' = > FORT CALHOUN < / field >

    < name of the field 'EL_VALUES_FIELD15' pos = '13' = > N01937 < / field >

    < / row >

    < row >

    < name of field = "EL_VALUES_FIELD8" pos = "1" > APAC < / field >

    < name of field = "EL_VALUES_FIELD9" pos = "2" > India < / field >

    < name of field = "EL_VALUES_FIELD10" pos = "3" > Petro < / field >

    < name of field = "EL_VALUES_FIELD11" pos = "4" > purification < / field >

    < name of field = "EL_VALUES_FIELD12" pos = "5" > BOOT < / field >

    < name of field = "EL_VALUES_FIELD13" pos = "6" > < / field >

    < name of field = "EL_VALUES_FIELD14" pos = "7" > Johan Barru < / field >

    < name of field = "EL_VALUES_FIELD5' pos '8' = > 30/04/2010 12:00:00 AM < / field >

    < name of field = "EL_VALUES_FIELD6' pos '9' = > ELEMENT, PRO-RO-400-HR-WT < / field >

    < = "EL_VALUES_FIELD8" pos = '10' field name > 3006198 < / field >

    < name of the field 'EL_VALUES_FIELD7' pos = '11' = > 84 < / field >

    < = field name "S.EL_VALUES_FIELD10 |"-'| "" S.EL' pos '12' = > petrochemical-water < / field >

    < name of the field 'EL_VALUES_FIELD15' pos = '13' = > PROXY7 < / field >

    < / data >

    < / row >

    < report >

    No problem, we all have the same problems :)

    I think that you can give this thread replied.

    Kind regards

    Adrian

  • Synchronization of DataGrid problem

    I use flex sdk 3.
    I have two datagrids shares the same data provider.
    I have the following situation.
    1. each DataGrid has a checkbox as itemEditor (DataGrid are identical in the first phase);
    When I change the State of the checkbox in one, the change is reflected in the second DataGrid, only when the focus point drop, but I can not intercept any event changes to the data provider. (And tried).

    2. because the checkbox should be enabled or disabled based on a third information in the item data, I use a simple custom converter point: a vbox manages a checkbox and an accessor get/set data() overrided for VBox.
    I have 'Bindable' tags and everything is broken at the moment. I mean, changes to the data are not visible to others, until I call validateNow() for unchanged data grid.

    The question is what is the problem with the code and if it is the only way to do it, for the event of the witch to call validateNow()?



    See codes

    Finally found...

    Just need to score the editable custom grid under...

  • Flex datagrid problem - reward $20

    My Datagrids do not seem to work as I expect.
    The biggest problem is that resize the column seems to not be very intuitive, directly on the line of demarcation resizes the SizeableTitleWindow parent who can actually shrink the table with the window, if I'm on the side of the line, but always with the resizing slider, it seems to resize most of the time as expected , but I need it to work as expected for people without training to enter on the side.

    It also seems that if I resizing the SizeableTitleWindow parent and this force the DataGrid to shrink smaller than the datagrid control "wants" it causes a "box" white to hang on the side and bottom of the SizeableTitleWindow size, she wants to be, this also happens if I scroll the grid with my mousewheel without resizing , this seems bad whe I try to show my client that I built.

    I'll pay $10, via paypal, to the first person who offers a solution for each of these problems.

    If YES, you need SizeableTitleWindow in support of resize by itself, so please update the 258 of the SizeableTitleWindow.as line in the protected method function resizeDownListener(event:MouseEvent):void

    A:
    If (cursorStyle! = cursorSizeNone & cursorStyle! = cursorSizeAll)

    Must be:
    If (cursorStyle! = cursorSizeNone & cursorStyle! = cursorSizeAll & event.target == this)

  • Scrolling DataGrid problem

    Hi again,

    With the help of beta 3. I have a DataGrid with a series of pieces of information on this subject. When the user selects an item in the grid, I have a canvas that I show on the bottom third of the grid that gives details about the selected item. The problem is I want the element of grid selected to become the first visible item in the grid. This is particularly important in cases where the user selects an element that is in the bottom third of the grid and which is covered by the canvas when they select this item.

    So, is it possible to force the scroll of a DataGrid?

    Thanks, Jim

    It's very close. I'm trying remember what to verticalScrollPosition value. I'll post if I can understand it.

    Ah, try
    DG1.verticalScrollPosition = dg1.selectedIndex

    Tracy

  • Fill datagrid problem

    Hello

    I have problems filling my datagrid with xml data returned by an instance of a class.

    Here is the xml data that is returned by the instance

    < summaryScreen >
    < test >
    GCE of < type > < / type >
    < qualification > Extended project Qualification < / qualifying >
    < code > < code > 1991
    < student > 12 < / students >
    < scored 4 > < / marked >
    < subject > 8 < / subject >
    < set > November < / series >
    < / review >
    < test >
    GCE of < type > < / type >
    < code > < code > 1991
    < qualification > Qualification of project Extended - TH < / qualifying >
    < student > 14 < / students >
    < scored > 3 < / marked >
    < subject > 4 < / subject >
    < set > September < / series >
    < / review >
    < test / >
    < / summaryScreen >

    And here is my code for the datagrid control

    < mx:DataGrid dataProvider = "{_summaryScreenData.getXMLData ()}" >

    < mx:columns >
    < mx:DataGridColumn headerText = "Type" dataField = "type" width = "60" / >
    < mx:DataGridColumn headerText = "Qualification" dataField = "qualification" width = "140" / >
    < mx:DataGridColumn headerText = "Code" dataField = "code" width = "140" / >
    < mx:DataGridColumn headerText = "Students" dataField = "Students" width = "70" / >
    < mx:DataGridColumn headerText = "Marked" dataField = "marked" width = "70" / >
    < mx:DataGridColumn headerText = "Subject" dataField = "subject" width = "90" / >
    < mx:DataGridColumn headerText = "Series" dataField = "series" width = "70" / >
    < mx:DataGridColumn headerText = "Days left" dataField = "daysLeft" / >
    < / mx:columns >

    < / mx:DataGrid >

    Can someone point me in the right direction to enter these data in the DataGrid?

    Thank you!

    Do not use "mx.utils.ArrayUtil.toArray" with XML. It is only for tables that you get with mx: Model.

    Your class and function can be linked? There is no argument on the function, so how is the framework going to know when the connection of fire?

    You do not receive warnings of liaison?

    Use a lableFunction so you can debug the objects of the item in the dataProvider.

    Tracy

  • ItemRenderer and DataGrid problem

    Hi guys.

    I'm on the creation of a small application which simply pulls information from an XML file, it is displayed in a DataGrid control and allows the user to filter and search. First things first though; I'll explain what I have so far and detail my problem.

    I retrieve the XML file by HTTPService and then put the results in a collection of ArrayCollection Bindable. When the source of the Datagrid control is set to this ArrayCollection collection, it works fine. What I'm trying to do in the first, use an itemRenderer in a column that displays lines of text based on the values of the current line.

    For example, the structure of my XML file is (approximately):

    < content >
    < name > name1 < / name >
    < description > Description goes here < / description >
    Yes < audience1 > < / audience1 >
    < audience2 > not < / audience2 >
    Yes < audience3 > < / audience3 >
    < / content >

    So what I'm trying to do, it's the public each piece of 'content' is set to Yes for the group. Under the 'Public' column in the datagrid control, the above content would say

    "Audience1.
    Audience3 ".

    as this was a Yes value between 1 and 3 public. I tried to write very basic code within the itemRenderer by which I have replaced the game of public data and do some checks here, but it never seems to work right. I tried to use arrays in this for store public courses, but I clearly do not have the right format for it.

    There must be a better way to do this. I'm fairly new to Flex and AS3 (summer use AS2 for quite awhile now) but I have the feeling, there is a way to store the list public rows in a model of object/table/so I can refer to it later (I intend to filter these results by type of audience later so I think I'll have TO do it this way later). I read a lot of tutorials and guides, but honestly, I don't know where to look for more, none of them does not appear to cover this specific problem.

    I hope this makes sense to you guys and eventually you could give me guidance would be greatly appreciated.

    See you soon

    If you want to just display a concatenated string representing the nodes where the public [n] has a value of 'Yes', you can do this by using a labelFunction(), which is much simpler to use a converter element

    Tracy

  • Turnover of DataGrid problem

    < mx:AdvancedDataGrid id = "myDatagrid" dataProvider = rollOverColor "{DP}" = "{0x0066FF, 0x49FFAD}" >

    < mx:groupedColumns >

    < mx:Array >

    < mx:AdvancedDataGridColumn itemRenderer = dataField "CustomComp" = "item" / >

    < mx:AdvancedDataGridColumn itemRenderer = dataField = "qty" "CustomComp" / >

    < / mx:Array >

    < / mx:groupedColumns >

    < / mx:AdvancedDataGrid >

    Example above, when I rollover in datagrid lastcolor (0x49FFAD) will be get.but I want to apply two colors for when I rollover in datagrid... Any

    example, please specify...

    rollOverColor does not accept multiple values by default, you will need to replace yourself.

    or create a customized for your element converter, a canvas custom acting on the bearing would be a good bet

    http://userflex.WordPress.com/2008/01/30/Add-canvas-gradient/

  • DataGrid problem using checkbox as itemrenderer

    Hello

    I created a flex application in that I used datagrid with 3 columns. The column names are col1, col2, col3. For each column of data are provided using itemrenderer. ItemRenderer is check box. If each column is filled with checkboxex. I want to make selected a checkbox control in col1 when I select the checkbox in col2 and col3. But I am unable to do so. If anyone has the solution for this, please provide me with.

    Concerning

    Kotaland.

    I wrote a peace of my Variant. The very idea is in solution of manolya

    The idea is that you don't need a reference to the box: you must change the data for itemRenderers.

    You need only to listen to the event click on the boxes (you can add an eventListener to your itemRenderer) and change the data property of the itemRenderer you need. Then change you properties (or attributes of XML data) data, it will be assigned to other itemRenderes for this line.

  • Display DataGrid problem (was WebService: return nested object)

    I invoke a web service which works very well.
    resultFormat ="object"

    the event.result = an ArrayCollection collection, it has two ObjectProxys wrap the real objects.
    I can check them in the debugger, - values are as expected.

    Nobody
    personId:long
    name: PersonName

    PersonName - also wrapped in ObjectProxy
    first: String
    last: String

    The DataGrid will be corectly visualize the dataField = "personId".
    It displays dataField = "name" as "[object Object]".
    It displays dataField = "name.first" as white.

    I'm this navigation incorrectly?
    He will sail no complex data types?
    Now do the name?

    Fact resultFormat ="object" Web service does not work?
    Should I use resultFormat = "e4x"? If so, how to navigate in this?

    (using FlexBuilder 3)

    I posted another solution here. This is to extend DGColumn. It is easy to use and has the advantage of being reusable in many places without the need to have a labelFunction for each column.

    http://flexpearls.blogspot.com/2008/01/extending-dgColumn-and-adgcolumn-to.html

  • Link DataGrid problem

    Hi all

    I have a DataGrid which I am filling with a collection of table which is filled by an http service.

    The fields contain point publishers 'digital Stepper.

    When I run the code in the column fills properly, but the connection between the field in the DataGrid and arrayCollection collection seems to stop working after the third row.

    In other words, update the value in the first three rows is reflected in HQ
    Once beyond the 3rd row he doesn't seem like the change is registered

    Here are some of my code:

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "absolute" creationComplete = "myService.send ()" >
    "" < mx:HTTPService id = "myService" url = " http://localhost/mroi/cnctda.php" useProxy = "false" result = "myMeasuresHandler (event); "/ >

    < mx:Script >
    <! [CDATA]

    Import mx.rpc.events.ResultEvent;
    Import mx.collections.ArrayCollection;
    [Bindable]
    private var myValues:ArrayCollection = new ArrayCollection();
    private void myMeasuresHandler(event:ResultEvent):void {}
    myValues = event.result.data.values;
    }
    []] >
    < / mx:Script >


    < mx:DataGrid x = "10" y = "0" dataProvider = "{myValues}" width = "125" height = "100%" editable = "true" >
    < mx:columns >


    < mx:DataGridColumn headerText = "Updated $2" backgroundColor = "0xCCCCCC" editable = "true" dataField = "uspend" editorDataField = "value" >
    < mx:itemEditor >
    < mx:Component >
    < mx:NumericStepper
    maximum = "100" minimum = stepSize-"100" = ".01" / >
    < / mx:Component >
    < / mx:itemEditor >
    < / mx:DataGridColumn >
    < / mx:columns >
    < / mx:DataGrid >
    < mx:DataGrid = "130" x y = "0" dataProvider = "{myValues}" width = "50%" height = "100%" editable = "true" >
    < mx:columns >


    < mx:DataGridColumn headerText = "Updated $" dataField = "uspend" editable = "true" / >
    < / mx:columns >
    < / mx:DataGrid >


    < / mx:Application >

    By making the following change, you can get it works as expected.

    myValues.source = ArrayCollection (event.result.data.values) .source collection;

  • Alignment columnar with DataGrid problem

    Hi all.

    I have the following data grid:

    http://www.joshbeall.com/personal/Flex/Grid1.PNG

    If you filter some of the results with zeros in columns cited/applied, that's what you get:

    http://www.joshbeall.com/personal/Flex/Grid2.PNG

    See how the column heads are not aligned with the columns? Oddly enough, I still don't understand this behavior, but it often happens. If I click a column head (to change the sort order), the alignment is corrected.

    I have attached the full MXML for this application.

    BTW, another problem, I had (and have given up trying to hunt down is), why should I declare my WebService as < mx:WebService >, instead of simply do entirely in code? You can see in my MXML that I put in the comment a few lines of AS the initialization of the instance of WebService. I was originally, declaring and using my WebService entirely in code. However, data binding didn't work - the grid never filled. When I changed it to be declared as a < mx:WebService > tag, everything started working.

    -Josh

    Peter, I caught SDK build 180310/Wed Aug 22 2007 and that fixed the display problem.

    Rvollmar, thanks for the tip on [Bindable]. Add this attribute corrected the problem. You call the 'attributes' in ActionScript? 'attribute' is the name of .NET.

Maybe you are looking for