• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: binding a complete component to an object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: binding a complete component to an object


  • Subject: Re: binding a complete component to an object
  • From: Chuck Hill <email@hidden>
  • Date: Sun, 09 Nov 2003 11:06:53 -0800

I'm not sure that I understand your question.  I'll answer what I think you
as asking. :-)

Q. On some page (which I will call SomePage) there is a User object that I
want to edit in a PersonEdit component on that page.  How do I pass the
Person object from SomePage to PersonEdit?

A:

(1) Make sure that there are access/mutator method on SomePage for the User
instance variable:
protected User aUser;
(You can also make aUser public but I dislike that)

public User user() {
    return aUser;
}
public void setUser(User newUser) {
    aUser = newUser;
}

(2) Make sure that there are access/mutator method on PersonEdit for the
User instance variable that will be edited:
protected User userToEdit;
(You can also make userToEdit public but...)

public User userToEdit() {
    return userToEdit;
}
public void setUserToEdit(User newUser) {
    userToEdit= newUser;
}

(3) Use the inspector to add this binding to the PersonEdit component on
SomePage:
userToEdit = user;


Notes:
- I've used different names for user, aUser, userToEdit to show that all
are not the same.  They could all be called user and the binding would look
like:
user = user;

- You can add the 'userToEdit' binding to the API for the PersonEdit
component in the API editor in WOBuilder (looks like a piece from a jigsaw
puzzle).  This makes using the PersonEdit component easier as you don't
need to remember what the binding names are.



Chuck



At 10:14 AM 09/11/2003 +0100, Andreas Kosmala wrote:
>Hi all,
>
>sorry for the eventually stupid question but I dont find a solution in
>the docs: what I want to do is nothing special in my opinion: When I use
>a user component I wrote on my own (e.g. PersonEdit) within a page, I
>want to bind this complete user component to one object-attribute (of
>the corresponding class PersonEdit) within this page. How to do this?!
>User components dont offer any bindings at all.
>
>regards,
>Andreas
>_______________________________________________
>webobjects-dev mailing list | email@hidden
>Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
>Do not post admin requests to the list. They will be ignored.
>

--

Chuck Hill                                 email@hidden
Global Village Consulting Inc.             http://www.global-village.net
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: binding a complete component to an object
      • From: Andreas Kosmala <email@hidden>
References: 
 >binding a complete component to an object (From: Andreas Kosmala <email@hidden>)

  • Prev by Date: Re: EOJavaClass.template and 5.2
  • Next by Date: index of WODisplayGroup.displayedObjects() array
  • Previous by thread: binding a complete component to an object
  • Next by thread: Re: binding a complete component to an object
  • Index(es):
    • Date
    • Thread