• 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 (solved)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting selected object in parent component (solved)


  • Subject: Re: Setting selected object in parent component (solved)
  • From: Leif Harrison <email@hidden>
  • Date: Mon, 18 May 2009 10:26:17 -0700

I figured I'd follow up on this, in case someone else has the same issue...

It turns out I was just being dumb and not including selectedObject2 in the bindings of Component2, so of course the binding was not being set in the parent to be then passed to Component3.

(figured it out a couple days ago, just hadn't had a chance to post my solution)

	- Leif

On May 13, 2009, at 2:38 PM, Ricardo J. Parada wrote:

Hmmm... I'm not sure.... I always use non-sync components and pull the values when I need them with valueForBinding() and set values in the parent via setValueForBinding() when I need to.


On May 13, 2009, at 5:15 PM, Leif Harrison wrote:

Well, in this case all of my components have synchronizeVariablesWithBindings as (presumably) true, since they're just subclasses of ERXComponent (and I don't override the method myself).

And it looks like in the selectedObject1 case, everything still works just fine if I comment out the parent.setValueForBinding call.

However, still no idea why the selectedObject2 case does not appear to be updating the binding in the parent component. :(

Maybe because I'm using Ajax actions (AjaxSubmitButton) for everything?

	- 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


_______________________________________________ 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
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>)
 >Re: 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: Graceful shutdown of WO apps + monitor + wotaskd
  • Next by Date: Does propagatesPrimaryKey work in to-many relationships?
  • Previous by thread: Re: Setting selected object in parent component
  • Next by thread: Scheduled backup + files store
  • Index(es):
    • Date
    • Thread