• 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: Setting selected object in parent component
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting selected object in parent component


  • Subject: Re: Setting selected object in parent component
  • From: Leif Harrison <email@hidden>
  • Date: Wed, 13 May 2009 12:06:02 -0700

What should I do if synchronizeVariablesWithBindings is true? (or should I just implement it to be false for the parent component in this case?)

	- Leif

On May 13, 2009, at 11:56 AM, Ricardo J. Parada wrote:

If your component's synchronizeVariableWithBindings(0 returns false then the component should use setValueForBinding() to set the value in the parent component.



On May 13, 2009, at 2:48 PM, Leif Harrison wrote:

Hey guys (and gals),

I'm trying to figure out how to propagate an object selection from a child component up to it's parent (and down to another child component, but that should just be a simple binding).

My component hierarchy (a bit simplified) looks like this:
<ParentComponent>
	<Component1>
		<AjaxUpdateContainer>
			Object1 list  <= has an action to select an Object1
		</AjaxUpdateContainer>
	</Component1>
	<Component2 selectedObject1="selectedObject1">
		<AjaxUpdateContainer>
			selectedObject1 detail
			Object2 list   <= has an action to select an Object2
		</AjaxUpdateContainer>
	</Component2>
	<AjaxUpdateContainer>
		<wo:if selectedObject2>
			<Component3 selectedObject2="selectedObject2">
				<AjaxUpdateContainer>
					selectedObject2 detail
				</AjaxUpdateContainer>
			<Component3>
		</wo:if>
	</AjaxUpdateContainer>
</ParentComponent >

Now, somehow I got the selection and detail display of Object1 working just fine. But...now that I'm trying to get the selection/ detail display of Object2 working, I can't seem to get it to work right.

All of the components involved are currently just using simple public variable bindings (yeah, I know, I should be using accessors for better encapsulation...), with the "selection" methods in Component1 and Component2 using parent.setValueForBinding to set the selected object in the parent component.

Is it just a fluke that the selection of Object1 is working? Should I be using non-synchronized bindings for my parent component? Or is there something else I'm missing (or a better way to do this)?

	- Leif

----------
Leif Harrison
email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Setting selected object in parent component
      • From: "Ricardo J. Parada" <email@hidden>
References: 
 >Setting selected object in parent component (From: Leif Harrison <email@hidden>)
 >Re: Setting selected object in parent component (From: "Ricardo J. Parada" <email@hidden>)

  • Prev by Date: Re: Setting selected object in parent component
  • Next by Date: Re: Setting selected object in parent component
  • Previous by thread: Re: Setting selected object in parent component
  • Next by thread: Re: Setting selected object in parent component
  • Index(es):
    • Date
    • Thread