Introduction

src

A Solution

Code

Conclusion

I encountered a situation the other day where I need to include a JSF page based on a parameter passed in via a. This seems like a very reasonable kind of idea. I expected to be able to make theuse a dynamically setparameter using EL from the. This is where I went wrong (the idea was good...). Theis a tag handler. It is evaluated on Restore View Phase. The value processing does not take place until the Apply Request Values Phase. This presents a problem since the EL binding for myis based on thewhich is aobject. So we are out of phase. The page will display the results, but all the AJAX will not work.A solution to the problem involves using staticelements wrapped inelements. This allows the tag handler to resolve the page to include, and then the fragment determines (via late binding) whether to display the page based on thepassed. The page is supported by abean to keep the page in scope.Here is an example of how to do it.I have put the complete NetBeans 7.2.1 project using Mojarra on Bitbucket. The project uses Apache Maven , and was tested using GlassFish 3.1.2