How to populate DataGird with data returned from php page?

Hi, I'm new in Flex, I try to populate DataGrid with data from PHP, My code is
<mx:HTTPService 
id="personRequest" result="getPerson(event)" url=http://localhost/searchPerson.php useProxy="false" method="POST" showBusyCursor="true" resultFormat="e4x">
</ mx:HTTPService>
<mx:DataGrid 
id="searchResult" dataProvider="{???what to paste here???}" y="30">
</mx:DataGrid>
private  
function getPerson(evt:ResultEvent):void { var res:XMLList = evt.result..dane as XMLList;searchResults =
new XMLListCollection(res); 
output from PHP
<person>
<dane>
<name>ABC</name>
<street>XLXXLX</street>
</dane>
<dane>
<name>DEF</name>
<street>YAYAYAY</street>
</dane>
</person>
If I set the dataProvider as "searchResults" it doesn't work. I probably have to set as dataprovider any ArrayCollection , but I don't know how to convert my XMLListCollection to it.
Could anyone help me populate Datagrid with
name | streer
ABC, XLXXLX
DEF, YAYAYAY
Best Regards,
Mariusz

Thanks for your reply, but I'm afraid it doesn't work :-( Could you browse my code and check what I'm doing wrong???
full mxml code:
<?xml version="1.0" encoding="utf-8"?><mx:Application 
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="personRequest.send()">
<mx:Script><![CDATA[
     import mx.rpc.events.ResultEvent; 
     [Bindable]
     public var searchResultsXML:XML;  
     private  function getPerson(evt:ResultEvent):void 
      {          searchResultsXML = (evt.result
as XML);
          trace(searchResultsXML);     }
]]></mx:Script>  
<mx:HTTPService 
id="personRequest" result="getPerson(event)" url=http://localhost/searchPerson.php useProxy="false"
method="POST" showBusyCursor="true" resultFormat="e4x"></mx:HTTPService>
<mx:DataGrid  id="searchResult" dataProvider="{searchResultsXML.dane}"></mx:DataGrid>
 </mx:Application> 
trace statement returns:
<person>
<dane>
<id>1</id>
<nazwisko>Topczewski</nazwisko>
<imie>Mariusz</imie>
<imie2/>
<miejscowosc>Bia?ystok</miejscowosc>
<ulica>Nowogródzka</ulica>
<dom>7B</dom>
<lokal>25</lokal>
</dane>
<dane>
<id>1</id>
<nazwisko>Topczewski</nazwisko>
<imie>Mariusz</imie>
<imie2/>
<miejscowosc>Bia?ystok</miejscowosc>
<ulica>Sybiraków</ulica>
<dom>15</dom>
<lokal>27</lokal>
</dane>
</person>

Similar Messages

  • How to populate query multiple data returned as arrraylist?

    I am new to JSP and likes to know as mentioned in the subject.
    There are total 3 files.
    createUser.jsp -> Here I have to pupulate TITLE form field drop-down.
    TitleDAO.jsp -> Business logic has written to get DB records of titles.
    TitleBean.jsp -> getter/setter bean object.
    Now Here I am pasting all 3 files.
    TitleBean.java
    ===========
    package com.model;
    public class TitleBean {
         int titleID = 0;
         String title = "";
         public void TitleBean(){
              //nothing for now
         public void setTitleID(int titleID){
              this.titleID = titleID;
         public int getTitleID(){
              return this.titleID;
         public void setTitle(String title){
              this.title = title;
         public String getTitle(){
              return this.title;
    TitleDAO.java
    ============
    package com.model;
    import java.util.ArrayList;
    import java.sql.DriverManager;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.ResultSet;
    public class TitleDAO {
         public ArrayList<Object> getTitles() {
              Connection con = null;
              ResultSet rs = null;
              Statement stmt = null;
              //compose the SQL query
              String sql = "SELECT titleID,title FROM titleMaster ORDER BY titleID";
              // create object for returning data back to calling code
              ArrayList<Object> AL = new ArrayList<Object>();
              try {
                   //load the driver     
                   Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
                   //set the connection string URL
                   String connectionUrl = "jdbc:sqlserver://localhost:1433;"
                             + "databaseName=MyFirstServletDB;user=hitesh;password=hitesh;";
                   //make connection with database
                   con = DriverManager.getConnection(connectionUrl);
                   //create the statement with connection object
                   stmt = con.createStatement();
                   //get the data into result set
                   rs = stmt.executeQuery(sql);
                   //System.out.println("Recordcount==="+rowCount);
                   //looping through result set
                   TitleBean tbObj = new TitleBean();;
                   while(rs.next()){                    
                        tbObj.setTitleID(rs.getInt("titleID"));
                        tbObj.setTitle(rs.getString("title"));
                        AL.add(tbObj);
                        System.out.println("TitleID="+rs.getString("titleID")+", Title="+rs.getString("title"));                    
                   //close all objects
                   if(rs != null) rs.close();
                   if(stmt != null) stmt.close();
                   if(con != null) con.close();
                   //set null to the objects
                   rs = null;
                   stmt = null;
                   con = null;
              } catch (ClassNotFoundException e) {
                   System.err.println("Error ClassNotFoundException: " + e.getMessage());
              catch (Exception e) {
                   System.err.println("Error: " + e.getMessage());
              return AL;
    createUser.jsp
    ===========
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <%@page import="com.model.TitleDAO"%>
    <%@page import="java.util.ArrayList"%>
    <%
         TitleDAO tdObj = new TitleDAO();
         ArrayList<Object> getTitlesRs = new ArrayList<Object>();
         getTitlesRs = tdObj.getTitles();
         //show values came from DAO object
         for (int i = 0; i < getTitlesRs.size(); i++) {
              out.println("<br>Object[" + i + "]=" + getTitlesRs.get(i));
    %>
    =========================
    Please guide me also if there is any other GOOD way to get data of this kind?
    Thanks in advance.
    Edited by: hiteshpatel1979 on Dec 5, 2007 4:16 AM

    Try out following way, fetch bean data from Arraylist.
    for (int i = 0; i < getTitlesRs.length; i++)
    out.println("<br>Object[" + i + "]=" + getTitlesRs.getTitleID();
    out.println("<br>Object[" + i + "]=" + getTitlesRs[i].getTitle();

  • How to Populate Internal table data to Table Control in a Report Program

    Dear All,
           How to Populate Internal table data to Table Control in a Report Program? It is a pure report program with out any Module pool coding involved, which is just used to display data. Till now it is being displayed in a report. Now the user wants the data to be displayed in a table control. Could someone tell me how to go about with this.
    Thanks in Advance,
    Joseph Reddy

    If you want to use a table control, you will need to create a screen.
    In your report....
    start-of-selection.
    perform get_data.  " Get all your data here
    call screen 100. " Now present to the user.
    Double click on the "100" in your call screen statement.  This will forward navigate you to the screen.  If you have not created it yet, it will ask you if you want to create it, say yes.  Go into screen painter or layout of the screen.  Use the table control wizard to help you along the process.  It will write the code for you.  Since it is an output only table control, it will be really easy with not a lot of code. 
    A better way to present the data to the user would be to give it in a ALV grid.  If you want to go that way, it is a lot easier.  Here is a sample of the ALV function module.  You don't even have to create a screen.
    report zrich_0004
           no standard page heading.
    type-pools slis.
    data: fieldcat type slis_t_fieldcat_alv.
    data: begin of imara occurs 0,
          matnr type mara-matnr,
          maktx type makt-maktx,
          end of imara.
    * Selection Screen
    selection-screen begin of block b1 with frame title text-001 .
    select-options: s_matnr for imara-matnr .
    selection-screen end of block b1.
    start-of-selection.
      perform get_data.
      perform write_report.
    *  Get_Data
    form get_data.
      select  mara~matnr makt~maktx
                into corresponding fields of table imara
                  from mara
                   inner join makt
                     on mara~matnr = makt~matnr
                        where mara~matnr in s_matnr
                          and makt~spras = sy-langu.
    endform.
    *  WRITE_REPORT
    form write_report.
      perform build_field_catalog.
    * CALL ABAP LIST VIEWER (ALV)
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                it_fieldcat = fieldcat
           tables
                t_outtab    = imara.
    endform.
    * BUILD_FIELD_CATALOG
    form build_field_catalog.
      data: fc_tmp type slis_t_fieldcat_alv with header line.
      clear: fieldcat. refresh: fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material Number'.
      fc_tmp-fieldname  = 'MATNR'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '18'.
      fc_tmp-col_pos    = 2.
      append fc_tmp to fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material'.
      fc_tmp-fieldname  = 'MAKTX'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '40'.
      fc_tmp-col_pos    = 3.
      append fc_tmp to fieldcat.
    endform.
    Regards,
    Rich Heilman

  • Fill a table with data coming from an RFC

    Hello everyone:
    I've followed the Weblog "How many lines of java code did i write for a simple Web Dynpro?"
    /people/durairaj.athavanraja/blog/2004/10/17/how-many-lines-of-java-code-did-i-write-for-a-simple-web-dynpro
    I've called an RFC and created a table with data coming from it (which is also a table). My question is, if in this table there's a field named "UserType" there are two possible values for this field:
    "userA"
    "userB"
    How can I get the table only show me the "userA" registers? The RFC does return all of the users, but when filling the table, can I put an if-else somewhere on my code?
    Thanks a lot
    Alejandro

    Hi Alejandro,
    Referring to the link provided "The logic of the filter process is not implemented in Web Dynpro. The application developer must implement the action to be executed."
    We would have to implement the action onFilter in the controller implementation. Ideally, we fill the data retrieved from backend into a List (java.util.List) (this could be done on init of view) and then subset the list after meeting the criteria in the action handler(say
    onActionFilterData(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent).
    Having done this, you may bind the output list back to the node (shown in table)
    Regards,
    Chaitanya

  • No data return from BI7 via MDX drvier in Crystal report

    I have:
    Windows 2000 SP4
    SAP BI7 patch level 16
    SAP GUI 710 patch level 7 (BW3.5 addon patch 3, BI 710 patch 5)
    Crystal report XI R2 SP4
    SAP_Integration_Kit_XI R2-SP4
    and the BW tranports already imported in BI7.
    I can create a report over a Bex query in Crystal report using BW Query driver and retirved datafrom BI7
    Then I tried to create a report over the same Bex query in Crystal report using MDX driver, I got no data return from BI7.
    So I used the RSRTRACE transaction to trace the log when refreshing data in Crystal report, and then go to debug the call 10- GET_CELL_DATA and I have data from the MDX excution in BI7.
    So I think Crystal report can pass the MDX query to BI7 and BI7 can excute it without any problem, the issue is no data return to Crystal report.
    Could anyone help please?
    Thanks.

    [HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 11.5\SAP]
    "TraceDir"="C :\\Crystal Report\\"
    [HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 11.5\SAP\BW MDX Query Driver]
    "Trace"="Yes"
    "ExcludeSummaries"="Yes"
    Above are the right code in Reg and I have tried "C:\" as well, but still no trace file created.
    I was create the CR MDX report via SAP tool bar (and I create 2 reports base on the same Bex query with MDX and BW query just to compare, that one via BW query return data from BW)
    Thanks a lot.
    Allen
    Edited by: Wen Allen on Aug 25, 2008 5:32 PM

  • How do i move a data file from my pc to my ipad

    How do I move a data file from my computer to my ipad? It is my product catalogue and it would help if it were on my ipad.

    Plug the iPad into iTunes and you can use file sharing to move it into an app that supports file sharing and that document format.
    see http://support.apple.com/kb/ht4094
    Or, use an online storage service (iCloud, dropbox, box, google drive, sugarsync, etc) and upload the file to that.  Then on the iPad, from within the app you plan to use the file with, link to that service and download the file.
    The app will again have to work with that file type, and support the particular service you used.

  • How can I get the data back from my game

    How can I get the data back from minecraft if I deleted the app and bought with a different Apple ID

    No, they are tied to the ID that purchased them, and cannot be transferred to anyone else.

  • How to populate the Quering data into Excel sheet in Oracle

    Dear Guys,
    How to populate the Quering data into Excel sheet in oracle.
    Please provide a solution.
    Thanks & Regards,
    Senthil K Kumar

    Hi
    To make Excel sheets from sqlplus, you can use the markup html tag in sqlplus.
    Here's an example.
    Example
    <code>
    SET LINESIZE 4000
    SET VERIFY OFF
    SET FEEDBACK OFF
    SET PAGESIZE 999
    SET MARKUP HTML ON ENTMAP ON SPOOL ON PREFORMAT OFF
    SPOOL c:\test_xls.xls
    SELECT object_type
    , SUBSTR( object_name, 1, 30 ) object
    , created
    , last_ddl_time
    , status
    FROM user_objects
    ORDER BY 1, 2
    SPOOL OFF
    SET MARKUP HTML OFF ENTMAP OFF SPOOL OFF PREFORMAT ON
    SET LINESIZE 2000 VERIFY ON FEEDBACK ON
    </code>

  • How to use Count with Date Parameters

    Hello,
    I am having issues using the Count() function in conjunction with date parameters.
    This is a Siebel report and in my report I have 2 date parameters(From Date, To Date). In a nutshell I am basically trying to count Opportunities that has a start date within the given date period. However I don't see a reasonable way to put my date parameters within the Count() function. The reason being is that I need to have a huge chunk of code to convert the dates into a common format that can be compared, and it won't even fit within the code block in my rtf template. I am not even sure how to put multiple conditional statements inside a Count() function since all the examples I have seen are very simple.
    Anyone have a suggestion on how to use Count() with date parameters?
    Thanks.

    Any chance you can get the date formats in the correct format from siebel?
    I don't know Siebel - so I can't help you with that. If you get the correct format it is just
    <?count(row[(FromDate>=date) and  (date<=ToDate))?>
    Otherwise the approach would probably need to use string function to get year/monthd/day from the date
    and store it into a varialbe and compare later the same way
    <?variable@incontext:from; ....?>
    <?variable@incontext:to; ...?>
    <?count(row[($from>=date) and  (date<=$to))?>
    Potentially you can use the date functions such as xdofx:to_date to do the conversion
    [http://download.oracle.com/docs/cd/E12844_01/doc/bip.1013/e12187/T421739T481158.htm]
    But I am not sure if they are available in your siebel implementation.
    Hope that helps

  • Capturing xml data returned from a url post in a jsp page

    Hi,
    We are writing a interface which will capture data returned from an other website. The data returned will be in XML form.
    http://www.ecrm.staging.twii.net/ecrmfeed/ecrmfeedservices.sps?eCRMFeedInputXml=<twii><ecrmfeedinput><data%20method="Login"><username>[email protected]</username><password>password</password></data></ecrmfeedinput></twii>
    When the above url is executed in a browser, it required NT authentication. The username and password is getcouponed. Once the username and password is fed, we can see the output in the form of a xml. We require the xml in a String variable in a jsp page. We need to know the steps on how to execute the url in a jsp page. We used the url object to do the same, but we get a error saying "java.net.UnknownHostException: www.ecrm.staging.twii.net".
    Can anyone help?
    Regards,
    Gopinath.

    Hi,
    I would like to know if I can use the java.net package to get anything out of a website which requires authentication. In this case NT authentication.
    Thanks in advance,
    Gopinath.

  • How to remove timestemp with Date Column in BI Answers

    Hi All,
    i want to know how can I remove timestamp with date col from repository with "caste" command???
    Regards
    Message was edited by:
    53637

    hi,
    ur e-mail id is not working so i paste the query explain plan here:
    -------------------- SQL Request:
    SET VARIABLE QUERY_SRC_CD='Report';SELECT POS.POS_DATE saw_0, POS.POS_ASSET_DESC saw_1, POS.POS_MARKET_VAL_LCY saw_2, POS.POS_INT_ACCR_LCY saw_3 FROM WH1 WHERE POS.POS_DATE = date '2007-01-31' ORDER BY saw_0, saw_1, saw_2, saw_3
    +++Administrator:2a0000:2a0002:----2008/01/16 03:14:25
    -------------------- General Query Info:
    Repository: Star, Subject Area: WH1, Presentation: WH1
    +++Administrator:2a0000:2a0002:----2008/01/16 03:14:25
    -------------------- Logical Request (before navigation):
    RqList  distinct
        POS.POS_DATE as c1 GB,
        POS.POS_ASSET_DESC as c2 GB,
        POS.POS_MARKET_VAL_LCY as c3 GB,
        POS.POS_INT_ACCR_LCY as c4 GB
    DetailFilter: POS.POS_DATE = DATE '2007-01-31'
    OrderBy: c1 asc, c2 asc, c3 asc, c4 asc
    +++Administrator:2a0000:2a0002:----2008/01/16 03:14:25
    -------------------- Execution plan:
    Child Nodes (RqCache):
    RqList <<6636>> [for database 3023:2470:wh1,46] distinct
        cast(POS.POS_DATE as  DATE )  as c1 GB [for database 3023:2470,46],
        POS.POS_ASSET_DESC as c2 GB [for database 3023:2470,46],
        POS.POS_MARKET_VAL_LCY as c3 GB [for database 3023:2470,46],
        POS.POS_INT_ACCR_LCY as c4 GB [for database 3023:2470,46]
    Child Nodes (RqJoinSpec): <<6672>> [for database 3023:2470:wh1,46]
        POS T44641
    DetailFilter: cast(POS.POS_DATE as  DATE )  = DATE '2007-01-31' [for database 0:0]
    OrderBy: c1 asc, c2 asc, c3 asc, c4 asc [for database 3023:2470,46]
    +++Administrator:2a0000:2a0002:----2008/01/16 03:14:25
    -------------------- Sending query to database named wh1 (id: <<6636>>):
    select distinct  TRUNC(T44641.POS_DATE) as c1,
         T44641.POS_ASSET_DESC as c2,
         T44641.POS_MARKET_VAL_LCY as c3,
         T44641.POS_INT_ACCR_LCY as c4
    from
         POS T44641
    where  (  TRUNC(T44641.POS_DATE) = TO_DATE('2007-01-31' , 'YYYY-MM-DD') )
    order by c1, c2, c3, c4
    +++Administrator:2a0000:2a0002:----2008/01/16 03:17:21
    -------------------- Query Result Cache: [59124] The query for user 'Administrator' was inserted into the query result cache. The filename is 'C:\OracleBIData\cache\NQS_LENOVO_733059_11665_00000002.TBL'.

  • Datas return from Blob data type in Sqlite

    i am using sqlitejdbc-v053.jar through get SQLITE BLOB data type data. But i cannot data return from Blob type.
    Error will be display from :
    not implemented by SQLite JDBC driver
    and point out error line
    blob = rs.getBlob("NGP_REPDATA");
    {try {
                   Class.forName("org.sqlite.JDBC");
                    conn = DriverManager.getConnection("jdbc:sqlite:test.DB");
                    stmt = conn.createStatement();
                    rs = stmt.executeQuery("SELECT * FROM sometable");
                    System.out.println("==============");
                    while(rs.next()) {
                         blob = rs.getBlob("blobDATA");//
                         is = blob.getBinaryStream();
              catch(SQLException e) {
                   e.printStackTrace();
              }}any sample or solution pls give
    sqlite with BLOB sample there pls give link                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    There explicitly tells you that the JDBC driver that you are using will not do the method that you are calling.
    Thus you cannot use that method.
    There is another way to extract blobs which involves using a stream. You can search for that.
    If your blobs are actually short and only have character data then you might be able to use getString() as well.

  • How do I reed a carrige return from a JTextArea

    How do I reed a carrige return from a JTextArea, as i would like to hadel this with a button press event.

    Try adding a keyListener and use the appropriate method to get the key used from the passed in KeyEvent
    public void keyPressed(KeyEvent e) {
    if(e.getKeyStroke() == KeyEvent.VK_ENTER) {
    ... // the rest goes here. Please check this code for it is not tested
    }ICE

  • Problem with date format from Oracle DB

    Hi,
    I am facing a problem with date fields from Oracle DB sources. The date format of the field in DB table is 'Date base type is DATE and DDIC type is DATS'.
    I mapped the date fields to Date characters in BI. Now the data that comes to PSA is in weird format. It shows like -0.PR.09-A
    I have changing the field settings in DataSource  to internal and external and also i have tried mapping these date fields to text fields with out luck. All delivers the same format.
    I have also tried using conversion routines like, CONVERSION_EXIT_IDATE_INPUT to change format. It also delivers me the same old result.
    If anybody of you have any suggestions or if anybody have you experienced such probelms, Please share your experience with me.
    Thanks in advance.
    Regards
    Varada

    Thanks for all your reply. I can only the solutions creating view in database. I want some solution to be done in BI. I appreciate if some of you have idea in it.
    The issue again in detail
    I am facing an issue with date fields from oracle data. The data that is sent from Oracle is in the format is -0.AR.04-M. I am able to convert this date in BI with conversion routine in BI into format 04-MAR-0.
    The problem is,  I am getting data of length 10 (Output format) in the format -0.AR.04-M where the month is not in numericals. Since it is in text it is taking one character spacing more.
    I have tried in different ways to convert and increased the length in BI, the result is same. I am wondering if we can change the date format in database.
    I am in puzzle with the this date format. I have checked other Oracle DB connections data for date fields in BI, they get data in the format 20.081.031 which will allow to convert this in BI. Only from the system i am trying creating a problem.
    Regards
    Varada

  • How to schedule Job for data uploading from source to BI

    Hi to all,
    How to schedule Job for data uploading from source to BI,
    Why we required and how we do it.
    As I am fresher in BI, I need to know from bottom.
    Regards
    Pavneet Rana

    Hi.
    You can create [process chain |http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/502b2998-1017-2d10-1c8a-a57a35d52bc8?quicklink=index&overridelayout=true]for data loading pocess and schedule start process to any time/date etc ...
    Regadrs.

Maybe you are looking for

  • EWT-Tax on Down Payment and Invoice

    Hello, I've activated the accumulation feature in the Withholding Tax Type for both IV as well as Payments. The tax code is the same for both tax types.I've also defined the minimum base amount for Witholding Tax code as Rs.5000 for Official Withhold

  • Probable BUG found in Sybase Inventory database

    Hi All, (Sure is quiet around here - must be because ZDM 7 is so stable...) So I have been having inventory database issues. Random but inevitable database failures - eg "assertion failed 201425" (and other numbers that I cannot locate at the moment)

  • CKEditor - Blob Display in Contributor UI - W

    Folks, We recently upgraded to 11.1.6.1. It seems like text blobs are displayed in the contributor UI as a big "W". We have to edit the asset to see the text in blob attributes. Is there a way to allow a blob/text to be displayed in the Contributor i

  • Photoshop CS6 comes up as trial version

    Opened a photo in photoshop CS6 from Bridge.  Photoshop came up as trial version.  What happened to my regular version?

  • Will BIOS update help wtih sound problem?

    I have a problem getting sound working with linux on a 3000 (an N200 0769 in my case) that many other people have reported: sound only works with ACPI off. I asked for help on the Mandriva forums and was told to check if there are any relevant BIOS u