Hello all,

I apologize in advance if this is an obvious question. I am calling a component to fill out an address form and I would like to make it generic for several different address types but I am not quite sure how. Is it possible to call different methods on an EO based on a string passed to the component? I am thinking something along the lines of the code below, but that doesn't work:



        private String email;
        private String currentAddressType;


        public void setCurrentAddressType(String string) {
                // string takes values such as "home", "work"
                currentAddressType = string;
        }

        /**
         * @return the email
         */
        public String email() {
                return aPerson().+currentAddressType+"Address"().email();
        }


        /**
         * @param email the email to set
         */
        public void setEmail(String email) {
NSLog.out.appendln("AjaxModalCurrentAddressDetail setEmail to " +email);
                aPerson().+currentAddressType+"Address"().setEmail(email);
        }

Thanks!

David
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to