Java – WebOrb/Flex: How to call a method on a RemoteClass returned by a RemoteObject

apache-flexjavaremoteobjectserializationweborb

I have a RemoteObject returning a 'Schedule' class. I've created a client side RemoteClass to map to it. All properties of the class instance are coming in fine. I just not clear on how I go about calling methods on the class. How would I call a setter on startdate?

package classes.remote
{
[Bindable]
[RemoteClass(alias="com.site.data.schedule.Schedule")]
public class Schedule
{

    public var id:int; 


    public var modifydate:Date;
    public var startdate:Date;
    public var enddate:Date;


}

}

Best Answer

You cannot invoke methods that are defined on the server class from within a Flex application. AMF only supports serialization of data, i.e. properties or public fields. If you just want to set values to the properties of the object after it's been returned, you set them like any other variable

schedule.startDate = new Date();