You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Mario Ivankovits <ma...@ops.co.at> on 2005/08/01 11:58:19 UTC
(MYFACES-334) aliasbean and alias usage in binding
>
> [ http://issues.apache.org/jira/browse/MYFACES-334?page=all ]
>
>Mathias Broekelmann closed MYFACES-334:
>---------------------------------------
>
> Resolution: Won't Fix
>
>component bindings are resolved at creation time of the component and is out of scope of the alias bean component. JSF allows you to create only one component instance for one jsf tag.
>
>If you just need to access the component instance try to use a managed bean which acts as an interface between the component and the aliased bean. The component instance is stored in the non aliased bean and the aliased bean uses the non aliased bean to access the component instance.
We try to use "<jsp:include" to use the same jsp template with different
backing beans.
Around the include we placed the alias bean.
<x:aliasBean alias="coTopicEdit" value="coSuperEdit">
<jsp:include page="TopicTable.jsp"/>
</x:aliasBean>
<x:aliasBean alias="coTopicEdit" value="coBasicEdit">
<jsp:include page="TopicTable.jsp"/>
</x:aliasBean>
So there are two JSF tags and two component instances.
Your workaround works as long as we do not use nested tables, which
might happen.
With the hack I outlined in the jira ticket it is possible to make it
work, so why not find a clean solution for it?
---
Mario
Re: (MYFACES-334) aliasbean and alias usage in binding
Posted by Mathias Broekelmann <mb...@PSI.DE>.
Mario Ivankovits wrote:
>
>> What problems do you have by using nested tables and the suggested
>> workaround?
>
> Every aliased component need its own backing bean then to ensure
> uniqueness.
Your can use a map for this. But how could that be a problem with the
datatable?
>
>> Your hack doesn´t work on tables if you alias the row var and use it
>> for a binding.
>
> Alias the "row var" - what do you mean?
the datatable has a attribute var which is used to get the current
instance for each row while the datatable is iterating the datamodel. If
you bind a component through an alias to that var it wouldn´t work with
your workaround since the datatable doesn´t iterate over the rows when
you process the aliases in the restoreView method of your Viewhandler.
Your alias will be null.
Regards,
Mathias
Re: (MYFACES-334) aliasbean and alias usage in binding
Posted by Mario Ivankovits <ma...@ops.co.at>.
Mathias Broekelmann wrote:
> What problems do you have by using nested tables and the suggested
> workaround?
Every aliased component need its own backing bean then to ensure uniqueness.
> Your hack doesn´t work on tables if you alias the row var and use it
> for a binding.
Alias the "row var" - what do you mean?
---
Mario
Re: (MYFACES-334) aliasbean and alias usage in binding
Posted by Mathias Broekelmann <mb...@PSI.DE>.
What problems do you have by using nested tables and the suggested
workaround?
Your hack doesn´t work on tables if you alias the row var and use it for
a binding.
Regards,
Mathias
> Your workaround works as long as we do not use nested tables, which
> might happen.