0

Good Day all,

I have the following on my page:

<h:selectOneMenu ....
  <f:selectItem ItemValue="#{null}" ItemLabel="--" />
  <f:selectItems value="#{myBean.sidList}" />
<h:selectOneMenu/>

The sidList is defined in the bean as HashMap with get/set as follows:

public HashMap<String,String> getSidList() return this.sidList;
public void setSidList(HashMap<string, String> sidList) this.sidList=sidList;

In the bean constructor, I load the hashmap, printout the values etc, all is good. However, the minute I try to access the page, I get "java.lang.nullpointerexception". The first line under that lists something wrong with the ...renderkit.SelectITemsIterator ...

Ummmmmm, ok. Here is the weird part. If I forgo loading sidList with a call to one of my java classes, and load the thing by hand

sidList.put("Nick", "Nick");
sidList.put("Zac", "Zac");

everything works fine ! The page loads and the dropdown is properly populated. I even tested with an empty list, and the ddlb worked fine.

Any ideas on what could be causing this?

Thanks in advance, Nick

Nikita
  • 21
  • 4
  • Try putting in your 'itemValue' attribute just "" instead of "#{null}" – danRod Nov 08 '13 at 03:14
  • If it works manually loading the map, then the error is obviously in your java classes which load it. If you say nothing about them is very dificult to find out something helpful. – Aritz Nov 08 '13 at 07:46

0 Answers0