Hi, maybe I was bit short in my question but I'll try to be more precise. My
request is quite connected with your first solution. However, my
requirements are unfortunately not that simple that I can have 1-1
connection between UI component on JSF page and binding component in my
backing bean.
I want to be able to check dynamically 0 or many components on JSF page if
they should be rendered. If a component should be rendered or not is decided
using f:attribute for the specific component. Since it should be easy to
have as many components with this attribute I have the binding to an element
in a map of UIComponent's [binding="#{mybean.componentMap[x]}"]. x is 0, 1,
2, 3 etc depending on how many components is on the JSF page. I also use the
rendered attribute, and have a method in which my problem is situated. Since
I do not have, as I already mentioned, a 1-1 connection between JSF
component and binding bean component I am not sure which component in my
component map actually is calling the rendered attribute. Is it component 1,
2, 3 or 4?
So my question is, can I in the rendered method get the calling component
from FacesContext? If this is possible, I guess I do not really need the
component binding.
Hope you understand what I mean.
Thanks in advance!
/Pichdude
Nebinger, David wrote:
>
>> Is it possible to find out which component
>> in the ViewRoot I am currently working with?
>
> What do you mean, which component you're working with?
>
> Perhaps you're really asking a binding question, i.e. what UI component
> is my particular backing bean member populated from or somesuch. For
> this, you add a UIComponent member (with appropriate getter/setter) then
> use the [binding="#{mybean.component}"] in your jsf tag. This way your
> backing bean has direct access to the component that is bound to a
> field.
>
> If you're asking a question about custom component development and
> 'where in the tree am I?', this info is available by existing inherited
> methods for retrieving the parent component, you can repeatedly call
> this until you get to the root.
>
> If neither of these are really the question you were asking, well it
> would be a reflection of the ambiguity in the original post...
>
>
--
View this message in context:
http://www.nabble.com/Find-current-component-tf3818677.html#a10817632
Sent from the MyFaces - Users mailing list archive at Nabble.com.