Java Reference
In-Depth Information
</mx:Form>
</mx:Canvas>
</mx:TabNavigator>
<mx:Text x="10" y="358" id="status" color="#FFFFFF" width="200"/>
</mx:Application>
Now you need to create an Account value object to hold the data returned from the
server. Right-click the src folder and select New ¾ ActionScript Class. Enter the class
name “Account” and click Finish. Add the code in Listing 4-19 to this class. Notice
that the code uses the [RemoteClass(alias=" com.appirio.Account")] annotation to
map the ActionScript version of the Account class ( Account.as ) to the Java version
( Account.java ). As a result, Account objects returned by the fetchAccount() method
of the service layer are deserialized into instances of the ActionScript Account class
automatically.
Listing 4-19. The Account.as file
package
{
[Bindable]
[RemoteClass(alias="com.appirio.Account")]
public class Account
{
public var id:String;
public var name:String;
public var city:String;
public var state:String;
public var phone:String;
public var website:String;
}
}
Server-Side Code
Your client-side code is now complete and you can jump back to the server side to
finish up your application. You need to add the JPA entity that will store your data in
App Engine. Create the Account class with the code from Listing 4-20. This class will
consist of the same members as the ActionScript class so that GraniteDS can translate
 
Search WWH ::




Custom Search