And I would like to change the #{cc.attrs.value} by #{internalBean.someAction}, in other words: change the (String) value of user defined (external) bean by a method of my composite component. How I can do it?

I don't think you can. h:outputText is expecting a value expression so I don't see how you can use a method expression. Maybe I'm not understanding the question so can you clarify.
–
AndyJul 15 '13 at 19:11

Ok, I will explain it more exactly: 'value' is a property of an external bean (f.e.: <xx:myComponent value="#{extBean.val}"/>) and 'someAction()' is a method of my internal bean (inside the composite component). And I would like to get this value inside the method and change it. I may do it with a lookup - FacesContext...
–
Petr DušekJul 15 '13 at 19:24

I think that's it right ? What JSF version are you using ?
–
AndyJul 15 '13 at 19:30

One more question. When you make that change, you also what that change to be seen by the external bean right ? So say external bean had a field with value Peter and when you pass it and change it to a new value say "Truck". the next time you print the value of external bean will it be Truck or Peter ?
–
AndyJul 15 '13 at 19:37

Thanks a lot. But I am afraid, I need another solution, because I am developing a composite component for programmers. So they will implementing the external bean, not me. This means, that I can't set up neither a type of the bean nor a name. Is it possible to do it in some general way via @ManagedProperty?
–
Petr DušekJul 16 '13 at 13:57

@PetrDušek I'm not sure. I can try to look. The problem is you want the change to be reflected to the other other so I'm trying to figure out how you might know the object type.
–
AndyJul 16 '13 at 14:35

The only thing I need is this: pass the String property from an external bean and manipulate it on the internal side. Is this allowed?: @ManagedProperty(value = "#{cc.attrs.value}") private String value;
–
Petr DušekJul 16 '13 at 15:32

I don't need to know the object type, I may write it confusing - I only want to deal with the String property.
–
Petr DušekJul 16 '13 at 15:35

@PetrDušek Then option #1 should work for you. I mean the one in my answer when you use f:setPropertyActionListener. I am passing a String from the external managed bean to the internal one. And you can manipulate it as you want. what is it that you don't like with it ?
–
AndyJul 16 '13 at 15:48

I apologize Petr. Somewhere along the way I failed to see the entire picture (setter being called). BalusC explains why this works in the comments. Ignore the StringBuilder part (but keep in mind you can use type in the future to pass objects other than String). Thank you so much for pointing this out and again sorry for the confusion.
–
AndyJul 17 '13 at 15:27

It is ok, Andy, thanks you for a productive discusion. See you!
–
Petr DušekJul 18 '13 at 7:11