I have a component say,<h:selectOneMenu> .To this i am binding values using <f:selectItems>. In the backing bean i am getting values from database into a map and i am binding that map to <f:selectItems> like as shown below:
If i write like below in my page
In the browser i am getting error like selectItems found null. and the page is not displaying. How can we write the null checking condition on this so that the page can render normally.
That isn't what you asked. I tried this with JSF 2.0 and 1.2 and couldn't replicate the error, when selectitems gets null it just doesn't render. It's most likely an exception that is being propagated up to the selectItems component or it might be something like if a map key/value is null, either way the solution is in your Java code rather than the presentation code.
subject: how to render a component based on condition