**************************************************************** [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => ckshah [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> problem in binding xml file data to datagrid xml file isgenerated through JSP file - Macromedia Flex General Discussion

problem in binding xml file data to datagrid xml file isgenerated through JSP file - Macromedia Flex General Discussion

problem it that i am creating xml file using JSP file and i want to bind DataGrid with xml file data that is created using JSP but it will not Bind two basic err occcur jsp file when i compiling MXML file 1) <xml> the xml tag only appear as first text in the file 2) problem parsing external xml i need proper solution both file code are as under *******************************JSP file********************************************** ** <% page contentType="text/html; cht=iso-8859-1" language="java" import="java.sql.*" errorPage="" %> <?xml version="1.0" encoding="iso-8859-1"?> <employees> <% Connection conn=null; try { String driverName="org.gjt.mm.mysql.Driver"; Class.forName(driverName); String url="jdbc:mysql://192.168.1.149/flextest"; String username="root"; String password="vamsi"; conn=DriverManager.getConnection(url,username,pass ...

  1. #1

    Default problem in binding xml file data to datagrid xml file isgenerated through JSP file

    problem it that i am creating xml file using JSP file and i want to bind
    DataGrid with xml file data that is created using JSP
    but it will not Bind

    two basic err occcur jsp file when i compiling MXML file

    1) <xml> the xml tag only appear as first text in the file
    2) problem parsing external xml

    i need proper solution both file code are as under
    *******************************JSP
    file********************************************** **

    <% page contentType="text/html; cht=iso-8859-1" language="java"
    import="java.sql.*" errorPage="" %>
    <?xml version="1.0" encoding="iso-8859-1"?>
    <employees>
    <%
    Connection conn=null;
    try
    {
    String driverName="org.gjt.mm.mysql.Driver";
    Class.forName(driverName);

    String url="jdbc:mysql://192.168.1.149/flextest";
    String username="root";
    String password="vamsi";
    conn=DriverManager.getConnection(url,username,pass word);
    out.println("Connection...");
    String query="Select * from temp";
    Statement stmt=conn.createStatement();
    ResultSet rs=stmt.executeQuery(query);
    while(rs.next())
    {
    %>
    <employee>
    <id> <% out.println(rs.getString(1)); %> </id>
    <phone> <% out.println(rs.getString(2)); %> </phone>
    <email> <% out.println(rs.getString(3)); %> </email>
    </employee>

    <%
    }

    }
    catch (ClassNotFoundException cle)
    {
    System.out.println("ClassNotFoudException :"+cle);
    } catch (SQLException e)
    {
    System.out.println("ClassNotFoudException :"+e);
    // Could not connect to the database
    }
    %>
    </employees>


    *********************************************MXMLF ILE***************************
    **********************************
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">

    <mx:HTTPService id="employeeSrv" useProxy="false" method="POST"
    url="http://localhost:8888/samples/chinmay/emp.jsp" >
    <mx:request>
    <id>{name.text}</id>
    <phone>{phone.text}</phone>
    <email>{email.text}</email>
    </mx:request>
    </mx:HTTPService>

    <mx:Script>
    function addRow() {
    if (name.text != "") dg.addItem( {id: name.text, email:
    email.text, phone: phone.text} );
    employeeSrv.send();

    }

    function updateRow() {
    if (dg.selectedIndex!=undefined)
    dg.replaceItemAt(dg.selectedIndex, {id: name.text, email:
    email.text, phone: phone.text} );
    }

    function deleteRow() {
    if (dg.selectedIndex!=undefined) {
    dg.removeItemAt(dg.selectedIndex);
    name.text=""; email.text=""; phone.text="";
    }
    }
    </mx:Script>
    <mx:Model id="empdata"
    source="http://localhost:8888/samples/chinmay/emp.jsp"/>
    <mx:Panel xmlns:mx="http://www.macromedia.com/2003/mxml" width="400"
    height="419">
    <mx:VBox>
    <mx:DataGrid id="dg" dataProvider="{empdata.employee}">
    <mx:columns>
    <mx:Array>
    <mx:DataGridColumn headerText="id" columnName="id" />
    <mx:DataGridColumn headerText="phone" columnName="phone" />
    <mx:DataGridColumn headerText="email" columnName="email" />
    </mx:Array>
    </mx:columns>
    </mx:DataGrid>
    </mx:VBox>
    <mx:HBox>
    <mx:VBox>
    <mx:Label text="id" />
    <mx:TextInput id="name" text="{dg.selectedItem.id}"/>
    </mx:VBox>
    </mx:HBox>
    <!--<mx:Label text="{employeeSrv.result.employees.employee[0].id}"
    visible="true" id="check" /> -->
    <mx:Label text="Phone" />
    <mx:TextInput id="phone" text="{dg.selectedItem.phone}"/>
    <mx:Label text="Email" />
    <mx:TextInput id="email" text="{dg.selectedItem.email}"/>
    <mx:ControlBar width="380" height="39" >
    <mx:Button label="Add" click="addRow()" width="20" height="20"/>
    <mx:Button label="edit" click="updateRow()"/>
    <mx:Button label="delete" click="deleteRow()"/>
    </mx:ControlBar>
    </mx:Panel>
    </mx:Application>

    ************************************************** **************

    ckshah Guest

  2. #2

    Default Re: problem in binding xml file data to datagrid xmlfile is generated through JSP file

    Cal the JSP form a browser. You will either get good xml, or you will see an error that will help you debug.

    Tracy
    ntsiii Guest

  3. #3

    Default Re: problem in binding xml file data to datagrid xmlfile is generated through JSP file

    Also, put this at the top of the jsp file:
    response.setContentType("text/xml");

    ntsiii Guest

Similar Threads

  1. advice needed... cf write data to xml file for use in flash app thatuses xml file
    By Donna Casey in forum Coldfusion Flash Integration
    Replies: 7
    Last Post: November 30th, 10:38 PM
  2. Replies: 2
    Last Post: October 14th, 07:02 PM
  3. Sorting a Datagrid that gets data from an XML file
    By Don in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: August 27th, 08:38 AM
  4. export datagrid data to Excel file
    By Grey in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: April 2nd, 11:16 PM
  5. Unstuffit RSRC file ? How to view data file ?
    By John in forum Mac Applications & Software
    Replies: 5
    Last Post: August 27th, 01:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •