You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Sifcenter <si...@email.it> on 2011/08/30 12:47:01 UTC

Binding attribute (or code) is processed also if rendered attribute is false

Hi all,

I am developing an JSF application but I encoutered a strange behavior while
binding one selectonemenu.


I have one request bean "foobean" and this JSF code:


&lt;h:panelGroup rendered="#{mycond}"&gt;

&lt;h:outputText value="Hi 1" /&gt;

&lt;h:selectOneMenu value="otherfoobean.property"
binding="#{foobean.foobind}" &gt;.... &lt;/h:selectOneMenu&gt;

&lt;/h:panelGroup&gt;


&lt;h:panelGroup rendered="#{mycond2}"&gt;

&lt;h:outputText value="Hi 2" /&gt;

&lt;h:selectOneMenu value="otherfoobean2.property"
binding="#{foobean.foobind}" &gt;.... &lt;/h:selectOneMenu&gt;

&lt;/h:panelGroup&gt;


when mycond is true and mycond2 is false the selectonemenu disappear because
(I think) also if mycond2 is false the binding in the second selectOneMenu
is anyway done ( I debbuged get/set methods and I saw that in the second
binding operation is called get method).


If I remove the second binding attribute, it works.


I need, to avoid duplication of request bean, to bind the same bean to
different components ( in my code is impossible two conditions are true in
the same time so at least I bind one componet at time).


Why?


I don't undestand if the rendered condition is false, why the code is anyway
processed?


I am using Myfaces 2.1.0

 
 --
 Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP
autenticato? GRATIS solo con Email.it: http://www.email.it/f
 
 Sponsor:
 Hotel Milano Marittima 4 stelle, direttamente sul mare con accesso diretto
alla spiaggia, offre ai propri clienti cortesia, servizio, comfort e
professionalita'. Tutti gli ambienti sono climatizzati. Gratis III e IV
letto per tutta l'estate
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=11768&d=20110830


 
 
 --
 Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP autenticato? GRATIS solo con Email.it http://www.email.it/f
 
 Sponsor:
 Centinaia di Idee Regalo a partire da 1 euro! Su MisterCupido.com alta qualita' a prezzi imbattibili... e spedizioni in 2/3 giorni!
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=11452&d=30-8