-
1. Re: multiple components with same name in same context
lucianofen Oct 16, 2008 10:46 AM (in response to gothmog)you can use
@In(value=
contextVariableName
)
Specifies the name of the context variable explicitly, instead of using the annotated instance variable name.Or also you can use JSF-EL to define the binding
@In(value=
#{expression}
)so the binding between component and field is not 1 to 1
regards
Luciano -
2. Re: multiple components with same name in same context
gothmog Oct 16, 2008 11:16 AM (in response to gothmog)Thanks Luciano,
I did know about the value attribute specifying a different name for the context variable but I couldn't really see the point as you just shift the one to one relationship from one hard coded name to another.
Didn't realise you could use EL in the value attribute, I guess you could then make {expression} a page param and have the multiple components send in their appropriate id.
That might work. You could then retrieve instance data based on that id. Have you tried something like this before. What I am trying to do is have a reusable UI component in a ui:composition and then just drop it on many pages and multiple on the same page and have it interact with the same Seam backend component, with injection handling the instance of the component that is being acted on.
I have an app that the user can organise many grids on the same page that essentially have the same behaviour but just operate on different instance data.
Cheers
Troy