Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Condional reRender  RSS feed

 
Richard Roszak
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to make a reRender conditional. Not sure how I would do this:


if ManageBean.tFlag is true
then



else



Is this possible to do in Jsf?

Thanks
 
Teena Mariam
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please try this way:
make a list containing : title, date, id, name, current_panel
and try this in the a4j: support as the value of the reRender attribute:
reRender=#{(ManageBean.tFlag=='true' ? list : 'title')}

I haven't tried the code. Please check it. (when i was using jsf, i had problems with boolean flags. so i turned to integer or string flags)

Regards,
Teena
 
Richard Roszak
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Teena,
I took your advice. I used a string instead of a boolean.






In my ManagesBean I set:



or



as required. This worked for me.

Thanks
 
Teena Mariam
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Solution.
(In your case, you don't have to change the flag's type to String, because you are not checking its value in the EL. I faced the problem only when I used boolean flags in EL.)

Regards,
Teena
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!