Re: Setting selected object in parent component
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 14:15:19 -0700
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