Hi Flo,
 
if you're passing back a String from your Java class you'll have to parse this 
String inside your Flex application by yourself - when using RemoteObject 
there's no automatic transformation of XML data to dataproviders.
 
Instead, let your getEntries() method return a java.util.ArrayList which is 
populated with Entry instances. Flex will automatically convert the ArrayList 
to a dataProvider after the data arrived in the Flash player and you can 
directly bind the result to your DataGrid. The objects inside this dataProvider 
will be of type Object but you can also create a mapping between your Java 
Entry class and ActionScript classes.
 
Make sure you read through the RemoteObject documentation. Also check 
Christophe Coenraets Restaurantfinder tutorial - this should give you a good 
start: http://www.coenraets.com/tutorials/restaurant/index.jsp 
<http://www.coenraets.com/tutorials/restaurant/index.jsp> 
 
Dirk.
 

________________________________

Von: flexcoders@yahoogroups.com im Auftrag von florianpflueger
Gesendet: Mo 11.07.2005 15:42
An: flexcoders@yahoogroups.com
Betreff: [flexcoders] Re: Flex + JSP + MySQL



Thanks a lot Dirk.

Now i decided to work with the RemoteObject.which should be faster and
i haven't use jsp. Now i can connect to the DB and can save my Data in
it. I wrote a Java class for the DB access. With an get and a Set
Method. Problem Now: When i call the getMethod I retrieve a String and
 don't get the Data in my DataProvider of the GridData.

####### Script ##########
var infoStr;
                       
function getData(){
        infoStr = remoteTagInfo.getEntries();
        return infoStr;
}
               
function resultHandler(result)
{
infoStr= result;
}

#### ARRAY ######
<mx:Array id="arr">
{infoStr}
</mx:Array>

#### DATAGRID ##############
<mx:DataGrid id="empGrid" >
<mx:dataProvider>
{arr}
</mx:dataProvider>
</mx:DataGrid>


NOTE the infoStr contains the correct data but the Entries didn't
appaer in the DataGrid

content of infoStr
:<mx:Object><datum>10.7.2005</datum><name>Florian</name></mx:Object>

I hope someone could help me soon

thx flo



--- In flexcoders@yahoogroups.com, "Dirk Eismann" <[EMAIL PROTECTED]> wrote:
> Hi Flo,
>
> take a look at the HTTPService class. This way you can POST data to the
> jsp page just the way you would with a traditional HTML form. Basically,
> you need to populate a the rquest model of the HTTPService instance with
> the data and then send it to your jsp page by using
> myHttpService.send(), e.g.
>
> <mx:HTTPService id="myHttpService" url="guestbook.jsp">
>   <mx:request>
>     <name>{name.text}</name>
>   </mx:request>
> </mx:HTTPService>
>
> <mx:TextInput id="name" />
> <mx:Button label="Senden" click="myHttpService.send()"/>
>
> Instead of using a jsp page you could also send the data to a server
> side service/class which deals with the data (e.g. a POJO)
>
> Dirk.
>
> -----Original Message-----
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of florianpflueger
> Sent: Friday, July 08, 2005 4:19 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Flex + JSP + MySQL
>
> Hi
>
> I want to programm a guestbook in flex, which should store the entries
> in a database(MySQL). I wrote a JSP site with a flex script and can so
> show all the entries in the database. That's works fine.
>
> But now I have Problem to get the Data from the Flex Form in the
> JSP-Variables to store them in the Database.(look example at bottom)
>
> How can i solve this
>
> Has anybody a simple example how i can write the flex variable to the
> JSP variable.
>
>
> thx flo
>
> ######## PROBLEM ########
>
> <mx:FormItem horizontalAlign="left" label="Name" required="true"
> direction="horizontal">
>                     <mx:TextInput id="name" width="200"/> </mx:FormItem>
>
>
> How can I store the value of name.text in the Database or in a JSP/Jave
> variable
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links










--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<<winmail.dat>>

Reply via email to