myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Robinson" <andrew.rw.robin...@gmail.com>
Subject Re: [MyFaces] multiple components binding to same backing bean property
Date Tue, 25 Mar 2008 12:57:10 GMT
Binding two components to the same property is a definite no no. A
component can only be used once in a page and your binding would
attempt to put it twice in the same page.  Use a different binding for
every component.

On 3/25/08, Varun Shingal <varun.shingal@versata.com> wrote:
> Hi
>
> First a little background.I had developed a few of my own components and
> was using the myFaces-1.1.3 jars till now. Everything worked fine for
> this but I frequently got the problem of the duplicate id issue which
> has been discussed in the forum before. I therefore moved to the
> myFace-1.1.5 version and that is when the problem came up.
>
> I have developed a tag, say <a:myTag> which supports the binding
> attribute so Il have <a:myTag binding="#{bbean.prop}" value="One"/>. Now
> suppose I want to have another tag in the same jsp<a:myTag
> binding="#{bbean.prop}" value="Two"/>. Thus my jsp would have
>
> <a:myTag binding="#{bbean.prop}" value="One"/>
> <a:myTag binding="#{bbean.prop}" value="Two"/>
>
> This leads to a JasperException in the page. It worked fine with 1.1.3
> but gives the exception on moving to 1.1.5. If I remove any one of the
> lines it works fine and if i change the property "prop" to which it is
> bound then also it works fine. So something like this works:
>
> <a:myTag binding="#{bbean.prop}" value="One"/>
> <a:myTag binding="#{bbean.prop2}" value="Two"/>
>
> Any idea where I could be going wrong? Any help is appreciated.
>
> Thanks
> Varun
>
>

Mime
View raw message